diff --git a/python/commons/bs.py b/python/commons/bs.py index 3cbce3d..f7bd041 100644 --- a/python/commons/bs.py +++ b/python/commons/bs.py @@ -2,3 +2,4 @@ schema = dj.schema('dimitri_brain_state', locals()) +schema.spawn_missing_classes() \ No newline at end of file diff --git a/python/commons/common.py b/python/commons/common.py index 80e589c..e77cbe6 100644 --- a/python/commons/common.py +++ b/python/commons/common.py @@ -3,3 +3,4 @@ schema = dj.schema('common', locals()) +schema.spawn_missing_classes() \ No newline at end of file diff --git a/python/commons/inj.py b/python/commons/inj.py new file mode 100644 index 0000000..83bc48b --- /dev/null +++ b/python/commons/inj.py @@ -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 + """ diff --git a/python/commons/mc.py b/python/commons/mc.py index 76d5647..d919ff7 100644 --- a/python/commons/mc.py +++ b/python/commons/mc.py @@ -2,3 +2,4 @@ schema = dj.schema('common_microcolumns', locals()) +schema.spawn_missing_classes() \ No newline at end of file diff --git a/python/commons/mice.py b/python/commons/mice.py index cc8eec6..9a749f6 100644 --- a/python/commons/mice.py +++ b/python/commons/mice.py @@ -2,3 +2,4 @@ schema = dj.schema('common_mice', locals()) +schema.spawn_missing_classes() \ No newline at end of file diff --git a/python/commons/mp.py b/python/commons/mp.py index d7998f9..db846e3 100644 --- a/python/commons/mp.py +++ b/python/commons/mp.py @@ -2,3 +2,4 @@ schema = dj.schema('common_multipatch', locals()) +schema.spawn_missing_classes() \ No newline at end of file diff --git a/python/commons/opt.py b/python/commons/opt.py index 447fb58..2a8e480 100644 --- a/python/commons/opt.py +++ b/python/commons/opt.py @@ -2,3 +2,4 @@ schema = dj.schema('common_optical', locals()) +schema.spawn_missing_classes() \ No newline at end of file diff --git a/python/commons/psy.py b/python/commons/psy.py index 641fd1a..335a9a1 100644 --- a/python/commons/psy.py +++ b/python/commons/psy.py @@ -2,3 +2,4 @@ schema = dj.schema('common_psy', locals()) +schema.spawn_missing_classes() \ No newline at end of file diff --git a/python/commons/pupil.py b/python/commons/pupil.py index 77d0963..2cde669 100644 --- a/python/commons/pupil.py +++ b/python/commons/pupil.py @@ -3,3 +3,4 @@ schema = dj.schema('dimitri_pupil', locals()) +schema.spawn_missing_classes() \ No newline at end of file diff --git a/python/commons/reso.py b/python/commons/reso.py index ab8acaa..fa427ad 100644 --- a/python/commons/reso.py +++ b/python/commons/reso.py @@ -1,3 +1,4 @@ import datajoint as dj schema = dj.schema('common_resonant', locals()) +schema.spawn_missing_classes() \ No newline at end of file diff --git a/python/commons/tp.py b/python/commons/tp.py index eaef47d..b58bb61 100644 --- a/python/commons/tp.py +++ b/python/commons/tp.py @@ -3,3 +3,4 @@ schema = dj.schema('common_two_photon', locals()) +schema.spawn_missing_classes() \ No newline at end of file diff --git a/python/commons/virus.py b/python/commons/virus.py index 8c6775d..32213ee 100644 --- a/python/commons/virus.py +++ b/python/commons/virus.py @@ -3,8 +3,6 @@ schema = dj.schema('common_virus', locals()) - - @schema class Gene(dj.Manual): definition = """ @@ -17,6 +15,7 @@ class Gene(dj.Manual): risk="no known risk" : varchar(512) # risk for humans """ + @schema class Construct(dj.Manual): definition = """ @@ -24,6 +23,8 @@ class Construct(dj.Manual): construct_id : char(80) """ + + @schema class ConstructGene(dj.Manual): definition = """ @@ -33,6 +34,7 @@ class ConstructGene(dj.Manual): gene_name : char(30) # name of the gene """ + @schema class Type(dj.Lookup): definition = """ @@ -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 @@ -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 diff --git a/schemas/+inj/AtlasStereotacticTargets.m b/schemas/+inj/AtlasStereotacticTargets.m new file mode 100644 index 0000000..5163dcb --- /dev/null +++ b/schemas/+inj/AtlasStereotacticTargets.m @@ -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 \ No newline at end of file diff --git a/schemas/+inj/GuidanceMethod.m b/schemas/+inj/GuidanceMethod.m new file mode 100644 index 0000000..f37d419 --- /dev/null +++ b/schemas/+inj/GuidanceMethod.m @@ -0,0 +1,10 @@ +%{ +inj.GuidanceMethod (lookup) # guidance method for injections + +guidance : char(20) +--- +%} + + +classdef GuidanceMethod < dj.Relvar +end \ No newline at end of file diff --git a/schemas/+inj/InjectionLocation.m b/schemas/+inj/InjectionLocation.m new file mode 100644 index 0000000..d4d68b5 --- /dev/null +++ b/schemas/+inj/InjectionLocation.m @@ -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 \ No newline at end of file diff --git a/schemas/+inj/Site.m b/schemas/+inj/Site.m new file mode 100644 index 0000000..b67b56a --- /dev/null +++ b/schemas/+inj/Site.m @@ -0,0 +1,9 @@ +%{ +inj.Site (lookup) # Injection target site +injection_site : char(8) # ID +--- +%} + + +classdef Site < dj.Relvar +end \ No newline at end of file diff --git a/schemas/+inj/VirusInjection.m b/schemas/+inj/VirusInjection.m new file mode 100644 index 0000000..9bd41db --- /dev/null +++ b/schemas/+inj/VirusInjection.m @@ -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 \ No newline at end of file diff --git a/schemas/+inj/getSchema.m b/schemas/+inj/getSchema.m new file mode 100644 index 0000000..526a0e0 --- /dev/null +++ b/schemas/+inj/getSchema.m @@ -0,0 +1,7 @@ +function obj = getSchema +persistent schemaObject +if isempty(schemaObject) + schemaObject = dj.Schema(dj.conn, 'inj', 'common_injections'); +end +obj = schemaObject; +end