forked from boazmohar/dj-spineimaging
-
Notifications
You must be signed in to change notification settings - Fork 1
/
lab.py
151 lines (122 loc) · 3.71 KB
/
lab.py
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
import datajoint as dj
schema = dj.schema('boazmohar_lab', locals())
@schema
class Person(dj.Manual):
definition = """
username : varchar(12)
----
fullname : varchar(60)
"""
contents = [('boazmohar', 'Boaz Mohar')]
@schema
class Rig(dj.Lookup): # This list will be everchanging and espanding for the lab. I don't think it should be a lookup table.
definition = """
rig : varchar(16)
---
room : varchar(20) # example 2w.342
rig_description : varchar(1024)
"""
contents = [('Spine2P', '2c.382', '3D resonant high NA 2P microscope for dendrite and spine imaging')]
@schema
class AnimalSource(dj.Lookup):
definition = """
animal_source : varchar(30)
"""
contents = zip(['Jackson Labs', 'Charles River', 'MMRRC', 'Taconic', 'Other'])
@schema
class Species(dj.Lookup):
definition = """
species : varchar(60)
"""
contents = zip(['mus musculus'])
@schema
class Strain(dj.Lookup): # This list will be everchanging and espanding for the lab. I don't think it should be a lookup table.
definition = """
# Mouse strain
strain : varchar(30) # mouse strain
"""
contents = zip(['Syt17 (NO14)', 'Chrna2 OE25', 'wt'])
@schema
class GeneModification(dj.Lookup): # This list will be everchanging and espanding for the lab. I don't think it should be a lookup table.
definition = """
gene_modification : varchar(60)
"""
contents = zip(['Syt17-cre', 'ACTB-tTa', 'Chrna2-cre', 'CamK2a-tTA', 'TITL-GCaMP6f'])
@schema
class Subject(dj.Manual): # I prefer animal rather than subject
definition = """
subject_id : int # institution animal ID
---
-> Species
date_of_birth : date
date_of_surgery : date
sex : enum('M','F','Unknown')
-> [nullable] AnimalSource
"""
class GeneModification(dj.Part):
definition = """
# Subject gene modifications
-> Subject
-> GeneModification
"""
class Strain(dj.Part):
definition = """
-> Subject
-> Strain
"""
@schema
class WaterRestriction(dj.Manual):
definition = """
-> Subject
water_restriction_number : varchar(16) # WR number
---
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'])
@schema
class Virus(dj.Lookup):
definition = """
virus_id : int unsigned
---
-> VirusSource
virus_name : varchar(64)
titer : Decimal(20,1)
order_date : date
remarks : varchar(256)
"""
@schema
class VirusReference(dj.Lookup):
definition = """
virus_reference : varchar(60)
"""
contents = zip(['Bregma', 'lambda'])
@schema
class Surgery(dj.Manual):
definition = """
-> Subject
surgery_id : int # surgery number
---
date_of_surgery : date
description : varchar(256)
"""
class VirusInjection(dj.Part): # I am unsure if part table entry will be enforced
definition = """
# Virus injections
-> Surgery
injection_id : int
---
-> Virus
-> VirusReference
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
location_name : varchar(60)
volume : Decimal(10,3) # in nl
dilution : Decimal (10, 2) # 1 to how much
"""