Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python/commons/bs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

schema = dj.schema('dimitri_brain_state', locals())

schema.spawn_missing_classes()
1 change: 1 addition & 0 deletions python/commons/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
schema = dj.schema('common', locals())


schema.spawn_missing_classes()
81 changes: 81 additions & 0 deletions python/commons/inj.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import datajoint as dj
from commons import virus, mice

schema = dj.schema('common_injections', locals())


@schema
class Site(dj.Lookup):
definition = """
# Injection target site

injection_site : char(8) # ID
---
"""

@property
def contents(self):
yield from zip(['V1', 'dLGN', 'AL', 'LM', 'S1','S2','M1', 'PM'])


@schema
class AtlasStereotacticTargets(dj.Lookup):
definition = """
# Unadjusted stereotactic coordinates from the mouse brain atlas

->Site
target_id : char(20) # ID for this set of coordinates
---
caudal : double # coordinate caudal from bregma in mm
lateral : double # lateral coordinate in mm
ventral : double # coordinate ventral from cortical surface in mm
lambda_bregma_basedist=4.21 : double # base distance between lambda and bregma from the stereotactic atlas in mm
"""
contents = [
dict(injection_site='dLGN', target_id='Tang2016', caudal=2.6, lateral=2.15, ventral=2.7),
dict(injection_site='V1', target_id='fabee01', caudal=3.8, lateral=2.5, ventral=0.3),
]

@schema
class GuidanceMethod(dj.Lookup):
definition = """
# guidance method for injections

guidance : char(20)
---
"""

@property
def contents(self):
yield from zip(['2P','stereotactic','intrinsic','other'])

@schema
class VirusInjection(dj.Manual):
definition = """
# Virus Injection

-> mice.Mice
-> virus.Virus
-> Site
---
-> GuidanceMethod
volume=null : double # injection volume in nl
speed=null : double # injection speed [nl/min]
toi=CURRENT_TIMESTAMP : timestamp # time of injection
"""

@schema
class InjectionLocation(dj.Manual):
definition = """
# Adjusted stereotactic coordinates for injection

->VirusInjection
->AtlasStereotacticTargets
---
lambda_bregma : double # distance between lambda and bregma in mm as measured
caudal : double # coordinate caudal from bregma in mm
lateral : double # lateral coordinate in mm
ventral : double # coordinate ventral from cortical surface in mm
adjustment : double # adjustement factor to convert atlas coordinates to this injection
toi=CURRENT_TIMESTAMP : timestamp # time of injection
"""
1 change: 1 addition & 0 deletions python/commons/mc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

schema = dj.schema('common_microcolumns', locals())

schema.spawn_missing_classes()
1 change: 1 addition & 0 deletions python/commons/mice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

schema = dj.schema('common_mice', locals())

schema.spawn_missing_classes()
1 change: 1 addition & 0 deletions python/commons/mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

schema = dj.schema('common_multipatch', locals())

schema.spawn_missing_classes()
1 change: 1 addition & 0 deletions python/commons/opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

schema = dj.schema('common_optical', locals())

schema.spawn_missing_classes()
1 change: 1 addition & 0 deletions python/commons/psy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

schema = dj.schema('common_psy', locals())

schema.spawn_missing_classes()
1 change: 1 addition & 0 deletions python/commons/pupil.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
schema = dj.schema('dimitri_pupil', locals())


schema.spawn_missing_classes()
1 change: 1 addition & 0 deletions python/commons/reso.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datajoint as dj

schema = dj.schema('common_resonant', locals())
schema.spawn_missing_classes()
1 change: 1 addition & 0 deletions python/commons/tp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
schema = dj.schema('common_two_photon', locals())


schema.spawn_missing_classes()
10 changes: 6 additions & 4 deletions python/commons/virus.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
schema = dj.schema('common_virus', locals())




@schema
class Gene(dj.Manual):
definition = """
Expand All @@ -17,13 +15,16 @@ class Gene(dj.Manual):
risk="no known risk" : varchar(512) # risk for humans
"""


@schema
class Construct(dj.Manual):
definition = """
# combinations of several genes

construct_id : char(80)
"""


@schema
class ConstructGene(dj.Manual):
definition = """
Expand All @@ -33,6 +34,7 @@ class ConstructGene(dj.Manual):
gene_name : char(30) # name of the gene
"""


@schema
class Type(dj.Lookup):
definition = """
Expand All @@ -43,7 +45,7 @@ class Type(dj.Lookup):

"""

contents = [(t,) for t in ['AAV', 'Rabies', 'Lenti','Herpes']]
contents = [(t,) for t in ['AAV', 'Rabies', 'Lenti', 'Herpes']]


@schema
Expand All @@ -57,7 +59,7 @@ class Source(dj.Lookup):

@property
def contents(self):
yield from zip(['Penn', 'UNC', 'Homegrown', 'MIT'])
yield from zip(['Penn', 'UNC', 'Homegrown', 'MIT', 'AToliasLab'])


@schema
Expand Down
14 changes: 14 additions & 0 deletions schemas/+inj/AtlasStereotacticTargets.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
%{
inj.AtlasStereotacticTargets (lookup) # Unadjusted stereotactic coordinates from the mouse brain atlas
->inj.Site
target_id : char(20) # ID for this set of coordinates
---
caudal : double # coordinate caudal from bregma in mm
lateral : double # lateral coordinate in mm
ventral : double # coordinate ventral from cortical surface in mm
lambda_bregma_basedist=4.21 : double # base distance between lambda and bregma from the stereotactic atlas in mm
%}


classdef AtlasStereotacticTargets < dj.Relvar
end
10 changes: 10 additions & 0 deletions schemas/+inj/GuidanceMethod.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%{
inj.GuidanceMethod (lookup) # guidance method for injections

guidance : char(20)
---
%}


classdef GuidanceMethod < dj.Relvar
end
17 changes: 17 additions & 0 deletions schemas/+inj/InjectionLocation.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
%{
inj.InjectionLocation (manual) # Adjusted stereotactic coordinates for injection

->inj.VirusInjection
->inj.AtlasStereotacticTargets
---
lambda_bregma : double # distance between lambda and bregma in mm as measured
caudal : double # coordinate caudal from bregma in mm
lateral : double # lateral coordinate in mm
ventral : double # coordinate ventral from cortical surface in mm
adjustment : double # adjustement factor to convert atlas coordinates to this injection
toi=CURRENT_TIMESTAMP : timestamp # time of injection
%}


classdef InjectionLocation < dj.Relvar
end
9 changes: 9 additions & 0 deletions schemas/+inj/Site.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
%{
inj.Site (lookup) # Injection target site
injection_site : char(8) # ID
---
%}


classdef Site < dj.Relvar
end
16 changes: 16 additions & 0 deletions schemas/+inj/VirusInjection.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%{
inj.VirusInjection (manual) # Virus Injection

-> mice.Mice
-> virus.Virus
-> inj.Site
---
-> inj.GuidanceMethod
volume=null : double # injection volume in nl
speed=null : double # injection speed [nl/min]
toi=CURRENT_TIMESTAMP : timestamp # time of injection
%}


classdef VirusInjection < dj.Relvar
end
7 changes: 7 additions & 0 deletions schemas/+inj/getSchema.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function obj = getSchema
persistent schemaObject
if isempty(schemaObject)
schemaObject = dj.Schema(dj.conn, 'inj', 'common_injections');
end
obj = schemaObject;
end