-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlab.py
More file actions
204 lines (168 loc) · 4.79 KB
/
lab.py
File metadata and controls
204 lines (168 loc) · 4.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
import datajoint as dj
schema = dj.schema(dj.config['lab.database'])
@schema
class Person(dj.Manual):
definition = """
username : varchar(24)
----
fullname : varchar(255)
"""
@schema
class Rig(dj.Manual):
definition = """
rig : varchar(24)
---
room : varchar(20) # example 2w.342
rig_description : varchar(1024)
"""
@schema
class AnimalSource(dj.Lookup):
definition = """
animal_source : varchar(30)
"""
contents = zip(['Jackson Labs', 'Allen Institute', 'Charles River', 'MMRRC', 'Taconic', 'Other'])
@schema
class ModifiedGene(dj.Manual):
definition = """
gene_modification : varchar(60)
---
gene_modification_description = '' : varchar(1000)
"""
@schema
class Subject(dj.Manual):
definition = """
subject_id : int # institution 6 digit animal ID
---
-> [nullable] Person # person responsible for the animal
cage_number : int # institution 6 digit animal ID
date_of_birth : date # format: yyyy-mm-dd
sex : enum('M','F','Unknown')
-> [nullable] AnimalSource # where was the animal ordered from
"""
class GeneModification(dj.Part):
definition = """
# Subject gene modifications
-> Subject
-> ModifiedGene
---
zygosity = 'Unknown' : enum('Het', 'Hom', 'Unknown')
type = 'Unknown' : enum('Knock-in', 'Transgene', 'Unknown')
"""
@schema
class CompleteGenotype(dj.Computed):
# should be computed
definition = """
-> Subject
---
complete_genotype : varchar(1000)
"""
def make(self, key):
pass
@schema
class WaterRestriction(dj.Manual):
definition = """
-> Subject
---
water_restriction_number : varchar(16) # WR number
cage_number : int
wr_start_date : date
wr_start_weight : Decimal(6,3)
"""
@schema
class VirusSource(dj.Lookup):
definition = """
virus_source : varchar(60)
"""
contents = zip(['Janelia', 'UPenn', 'Addgene', 'UNC', 'Other'])
@schema
class Serotype(dj.Manual):
definition = """
serotype : varchar(60)
"""
@schema
class Virus(dj.Manual):
definition = """
virus_id : int unsigned
---
-> VirusSource
-> Serotype
-> Person
virus_name : varchar(256)
titer : Decimal(20,1) #
order_date : date
remarks : varchar(256)
"""
class Notes(dj.Part):
definition = """
# Notes for virus
-> Virus
note_id : int
---
note : varchar(256)
"""
@schema
class SkullReference(dj.Lookup):
definition = """
skull_reference : varchar(60)
"""
contents = zip(['Bregma', 'Lambda'])
@schema
class BrainArea(dj.Lookup):
definition = """
brain_area = 'ALM' : varchar(32)
---
brain_area_description = null : varchar (4000) # name of the brain area
"""
contents = [('ALM', 'anterior lateral motor cortex'), ('vS1', 'vibrissal primary somatosensory cortex ("barrel cortex")'), ('all', 'all areas')]
@schema
class Hemisphere(dj.Lookup):
definition = """
hemisphere = 'left' : varchar(32)
"""
contents = zip(['left', 'right', 'both'])
@schema
class Surgery(dj.Manual):
definition = """
-> Subject
surgery_id : int # surgery number
---
-> Person
start_time : datetime # start time
end_time : datetime # end time
surgery_description : varchar(1000)
"""
class VirusInjection(dj.Part):
definition = """
# Virus injections
-> Surgery
injection_id : int
---
-> Virus
-> SkullReference
ml_location : Decimal(8,3) # um from ref left is positive
ap_location : Decimal(8,3) # um from ref anterior is positive
dv_location : Decimal(8,3) # um from dura dorsal is positive
volume : Decimal(10,3) # in nl
dilution : Decimal (10, 2) # 1 to how much
surgery_virus_injection_description : varchar(1000)
"""
class Procedure(dj.Part):
definition = """
# Other things you did to the animal
-> Surgery
procedure_id : int
---
-> SkullReference
ml_location=null : Decimal(8,3) # um from ref left is positive
ap_location=null : Decimal(8,3) # um from ref anterior is positive
dv_location=null : Decimal(8,3) # um from dura dorsal is positive
surgery_procedure_description : varchar(1000)
"""
@schema
class SurgeryLocation(dj.Manual):
definition = """
-> Surgery.Procedure
---
-> Hemisphere
-> BrainArea
"""