diff --git a/gui_tut1/index.npjson b/gui_tut1/index.npjson new file mode 100644 index 0000000..2bd23f1 --- /dev/null +++ b/gui_tut1/index.npjson @@ -0,0 +1,4 @@ +{ + "simConfig_python": "src/cfg.py", + "netParams_python": "src/netParams.py" +} \ No newline at end of file diff --git a/gui_tut1/src/cfg.py b/gui_tut1/src/cfg.py new file mode 100644 index 0000000..7867b86 --- /dev/null +++ b/gui_tut1/src/cfg.py @@ -0,0 +1,16 @@ +from netpyne import specs + +# Simulation options +cfg = specs.SimConfig() # object of class SimConfig to store simulation configuration + +cfg.duration = 0.2*1e3 # Duration of the simulation, in ms +cfg.dt = 0.1 # Internal integration timestep to use +cfg.verbose = False # Show detailed messages +cfg.recordTraces = {'V_soma':{'sec':'soma','loc':0.5,'var':'v'}, + 'V_dend': {'sec': 'dend', 'loc': 1.0, 'var':'v'}} # Dict with traces to record +cfg.recordCells = [0] +cfg.recordStep = 0.1 # Step size in ms to save data (eg. V traces, LFP, etc) +cfg.filename = 'gui_tut1' # Set file output name +cfg.saveJson = False # Save params, network and sim output to pickle file +cfg.analysis['iplotTraces'] = {'include': [0], 'overlay': True} +cfg.analysis['iplotRaster'] = {'markerSize': 5, 'showFig': True} diff --git a/gui_tut1.py b/gui_tut1/src/netParams.py similarity index 60% rename from gui_tut1.py rename to gui_tut1/src/netParams.py index 047f7f3..be09d2e 100644 --- a/gui_tut1.py +++ b/gui_tut1/src/netParams.py @@ -37,26 +37,3 @@ 'delay': 5, # delay min=0.2, mean=13.0, var = 1.4 'synMech': 'exc', 'sec': 'dend'} - -# Simulation options -simConfig = specs.SimConfig() # object of class SimConfig to store simulation configuration - -simConfig.duration = 0.2*1e3 # Duration of the simulation, in ms -simConfig.dt = 0.1 # Internal integration timestep to use -simConfig.verbose = False # Show detailed messages -simConfig.recordTraces = {'V_soma':{'sec':'soma','loc':0.5,'var':'v'}, - 'V_dend': {'sec': 'dend', 'loc': 1.0, 'var':'v'}} # Dict with traces to record -simConfig.recordCells = [0] -simConfig.recordStep = 0.1 # Step size in ms to save data (eg. V traces, LFP, etc) -simConfig.filename = 'gui_tut1' # Set file output name -simConfig.saveJson = False # Save params, network and sim output to pickle file -simConfig.analysis['iplotTraces'] = {'include': [0], 'overlay': True} -simConfig.analysis['iplotRaster'] = {'markerSize': 5, 'showFig': True} - - -if __name__ == '__main__': - netpyne_geppetto.netParams=netParams - netpyne_geppetto.simConfig=simConfig - -#from netpyne import sim -#sim.createSimulateAnalyze(netParams, simConfig) diff --git a/cells/PTcell.hoc b/gui_tut2/cells/PTcell.hoc similarity index 100% rename from cells/PTcell.hoc rename to gui_tut2/cells/PTcell.hoc diff --git a/cells/SRI.hoc b/gui_tut2/cells/SRI.hoc similarity index 100% rename from cells/SRI.hoc rename to gui_tut2/cells/SRI.hoc diff --git a/gui_tut2/index.npjson b/gui_tut2/index.npjson new file mode 100644 index 0000000..dfd3f66 --- /dev/null +++ b/gui_tut2/index.npjson @@ -0,0 +1,5 @@ +{ + "mod_folder": "../mod", + "simConfig_python": "src/cfg.py", + "netParams_python": "src/netParams.py" +} \ No newline at end of file diff --git a/gui_tut2/src/cfg.py b/gui_tut2/src/cfg.py new file mode 100644 index 0000000..4879e07 --- /dev/null +++ b/gui_tut2/src/cfg.py @@ -0,0 +1,16 @@ +from netpyne import specs + +# Simulation options +cfg = specs.SimConfig() # object of class SimConfig to store simulation configuration + +cfg.duration = 0.5*1e3 # Duration of the simulation, in ms +cfg.dt = 0.1 # Internal integration timestep to use +cfg.hParams['celsius'] = 34 +cfg.verbose = False # Show detailed messages +cfg.recordTraces = {'V_soma':{'sec':'soma','loc':0.5,'var':'v'}} # Dict with traces to record +cfg.recordStep = 0.1 # Step size in ms to save data (eg. V traces, LFP, etc) +cfg.filename = 'model_output' # Set file output name +cfg.savePickle = False # Save params, network and sim output to pickle file + +cfg.analysis['iplotRaster'] = {'markerSize': 5, 'showFig': True} +cfg.analysis['iplotTraces'] = {'include': [0,2], 'oneFigPer': 'trace'} diff --git a/gui_tut2.py b/gui_tut2/src/netParams.py similarity index 62% rename from gui_tut2.py rename to gui_tut2/src/netParams.py index f9cd7e0..4e81b55 100644 --- a/gui_tut2.py +++ b/gui_tut2/src/netParams.py @@ -43,27 +43,3 @@ 'delay': 5, 'synMech': 'GABA', 'sec': 'soma'} - - -# Simulation options -simConfig = specs.SimConfig() # object of class SimConfig to store simulation configuration - -simConfig.duration = 0.5*1e3 # Duration of the simulation, in ms -simConfig.dt = 0.1 # Internal integration timestep to use -simConfig.hParams['celsius'] = 34 -simConfig.verbose = False # Show detailed messages -simConfig.recordTraces = {'V_soma':{'sec':'soma','loc':0.5,'var':'v'}} # Dict with traces to record -simConfig.recordStep = 0.1 # Step size in ms to save data (eg. V traces, LFP, etc) -simConfig.filename = 'model_output' # Set file output name -simConfig.savePickle = False # Save params, network and sim output to pickle file - -simConfig.analysis['iplotRaster'] = {'markerSize': 5, 'showFig': True} -simConfig.analysis['iplotTraces'] = {'include': [0,2], 'oneFigPer': 'trace'} - -if __name__ == '__main__': - netpyne_geppetto.netParams=netParams - netpyne_geppetto.simConfig=simConfig - - -#from netpyne import sim -#sim.createSimulateAnalyze(netParams, simConfig) \ No newline at end of file diff --git a/cells/CSTR6.py b/gui_tut3/cells/CSTR6.py similarity index 100% rename from cells/CSTR6.py rename to gui_tut3/cells/CSTR6.py diff --git a/cells/CSTR_cellParams.json b/gui_tut3/cells/CSTR_cellParams.json similarity index 100% rename from cells/CSTR_cellParams.json rename to gui_tut3/cells/CSTR_cellParams.json diff --git a/cells/FScell.hoc b/gui_tut3/cells/FScell.hoc similarity index 100% rename from cells/FScell.hoc rename to gui_tut3/cells/FScell.hoc diff --git a/gui_tut3/index.npjson b/gui_tut3/index.npjson new file mode 100644 index 0000000..dfd3f66 --- /dev/null +++ b/gui_tut3/index.npjson @@ -0,0 +1,5 @@ +{ + "mod_folder": "../mod", + "simConfig_python": "src/cfg.py", + "netParams_python": "src/netParams.py" +} \ No newline at end of file diff --git a/gui_tut3/src/cfg.py b/gui_tut3/src/cfg.py new file mode 100644 index 0000000..344c48d --- /dev/null +++ b/gui_tut3/src/cfg.py @@ -0,0 +1,31 @@ +from netpyne import specs +from src.netParams import netParams + +#------------------------------------------------------------------------------ +# +# SIMULATION CONFIGURATION +# +#------------------------------------------------------------------------------ + +# Run parameters +cfg = specs.SimConfig() # object of class simConfig to store simulation configuration +cfg.duration = 1.0*1e3 # Duration of the simulation, in ms +cfg.hParams['v_init'] = -65 # set v_init to -65 mV +cfg.dt = 0.1 # Internal integration timestep to use +cfg.verbose = False # Show detailed messages +cfg.recordStep = 1 # Step size in ms to save data (eg. V traces, LFP, etc) +cfg.filename = 'rxd_net' # Set file output name + + +# Recording/plotting parameters +cfg.recordTraces = {'V_soma':{'sec': 'soma','loc': 0.5,'var': 'v'}, + 'ik_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'ik'}, + 'cai_soma': {'sec': 'soma', 'loc':0.5, 'var': 'cai'}, + 'cao_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'cao'}} + +cfg.recordLFP = [[-15, y, 1.0*netParams.sizeZ] for y in range(int(netParams.sizeY/3), int(netParams.sizeY), int(netParams.sizeY/3))] + +cfg.analysis['iplotTraces'] ={'include': [0]} +cfg.analysis['iplotRaster'] = {'orderBy': 'y', 'orderInverse': True, 'saveFig': True, 'figSize': (9,3)} # Plot a raster +cfg.analysis['iplotLFP'] = {'includeAxon': False, 'figSize': (6,10), 'saveFig': True} +cfg.analysis['iplotRxDConcentration'] = {'speciesLabel': 'ca', 'regionLabel': 'ecs'} diff --git a/gui_tut3.py b/gui_tut3/src/netParams.py similarity index 78% rename from gui_tut3.py rename to gui_tut3/src/netParams.py index 554c847..b9582b6 100644 --- a/gui_tut3.py +++ b/gui_tut3/src/netParams.py @@ -121,47 +121,3 @@ ### rates netParams.rxdParams['rates'] = {'ip3rg': {'species': h_gate, 'rate': '(1. / (1 + 1000. * ca[cyt] / (0.3)) - %s) / ip3rtau'%(h_gate)}} - - - - -#------------------------------------------------------------------------------ -# -# SIMULATION CONFIGURATION -# -#------------------------------------------------------------------------------ - -# Run parameters -simConfig = specs.SimConfig() # object of class simConfig to store simulation configuration -simConfig.duration = 1.0*1e3 # Duration of the simulation, in ms -simConfig.hParams['v_init'] = -65 # set v_init to -65 mV -simConfig.dt = 0.1 # Internal integration timestep to use -simConfig.verbose = False # Show detailed messages -simConfig.recordStep = 1 # Step size in ms to save data (eg. V traces, LFP, etc) -simConfig.filename = 'rxd_net' # Set file output name - - -# Recording/plotting parameters -simConfig.recordTraces = {'V_soma':{'sec': 'soma','loc': 0.5,'var': 'v'}, - 'ik_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'ik'}, - 'cai_soma': {'sec': 'soma', 'loc':0.5, 'var': 'cai'}, - 'cao_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'cao'}} - -simConfig.recordLFP = [[-15, y, 1.0*netParams.sizeZ] for y in range(int(netParams.sizeY/3), int(netParams.sizeY), int(netParams.sizeY/3))] - -simConfig.analysis['iplotTraces'] ={'include': [0]} -simConfig.analysis['iplotRaster'] = {'orderBy': 'y', 'orderInverse': True, 'saveFig': True, 'figSize': (9,3)} # Plot a raster -simConfig.analysis['iplotLFP'] = {'includeAxon': False, 'figSize': (6,10), 'saveFig': True} -simConfig.analysis['iplotRxDConcentration'] = {'speciesLabel': 'ca', 'regionLabel': 'ecs'} - - - -# ------------------------------------------------------------ -# Run sim -# ------------------------------------------------------------ -if __name__ == '__main__': - netpyne_geppetto.netParams=netParams - netpyne_geppetto.simConfig=simConfig - -#from netpyne import sim -#sim.createSimulateAnalyze(netParams, simConfig) \ No newline at end of file diff --git a/gui_tut3_ip3high/cells/CSTR6.py b/gui_tut3_ip3high/cells/CSTR6.py new file mode 100644 index 0000000..24ed8a4 --- /dev/null +++ b/gui_tut3_ip3high/cells/CSTR6.py @@ -0,0 +1,342 @@ +# simplified corticostriatal cell model (6 compartment) +from neuron import h + +h.load_file('stdrun.hoc') + +Vrest = -90.7942106535 +h.v_init = -75.8801688855 +h.celsius = 34.0 # for in vitro opt + +# these are to be used by h_kole.mod +h_aslope = 7.12195833953 +h_ascale = 0.00276508832116 +h_bslope = 28.5415800392 +h_bscale = 0.154401580683 +h_ashift = 118.919921764 + +# geom properties +somaL = 25.0612875049 * 0.5 +somaDiam = 27.1149930518 * 0.5 +axonL = 598.648623864 * 0.2 +axonDiam = 0.552948640016 +apicL = 294.615634554 * 0.2 +apicDiam = 2.86090460606 +bdendL = 265.920165144 * 0.5 +bdendDiam = 1.02617341611 + +# passive properties +axonCap = 1.98999103645 +somaCap = 1.98838095104 +apicCap = 1.9931856141 +bdendCap = 1.98526067401 +rall = 88.8088669637 +axonRM = 2426.70520092 +somaRM = 11399.5571402 +apicRM = 12053.0391655 +bdendRM = 23023.3272552 + +# Na, K reversal potentials calculated from BenS internal/external solutions via Nernst eq. +p_ek = -104.0 # these reversal potentials for in vitro conditions +p_ena = 42.0 +# h-current +h.erev_h = h.erev_ih = -37.0 # global +gbar_h = 9.99986721729e-06 + +# spiking currents +gbar_nax = 0.0345117294903 +nax_gbar_axonm = 5.0 +gbar_kdr = 0.0131103978049 +kdr_gbar_axonm = 5.0 +# A few kinetic params changed vis-a-vis kdr.mod defaults: +kdr_vhalfn = 11.6427471384 +gbar_kap = 0.0898600246397 +kap_gbar_axonm = 5.0 +# A few kinetic params changed vis-a-vis kap.mod defaults: +kap_vhalfn = 32.7885075379 +kap_tq = -52.0967985869 +kap_vhalfl = -59.7867409796 # + +# other ion channel parameters +cal_gcalbar = 4.41583533572e-06 +can_gcanbar = 4.60717910591e-06 +cat_gcatbar = 1.00149259311e-06 * 0 +calginc = 1.0 +kBK_gpeak = 5.09733585163e-05 * 3e2 +kBK_caVhminShift = 43.8900261407 +# cadad_depth = 0.119408607923 +# cadad_taur = 99.1146852282 + +gbar_nap = 0.00301840094235 +gbar_ican = 0.000106856758751 + +############################################################################### +# CSTR6 Cell +############################################################################### +class CSTR6 (): + "Simplified Corticostriatal Cell Model" + def __init__(self,x=0,y=0,z=0,ID=0,params=None): + self.x,self.y,self.z=x,y,z + self.ID=ID + self.all_sec = [] + self.add_comp('soma') + self.set_morphology() + self.insert_conductances() + if params: self.set_params(params) + self.set_props() + + def add_comp(self, name): + self.__dict__[name] = h.Section(name=name)#,cell=self) + self.all_sec.append(self.__dict__[name]) + + def set_morphology(self): + self.add_comp('axon') + self.add_comp('Bdend') + self.add_comp('Adend1') + self.add_comp('Adend2') + self.add_comp('Adend3') + self.apic = [self.Adend1, self.Adend2, self.Adend3] + self.basal = [self.Bdend] + self.alldend = [self.Adend1, self.Adend2, self.Adend3, self.Bdend] + self.set_geom() + self.axon.connect(self.soma, 0.0, 0.0) + self.Bdend.connect(self.soma, 0.5, 0.0) # soma 0.5 to Bdend 0 + self.Adend1.connect(self.soma, 1.0, 0.0) + self.Adend2.connect(self.Adend1, 1.0, 0.0) + self.Adend3.connect(self.Adend2, 1.0, 0.0) + + def set_geom (self): + self.axon.L = axonL; self.axon.diam = axonDiam; + self.soma.L = somaL; self.soma.diam = somaDiam + for sec in self.apic: sec.L,sec.diam = apicL,apicDiam + self.Bdend.L = bdendL; self.Bdend.diam = bdendDiam + + def activeoff (self): + for sec in self.all_sec: sec.gbar_nax=sec.gbar_kdr=sec.gbar_kap=0.0 + + def set_axong (self): + axon = self.axon + axon.gbar_nax = gbar_nax * nax_gbar_axonm + axon.gbar_kdr = gbar_kdr * kdr_gbar_axonm + axon.gbar_kap = gbar_kap * kap_gbar_axonm + + def set_calprops (self,sec): + sec.gcalbar_cal = cal_gcalbar + sec.gcanbar_can = can_gcanbar + sec.gcatbar_cat = cat_gcatbar + sec.gpeak_kBK = kBK_gpeak + sec.caVhmin_kBK = -46.08 + kBK_caVhminShift + #sec.depth_cadad = cadad_depth + # sec.taur_cadad = cadad_taur + #sec.gbar_ican = gbar_ican + + def set_somag (self): + sec = self.soma + sec.gbar_ih = gbar_h # Ih + self.set_calprops(sec) + #sec.gbar_nap = gbar_nap + + def set_bdendg (self): + sec = self.Bdend + sec.gbar_ih = gbar_h # Ih + #sec.gbar_nap = gbar_nap + self.set_calprops(sec) + + def set_apicg (self): + for sec in self.apic: + self.set_calprops(sec) + sec.gbar_ih = gbar_h + #sec.gbar_nap = gbar_nap + self.apic[1].gcalbar_cal = cal_gcalbar * calginc # middle apical dend gets more iL + + def set_ihkinetics (self): + for sec in [self.soma,self.Bdend,self.Adend1,self.Adend2,self.Adend3]: + sec.ascale_ih = h_ascale + sec.bscale_ih = h_bscale + sec.ashift_ih = h_ashift + sec.aslope_ih = h_aslope + sec.bslope_ih = h_bslope + + # set properties + def set_props (self): + self.set_geom() + # cm - can differ across locations + self.axon.cm = axonCap + self.soma.cm = somaCap + self.Bdend.cm = bdendCap + for sec in self.apic: sec.cm = apicCap + # g_pas == 1.0/rm - can differ across locations + self.axon.g_pas = 1.0/axonRM + self.soma.g_pas = 1.0/somaRM + self.Bdend.g_pas = 1.0/bdendRM + for sec in self.apic: sec.g_pas = 1.0/apicRM + for sec in self.all_sec: + sec.ek = p_ek # K+ current reversal potential (mV) + sec.ena = p_ena # Na+ current reversal potential (mV) + sec.Ra = rall; sec.e_pas = Vrest # passive + sec.gbar_nax = gbar_nax # Na + sec.gbar_kdr = gbar_kdr # KDR + sec.vhalfn_kdr = kdr_vhalfn # KDR kinetics + sec.gbar_kap = gbar_kap # K-A + sec.vhalfn_kap = kap_vhalfn # K-A kinetics + sec.vhalfl_kap = kap_vhalfl + sec.tq_kap = kap_tq + self.set_somag() + self.set_bdendg() + self.set_apicg() + self.set_axong() + self.set_ihkinetics() + + def insert_conductances (self): + for sec in self.all_sec: + sec.insert('k_ion') + sec.insert('na_ion') + sec.insert('pas') # passive + sec.insert('nax') # Na current + sec.insert('kdr') # K delayed rectifier current + sec.insert('kap') # K-A current + for sec in [self.Adend3, self.Adend2, self.Adend1, self.Bdend, self.soma]: + sec.insert('ih') # h-current + sec.insert('ca_ion') # calcium channels + sec.insert('cal') # cal_mig.mod + sec.insert('can') # can_mig.mod + sec.insert('cat') # cat_mig.mod + # sec.insert('cadad') # cadad.mod - calcium decay + sec.insert('kBK') # kBK.mod - ca and v dependent k channel + #sec.insert('nap') # nap_sidi.mod + #sec.insert('ican') # ican_sidi.mod + + # set parameters tuned to specific cell + def set_params(self, params): + global h + global axonRM + global somaRM + global apicRM + global bdendRM + global rall + global Vrest + global gbar_h + global axonCap + global somaCap + global apicCap + global bdendCap + global somaL + global somaDiam + global apicL + global apicDiam + global bdendL + global bdendDiam + global axonL + global axonDiam + global h_ascale + global h_bscale + global h_ashift + global h_aslope + global h_bslope + global gbar_nap + global gbar_ican + global kap_vhalfn + global kBK_caVhminShift + global kBK_gpeak + global kap_vhalfl + global gbar_kap + global gbar_kdr + global cal_gcalbar + global kap_tq + global gbar_nax + global can_gcanbar + global cat_gcatbar + + if params == 'BS1578': + # properties from subthreshold fits + axonRM = 2822.01325416 + somaRM = 10590.6461169 + apicRM = 13889.6757076 + bdendRM = 7068.31281683 + rall = 70.0015514222 + Vrest = -87.1335623948 + h.v_init = -88.7986728464 + gbar_h = 3.3176340367e-05 + axonCap = 2.4630760526 + somaCap = 2.4998269977 + apicCap = 2.74242941886 + bdendCap = 2.74086279376 + somaL = 48.4123467666 + somaDiam = 28.2149102762 + apicL = 261.904636003 + apicDiam = 1.5831889597 + bdendL = 299.810775175 + bdendDiam = 2.2799248874 + axonL = 594.292937602 + axonDiam = 1.40966286462 + h_ascale = 0.00320887293027 + h_bscale = 0.285307415701 + h_ashift = 119.696272155 + h_aslope = 7.09800576233 + h_bslope = 23.2995848558 + gbar_nap = 0.0 + gbar_ican = 0.0 + kap_vhalfn = 32.179925527 + kBK_caVhminShift = 89.9991422912 + + # properties from evolution + kBK_gpeak = 4.45651933019e-05 + kap_vhalfl = -36.7754836348 + gbar_kap = 0.0240195239098 + gbar_kdr = 0.00833766634808 + cal_gcalbar = 2.39132864454e-06 + kap_tq = -49.7149526489 + gbar_nax = 0.0768253702194 + can_gcanbar = 8.13137955053e-07 + cat_gcatbar = 9.29455717585e-07 + + elif params == 'BS1579': + # properties from subthreshold fits + axonRM = 3120.59603524 + somaRM = 25551.9729631 + apicRM = 48333.5799025 + bdendRM = 11763.9607778 + rall = 114.969186163 + Vrest = -79.8821836579 + h.v_init = -92.8364820902 + gbar_h = 3.13760461868e-05 + axonCap = 1.87389705992 + somaCap = 1.89133252551 + apicCap = 2.49841939531 + bdendCap = 2.46671987855 + somaL = 48.4123467666 + somaDiam = 28.2149102762 + apicL = 261.904636003 + apicDiam = 1.5831889597 + bdendL = 299.810775175 + bdendDiam = 2.2799248874 + axonL = 594.292937602 + axonDiam = 1.40966286462 + h_ascale = 0.00365676240119 + h_bscale = 0.26993550346 + h_ashift = 115.040811905 + h_aslope = 7.63692206734 + h_bslope = 37.2740194128 + gbar_nap = 0.0 + gbar_ican = 0.0 + + # properties from evolution + kBK_gpeak = 4.2923494376e-05 + kap_vhalfl = -78.3762490029 + gbar_kap = 0.306752147542 + gbar_kdr = 0.00501206206504 + cal_gcalbar = 7.79902252875e-05 + kap_tq = -55.772342395 + gbar_nax = 0.146326621958 + can_gcanbar = 8.43780573752e-05 + cat_gcatbar = 5.85477866612e-05 + + +# +# def prmstr (p,s,fctr=2.0,shift=5.0): +# if p == 0.0: +# print s,'=',str(p-shift),str(p+shift),str(p),'True' +# elif p < 0.0: +# print s, '=',str(p*fctr),str(p/fctr),str(p),'True' +# else: +# print s, ' = ' , str(p/fctr), str(p*fctr), str(p), 'True' + diff --git a/gui_tut3_ip3high/cells/CSTR_cellParams.json b/gui_tut3_ip3high/cells/CSTR_cellParams.json new file mode 100644 index 0000000..8e353ab --- /dev/null +++ b/gui_tut3_ip3high/cells/CSTR_cellParams.json @@ -0,0 +1,554 @@ +{ + "secs": { + "soma": { + "ions": { + "na": { + "i": 10.0, + "e": 42.0, + "o": 140.0 + }, + "ca": { + "i": 0.00005, + "e": 132.4579341637009, + "o": 2.0 + }, + "k": { + "i": 54.4, + "e": -104.0, + "o": 2.5 + } + }, + "mechs": { + "kBK": { + "tau": 1.0, + "caPmax": 1.0, + "caPmin": 0.0, + "caVhh": 0.002, + "caVhmin": -2.1899738592999967, + "gpeak": 0.01529200755489, + "caPh": 0.002, + "caPk": 1.0, + "k": 17.0, + "caVhmax": 155.67 + }, + "pas": { + "e": -90.7942106535, + "g": 0.00008772270604035548 + }, + "cat": { + "gcatbar": 0.0 + }, + "ih": { + "aslope": 7.12195833953, + "gbar": 0.00000999986721729, + "ascale": 0.00276508832116, + "bslope": 28.5415800392, + "bscale": 0.154401580683, + "ashift": 118.919921764 + }, + "kap": { + "vhalfn": 32.7885075379, + "gbar": 0.0898600246397, + "sh": 0.0, + "vhalfl": -59.7867409796, + "tq": -52.0967985869 + }, + "can": { + "gcanbar": 0.00000460717910591 + }, + "cal": { + "gcalbar": 0.00000441583533572 + }, + "nax": { + "gbar": 0.0345117294903, + "sh": 0.0 + }, + "kdr": { + "gbar": 0.0131103978049, + "sh": 0.0, + "vhalfn": 11.6427471384 + } + }, + "geom": { + "diam": 13.5574965259, + "cm": 1.98838095104, + "nseg": 1, + "L": 12.53064375245, + "Ra": 88.8088669637, + "pt3d": [ + [ + 0, + 0, + 0, + 13.5574965259 + ], + [ + 0, + 12.53064375245, + 0, + 13.5574965259 + ] + ] + }, + "topol": {}, + "vinit": -75.8801688855 + }, + "Adend1": { + "ions": { + "na": { + "i": 10.0, + "e": 42.0, + "o": 140.0 + }, + "ca": { + "i": 0.00005, + "e": 132.4579341637009, + "o": 2.0 + }, + "k": { + "i": 54.4, + "e": -104.0, + "o": 2.5 + } + }, + "mechs": { + "kBK": { + "tau": 1.0, + "caPmax": 1.0, + "caPmin": 0.0, + "caVhh": 0.002, + "caVhmin": -2.1899738592999967, + "gpeak": 0.01529200755489, + "caPh": 0.002, + "caPk": 1.0, + "k": 17.0, + "caVhmax": 155.67 + }, + "pas": { + "e": -90.7942106535, + "g": 0.00008296662661333986 + }, + "cat": { + "gcatbar": 0.0 + }, + "ih": { + "aslope": 7.12195833953, + "gbar": 0.00000999986721729, + "ascale": 0.00276508832116, + "bslope": 28.5415800392, + "bscale": 0.154401580683, + "ashift": 118.919921764 + }, + "kap": { + "vhalfn": 32.7885075379, + "gbar": 0.0898600246397, + "sh": 0.0, + "vhalfl": -59.7867409796, + "tq": -52.0967985869 + }, + "can": { + "gcanbar": 0.00000460717910591 + }, + "cal": { + "gcalbar": 0.00000441583533572 + }, + "nax": { + "gbar": 0.0345117294903, + "sh": 0.0 + }, + "kdr": { + "gbar": 0.0131103978049, + "sh": 0.0, + "vhalfn": 11.6427471384 + } + }, + "geom": { + "diam": 2.86090460606, + "cm": 1.9931856141, + "nseg": 1, + "L": 58.9231269108, + "Ra": 88.8088669637, + "pt3d": [ + [ + 0, + 12.53064375245, + 0, + 2.86090460606 + ], + [ + 0, + 71.45377066325, + 0, + 2.86090460606 + ] + ] + }, + "topol": { + "childX": 0.0, + "parentSec": "soma", + "parentX": 1.0 + }, + "vinit": -75.8801688855 + }, + "Adend2": { + "ions": { + "na": { + "i": 10.0, + "e": 42.0, + "o": 140.0 + }, + "ca": { + "i": 0.00005, + "e": 132.4579341637009, + "o": 2.0 + }, + "k": { + "i": 54.4, + "e": -104.0, + "o": 2.5 + } + }, + "mechs": { + "kBK": { + "tau": 1.0, + "caPmax": 1.0, + "caPmin": 0.0, + "caVhh": 0.002, + "caVhmin": -2.1899738592999967, + "gpeak": 0.01529200755489, + "caPh": 0.002, + "caPk": 1.0, + "k": 17.0, + "caVhmax": 155.67 + }, + "pas": { + "e": -90.7942106535, + "g": 0.00008296662661333986 + }, + "cat": { + "gcatbar": 0.0 + }, + "ih": { + "aslope": 7.12195833953, + "gbar": 0.00000999986721729, + "ascale": 0.00276508832116, + "bslope": 28.5415800392, + "bscale": 0.154401580683, + "ashift": 118.919921764 + }, + "kap": { + "vhalfn": 32.7885075379, + "gbar": 0.0898600246397, + "sh": 0.0, + "vhalfl": -59.7867409796, + "tq": -52.0967985869 + }, + "can": { + "gcanbar": 0.00000460717910591 + }, + "cal": { + "gcalbar": 0.00000441583533572 + }, + "nax": { + "gbar": 0.0345117294903, + "sh": 0.0 + }, + "kdr": { + "gbar": 0.0131103978049, + "sh": 0.0, + "vhalfn": 11.6427471384 + } + }, + "geom": { + "diam": 2.86090460606, + "cm": 1.9931856141, + "nseg": 1, + "L": 58.9231269108, + "Ra": 88.8088669637, + "pt3d": [ + [ + 0, + 71.45377066325, + 0, + 2.86090460606 + ], + [ + 0, + 130.37689757405, + 0, + 2.86090460606 + ] + ] + }, + "topol": { + "childX": 0.0, + "parentSec": "Adend1", + "parentX": 1.0 + }, + "vinit": -75.8801688855 + }, + "Adend3": { + "ions": { + "na": { + "i": 10.0, + "e": 42.0, + "o": 140.0 + }, + "ca": { + "i": 0.00005, + "e": 132.4579341637009, + "o": 2.0 + }, + "k": { + "i": 54.4, + "e": -104.0, + "o": 2.5 + } + }, + "mechs": { + "kBK": { + "tau": 1.0, + "caPmax": 1.0, + "caPmin": 0.0, + "caVhh": 0.002, + "caVhmin": -2.1899738592999967, + "gpeak": 0.01529200755489, + "caPh": 0.002, + "caPk": 1.0, + "k": 17.0, + "caVhmax": 155.67 + }, + "pas": { + "e": -90.7942106535, + "g": 0.00008296662661333986 + }, + "cat": { + "gcatbar": 0.0 + }, + "ih": { + "aslope": 7.12195833953, + "gbar": 0.00000999986721729, + "ascale": 0.00276508832116, + "bslope": 28.5415800392, + "bscale": 0.154401580683, + "ashift": 118.919921764 + }, + "kap": { + "vhalfn": 32.7885075379, + "gbar": 0.0898600246397, + "sh": 0.0, + "vhalfl": -59.7867409796, + "tq": -52.0967985869 + }, + "can": { + "gcanbar": 0.00000460717910591 + }, + "cal": { + "gcalbar": 0.00000441583533572 + }, + "nax": { + "gbar": 0.0345117294903, + "sh": 0.0 + }, + "kdr": { + "gbar": 0.0131103978049, + "sh": 0.0, + "vhalfn": 11.6427471384 + } + }, + "geom": { + "diam": 2.86090460606, + "cm": 1.9931856141, + "nseg": 1, + "L": 58.9231269108, + "Ra": 88.8088669637, + "pt3d": [ + [ + 0, + 130.37689757405, + 0, + 2.86090460606 + ], + [ + 0, + 189.30002448484998, + 0, + 2.86090460606 + ] + ] + }, + "topol": { + "childX": 0.0, + "parentSec": "Adend2", + "parentX": 1.0 + }, + "vinit": -75.8801688855 + }, + "axon": { + "ions": { + "na": { + "i": 10.0, + "e": 42.0, + "o": 140.0 + }, + "k": { + "i": 54.4, + "e": -104.0, + "o": 2.5 + } + }, + "mechs": { + "nax": { + "gbar": 0.1725586474515, + "sh": 0.0 + }, + "kap": { + "vhalfn": 32.7885075379, + "gbar": 0.4493001231985, + "sh": 0.0, + "vhalfl": -59.7867409796, + "tq": -52.0967985869 + }, + "pas": { + "e": -90.7942106535, + "g": 0.0004120813684418219 + }, + "kdr": { + "gbar": 0.0655519890245, + "sh": 0.0, + "vhalfn": 11.6427471384 + } + }, + "geom": { + "diam": 0.552948640016, + "cm": 1.98999103645, + "nseg": 1, + "L": 119.72972477280001, + "Ra": 88.8088669637, + "pt3d": [ + [ + 0, + 0, + 0, + 0.552948640016 + ], + [ + 0, + -119.72972477280001, + 0, + 0.552948640016 + ] + ] + }, + "topol": { + "childX": 0.0, + "parentSec": "soma", + "parentX": 0.0 + }, + "vinit": -75.8801688855 + }, + "Bdend": { + "ions": { + "na": { + "i": 10.0, + "e": 42.0, + "o": 140.0 + }, + "ca": { + "i": 0.00005, + "e": 132.4579341637009, + "o": 2.0 + }, + "k": { + "i": 54.4, + "e": -104.0, + "o": 2.5 + } + }, + "mechs": { + "kBK": { + "tau": 1.0, + "caPmax": 1.0, + "caPmin": 0.0, + "caVhh": 0.002, + "caVhmin": -2.1899738592999967, + "gpeak": 0.01529200755489, + "caPh": 0.002, + "caPk": 1.0, + "k": 17.0, + "caVhmax": 155.67 + }, + "pas": { + "e": -90.7942106535, + "g": 0.00004343420865783602 + }, + "cat": { + "gcatbar": 0.0 + }, + "ih": { + "aslope": 7.12195833953, + "gbar": 0.00000999986721729, + "ascale": 0.00276508832116, + "bslope": 28.5415800392, + "bscale": 0.154401580683, + "ashift": 118.919921764 + }, + "kap": { + "vhalfn": 32.7885075379, + "gbar": 0.0898600246397, + "sh": 0.0, + "vhalfl": -59.7867409796, + "tq": -52.0967985869 + }, + "can": { + "gcanbar": 0.00000460717910591 + }, + "cal": { + "gcalbar": 0.00000441583533572 + }, + "nax": { + "gbar": 0.0345117294903, + "sh": 0.0 + }, + "kdr": { + "gbar": 0.0131103978049, + "sh": 0.0, + "vhalfn": 11.6427471384 + } + }, + "geom": { + "diam": 1.02617341611, + "cm": 1.98526067401, + "nseg": 1, + "L": 72.960082572, + "Ra": 88.8088669637, + "pt3d": [ + [ + 0, + 6.53064375245, + 0, + 1.02617341611 + ], + [ + 72.960082572, + 6.53064375245, + 0, + 1.02617341611 + ] + ] + }, + "topol": { + "childX": 0.0, + "parentSec": "soma", + "parentX": 0.5 + }, + "vinit": -75.8801688855 + } + }, + "globals": { + "celsius": 34.0, + "v_init": -75.8801688855, + "erev_ih": -37.0 + }, + "secLists": {} +} \ No newline at end of file diff --git a/gui_tut3_ip3high/cells/FScell.hoc b/gui_tut3_ip3high/cells/FScell.hoc new file mode 100755 index 0000000..e8c15fc --- /dev/null +++ b/gui_tut3_ip3high/cells/FScell.hoc @@ -0,0 +1,177 @@ +//Interneuron for PFC - fast spiking parvalbumin interneuron +//Based on Durstewitz and Gabriel 2006 +//"Irregular spiking in NMDA-driven prefrontal cortex neurons" + + +begintemplate FScell + +public soma, axon, dend + +create soma, axon, dend + + +proc init () { + +create soma, axon, dend + +soma_nafin=0.045 +soma_kdrin=0.018 +soma_Kslowin=0.000725*0.1 +soma_hin=0.00001 +soma_kapin=0.0032*15 +soma_canin=0.0003 +soma_kctin=0.0001 + +soma { + nseg=1 + L=10 //27 + diam=11 //29 + + insert pas + cm=1.2 //microF/cm2 + g_pas =1/10000 //mho/cm2 + e_pas = v_initin //(Kawaguchi k Kubota, 1993 --> -73+-3.9) + v_initin= -73 + Ra=150 + + insert Nafx + gnafbar_Nafx= soma_nafin + + insert kdrin + gkdrbar_kdrin= soma_kdrin + + insert IKsin + gKsbar_IKsin= soma_Kslowin + + insert hin + gbar_hin=soma_hin + + insert kapin + gkabar_kapin=soma_kapin + + insert canin + gcalbar_canin=soma_canin + + insert kctin + gkcbar_kctin=soma_kctin + + insert cadyn + + insert kBK + tau_kBK = 1.0 + caPmax_kBK = 1.0 + caPmin_kBK = 0.0 + caVhh_kBK = 0.002 + caVhmin_kBK = -2.1899738592999967 + gpeak_kBK = 0.01529200755489 + caPh_kBK = 0.002 + caPk_kBK = 1.0 + k_kBK = 17.0 + caVhmax_kBK = 155.67 +} + +axon { + nseg=1 + L=115*2 + diam=1.5 + + insert pas + cm=1.2 //microF/cm2 + g_pas =1/10000 //mho/cm2 + e_pas = v_initin + v_initin= -73 + Ra=150 + + insert Nafx + gnafbar_Nafx=soma_nafin*10 + + insert kdrin + gkdrbar_kdrin=soma_kdrin*0.5 +} + + +dend { + nseg=1 + L=2*22*2 + diam=7 + + + insert pas + cm=1.2 //microF/cm2 + g_pas =1/10000 //mho/cm2 + e_pas = v_initin//(Kawaguchi k Kubota, 1993 --> -73+-3.9) + v_initin= -73 + Ra=150 + + insert Nafx + gnafbar_Nafx=0.018*5 + + insert kdrin + gkdrbar_kdrin=0.018*0.5 + + insert kapin + gkabar_kapin=soma_kapin*10 + +} + + ko0_k_ion = 3.82 //mM + ki0_k_ion = 140 //mM + celsius = 23 + + connect dend(0), soma(1) + connect axon(0), soma(0) +} + +init() + +endtemplate FScell + + +//Creating new interneurons + +// objref FScell1 + +// FScell1 = new FScell() + +// //Create list with segments +// objref insoma_list, incell_list + +// insoma_list = new SectionList() +// FScell1.soma insoma_list.append() + +// incell_list = new SectionList() +// FScell1.soma incell_list.append() +// FScell1.axon incell_list.append() +// FScell1.dend incell_list.append() + +// proc current_balancein() { + +// finitialize($1) +// fcurrent() + +// printf("Balancing each compartment to %d mV\n", $1) + +// forsec incell_list{ +// for (x) { +// if (ismembrane("na_ion")) {e_pas(x)=v(x)+ina(x)/g_pas(x)} +// if (ismembrane("k_ion")) {e_pas(x)=e_pas(x)+ik(x)/g_pas(x)} + +// if (ismembrane("ca_ion")) {e_pas(x)=e_pas(x)+ica(x)/g_pas(x)} +// // if (ismembrane("Ca_ion")) {e_pas(x)=e_pas(x)+iCa(x)/g_pas(x)} +// // if (ismembrane("in_ion")) {e_pas(x)=e_pas(x)+in(x)/g_pas(x)} //ican +// if (ismembrane("h")) {e_pas(x)=e_pas(x)+ihi(x)/g_pas(x)} + +// // d = distance(1,x) +// // xdist = find_vector_distance_precise(secname(),x) // calc. perpedicular distance +// // printf("x = %e, xdist = %e, d = %e, e_pas = %e mV, rm = %e mA/(mVcm2)\n", x, xdist, d, e_pas(x), 1./g_pas(x)) +// // fcurrent() +// } +// } + +// //finitialize(v_init) +// fcurrent() +// } + + + +// current_balancein(-73) diff --git a/gui_tut3_ip3high/index.npjson b/gui_tut3_ip3high/index.npjson new file mode 100644 index 0000000..dfd3f66 --- /dev/null +++ b/gui_tut3_ip3high/index.npjson @@ -0,0 +1,5 @@ +{ + "mod_folder": "../mod", + "simConfig_python": "src/cfg.py", + "netParams_python": "src/netParams.py" +} \ No newline at end of file diff --git a/gui_tut3_ip3high/src/cfg.py b/gui_tut3_ip3high/src/cfg.py new file mode 100644 index 0000000..2bfeb9b --- /dev/null +++ b/gui_tut3_ip3high/src/cfg.py @@ -0,0 +1,31 @@ +from netpyne import specs +from src.netParams import netParams + +#------------------------------------------------------------------------------ +# +# SIMULATION CONFIGURATION +# +#------------------------------------------------------------------------------ + +# Run parameters +cfg = specs.SimConfig() # object of class simConfig to store simulation configuration +cfg.duration = 1.0*1e3 # Duration of the simulation, in ms +cfg.hParams['v_init'] = -65 # set v_init to -65 mV +cfg.dt = 0.1 # Internal integration timestep to use +cfg.verbose = False # Show detailed messages +cfg.recordStep = 1 # Step size in ms to save data (eg. V traces, LFP, etc) +cfg.filename = 'rxd_net' # Set file output name + + +# Recording/plotting parameters +cfg.recordTraces = {'V_soma':{'sec': 'soma','loc': 0.5,'var': 'v'}, + 'ik_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'ik'}, + 'cai_soma': {'sec': 'soma', 'loc':0.5, 'var': 'cai'}, + 'cao_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'cao'}} + +cfg.recordLFP = [[-15, y, 1.0*netParams.sizeZ] for y in range(int(netParams.sizeY/3), int(netParams.sizeY), int(netParams.sizeY/3))] + +cfg.analysis['iplotTraces'] = {'include': [0]} +cfg.analysis['iplotRaster'] = {'orderBy': 'y', 'orderInverse': True, 'saveFig': True, 'figSize': (9,3)} # Plot a raster +cfg.analysis['iplotLFP'] = {'includeAxon': False, 'figSize': (6,10), 'saveFig': True} +cfg.analysis['iplotRxDConcentration'] = {'speciesLabel': 'ca', 'regionLabel': 'ecs'} diff --git a/gui_tut3_ip3high.py b/gui_tut3_ip3high/src/netParams.py similarity index 78% rename from gui_tut3_ip3high.py rename to gui_tut3_ip3high/src/netParams.py index 4abb542..413e7d0 100644 --- a/gui_tut3_ip3high.py +++ b/gui_tut3_ip3high/src/netParams.py @@ -121,47 +121,3 @@ ### rates netParams.rxdParams['rates'] = {'ip3rg': {'species': h_gate, 'rate': '(1. / (1 + 1000. * ca[cyt] / (0.3)) - %s) / ip3rtau'%(h_gate)}} - - - - -#------------------------------------------------------------------------------ -# -# SIMULATION CONFIGURATION -# -#------------------------------------------------------------------------------ - -# Run parameters -simConfig = specs.SimConfig() # object of class simConfig to store simulation configuration -simConfig.duration = 1.0*1e3 # Duration of the simulation, in ms -simConfig.hParams['v_init'] = -65 # set v_init to -65 mV -simConfig.dt = 0.1 # Internal integration timestep to use -simConfig.verbose = False # Show detailed messages -simConfig.recordStep = 1 # Step size in ms to save data (eg. V traces, LFP, etc) -simConfig.filename = 'rxd_net' # Set file output name - - -# Recording/plotting parameters -simConfig.recordTraces = {'V_soma':{'sec': 'soma','loc': 0.5,'var': 'v'}, - 'ik_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'ik'}, - 'cai_soma': {'sec': 'soma', 'loc':0.5, 'var': 'cai'}, - 'cao_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'cao'}} - -simConfig.recordLFP = [[-15, y, 1.0*netParams.sizeZ] for y in range(int(netParams.sizeY/3), int(netParams.sizeY), int(netParams.sizeY/3))] - -simConfig.analysis['iplotTraces'] = {'include': [0]} -simConfig.analysis['iplotRaster'] = {'orderBy': 'y', 'orderInverse': True, 'saveFig': True, 'figSize': (9,3)} # Plot a raster -simConfig.analysis['iplotLFP'] = {'includeAxon': False, 'figSize': (6,10), 'saveFig': True} -simConfig.analysis['iplotRxDConcentration'] = {'speciesLabel': 'ca', 'regionLabel': 'ecs'} - - - -# ------------------------------------------------------------ -# Run sim -# ------------------------------------------------------------ -if __name__ == '__main__': - netpyne_geppetto.netParams=netParams - netpyne_geppetto.simConfig=simConfig - -#from netpyne import sim -#sim.createSimulateAnalyze(netParams, simConfig) \ No newline at end of file diff --git a/gui_tut3_norxd/cells/CSTR6.py b/gui_tut3_norxd/cells/CSTR6.py new file mode 100644 index 0000000..24ed8a4 --- /dev/null +++ b/gui_tut3_norxd/cells/CSTR6.py @@ -0,0 +1,342 @@ +# simplified corticostriatal cell model (6 compartment) +from neuron import h + +h.load_file('stdrun.hoc') + +Vrest = -90.7942106535 +h.v_init = -75.8801688855 +h.celsius = 34.0 # for in vitro opt + +# these are to be used by h_kole.mod +h_aslope = 7.12195833953 +h_ascale = 0.00276508832116 +h_bslope = 28.5415800392 +h_bscale = 0.154401580683 +h_ashift = 118.919921764 + +# geom properties +somaL = 25.0612875049 * 0.5 +somaDiam = 27.1149930518 * 0.5 +axonL = 598.648623864 * 0.2 +axonDiam = 0.552948640016 +apicL = 294.615634554 * 0.2 +apicDiam = 2.86090460606 +bdendL = 265.920165144 * 0.5 +bdendDiam = 1.02617341611 + +# passive properties +axonCap = 1.98999103645 +somaCap = 1.98838095104 +apicCap = 1.9931856141 +bdendCap = 1.98526067401 +rall = 88.8088669637 +axonRM = 2426.70520092 +somaRM = 11399.5571402 +apicRM = 12053.0391655 +bdendRM = 23023.3272552 + +# Na, K reversal potentials calculated from BenS internal/external solutions via Nernst eq. +p_ek = -104.0 # these reversal potentials for in vitro conditions +p_ena = 42.0 +# h-current +h.erev_h = h.erev_ih = -37.0 # global +gbar_h = 9.99986721729e-06 + +# spiking currents +gbar_nax = 0.0345117294903 +nax_gbar_axonm = 5.0 +gbar_kdr = 0.0131103978049 +kdr_gbar_axonm = 5.0 +# A few kinetic params changed vis-a-vis kdr.mod defaults: +kdr_vhalfn = 11.6427471384 +gbar_kap = 0.0898600246397 +kap_gbar_axonm = 5.0 +# A few kinetic params changed vis-a-vis kap.mod defaults: +kap_vhalfn = 32.7885075379 +kap_tq = -52.0967985869 +kap_vhalfl = -59.7867409796 # + +# other ion channel parameters +cal_gcalbar = 4.41583533572e-06 +can_gcanbar = 4.60717910591e-06 +cat_gcatbar = 1.00149259311e-06 * 0 +calginc = 1.0 +kBK_gpeak = 5.09733585163e-05 * 3e2 +kBK_caVhminShift = 43.8900261407 +# cadad_depth = 0.119408607923 +# cadad_taur = 99.1146852282 + +gbar_nap = 0.00301840094235 +gbar_ican = 0.000106856758751 + +############################################################################### +# CSTR6 Cell +############################################################################### +class CSTR6 (): + "Simplified Corticostriatal Cell Model" + def __init__(self,x=0,y=0,z=0,ID=0,params=None): + self.x,self.y,self.z=x,y,z + self.ID=ID + self.all_sec = [] + self.add_comp('soma') + self.set_morphology() + self.insert_conductances() + if params: self.set_params(params) + self.set_props() + + def add_comp(self, name): + self.__dict__[name] = h.Section(name=name)#,cell=self) + self.all_sec.append(self.__dict__[name]) + + def set_morphology(self): + self.add_comp('axon') + self.add_comp('Bdend') + self.add_comp('Adend1') + self.add_comp('Adend2') + self.add_comp('Adend3') + self.apic = [self.Adend1, self.Adend2, self.Adend3] + self.basal = [self.Bdend] + self.alldend = [self.Adend1, self.Adend2, self.Adend3, self.Bdend] + self.set_geom() + self.axon.connect(self.soma, 0.0, 0.0) + self.Bdend.connect(self.soma, 0.5, 0.0) # soma 0.5 to Bdend 0 + self.Adend1.connect(self.soma, 1.0, 0.0) + self.Adend2.connect(self.Adend1, 1.0, 0.0) + self.Adend3.connect(self.Adend2, 1.0, 0.0) + + def set_geom (self): + self.axon.L = axonL; self.axon.diam = axonDiam; + self.soma.L = somaL; self.soma.diam = somaDiam + for sec in self.apic: sec.L,sec.diam = apicL,apicDiam + self.Bdend.L = bdendL; self.Bdend.diam = bdendDiam + + def activeoff (self): + for sec in self.all_sec: sec.gbar_nax=sec.gbar_kdr=sec.gbar_kap=0.0 + + def set_axong (self): + axon = self.axon + axon.gbar_nax = gbar_nax * nax_gbar_axonm + axon.gbar_kdr = gbar_kdr * kdr_gbar_axonm + axon.gbar_kap = gbar_kap * kap_gbar_axonm + + def set_calprops (self,sec): + sec.gcalbar_cal = cal_gcalbar + sec.gcanbar_can = can_gcanbar + sec.gcatbar_cat = cat_gcatbar + sec.gpeak_kBK = kBK_gpeak + sec.caVhmin_kBK = -46.08 + kBK_caVhminShift + #sec.depth_cadad = cadad_depth + # sec.taur_cadad = cadad_taur + #sec.gbar_ican = gbar_ican + + def set_somag (self): + sec = self.soma + sec.gbar_ih = gbar_h # Ih + self.set_calprops(sec) + #sec.gbar_nap = gbar_nap + + def set_bdendg (self): + sec = self.Bdend + sec.gbar_ih = gbar_h # Ih + #sec.gbar_nap = gbar_nap + self.set_calprops(sec) + + def set_apicg (self): + for sec in self.apic: + self.set_calprops(sec) + sec.gbar_ih = gbar_h + #sec.gbar_nap = gbar_nap + self.apic[1].gcalbar_cal = cal_gcalbar * calginc # middle apical dend gets more iL + + def set_ihkinetics (self): + for sec in [self.soma,self.Bdend,self.Adend1,self.Adend2,self.Adend3]: + sec.ascale_ih = h_ascale + sec.bscale_ih = h_bscale + sec.ashift_ih = h_ashift + sec.aslope_ih = h_aslope + sec.bslope_ih = h_bslope + + # set properties + def set_props (self): + self.set_geom() + # cm - can differ across locations + self.axon.cm = axonCap + self.soma.cm = somaCap + self.Bdend.cm = bdendCap + for sec in self.apic: sec.cm = apicCap + # g_pas == 1.0/rm - can differ across locations + self.axon.g_pas = 1.0/axonRM + self.soma.g_pas = 1.0/somaRM + self.Bdend.g_pas = 1.0/bdendRM + for sec in self.apic: sec.g_pas = 1.0/apicRM + for sec in self.all_sec: + sec.ek = p_ek # K+ current reversal potential (mV) + sec.ena = p_ena # Na+ current reversal potential (mV) + sec.Ra = rall; sec.e_pas = Vrest # passive + sec.gbar_nax = gbar_nax # Na + sec.gbar_kdr = gbar_kdr # KDR + sec.vhalfn_kdr = kdr_vhalfn # KDR kinetics + sec.gbar_kap = gbar_kap # K-A + sec.vhalfn_kap = kap_vhalfn # K-A kinetics + sec.vhalfl_kap = kap_vhalfl + sec.tq_kap = kap_tq + self.set_somag() + self.set_bdendg() + self.set_apicg() + self.set_axong() + self.set_ihkinetics() + + def insert_conductances (self): + for sec in self.all_sec: + sec.insert('k_ion') + sec.insert('na_ion') + sec.insert('pas') # passive + sec.insert('nax') # Na current + sec.insert('kdr') # K delayed rectifier current + sec.insert('kap') # K-A current + for sec in [self.Adend3, self.Adend2, self.Adend1, self.Bdend, self.soma]: + sec.insert('ih') # h-current + sec.insert('ca_ion') # calcium channels + sec.insert('cal') # cal_mig.mod + sec.insert('can') # can_mig.mod + sec.insert('cat') # cat_mig.mod + # sec.insert('cadad') # cadad.mod - calcium decay + sec.insert('kBK') # kBK.mod - ca and v dependent k channel + #sec.insert('nap') # nap_sidi.mod + #sec.insert('ican') # ican_sidi.mod + + # set parameters tuned to specific cell + def set_params(self, params): + global h + global axonRM + global somaRM + global apicRM + global bdendRM + global rall + global Vrest + global gbar_h + global axonCap + global somaCap + global apicCap + global bdendCap + global somaL + global somaDiam + global apicL + global apicDiam + global bdendL + global bdendDiam + global axonL + global axonDiam + global h_ascale + global h_bscale + global h_ashift + global h_aslope + global h_bslope + global gbar_nap + global gbar_ican + global kap_vhalfn + global kBK_caVhminShift + global kBK_gpeak + global kap_vhalfl + global gbar_kap + global gbar_kdr + global cal_gcalbar + global kap_tq + global gbar_nax + global can_gcanbar + global cat_gcatbar + + if params == 'BS1578': + # properties from subthreshold fits + axonRM = 2822.01325416 + somaRM = 10590.6461169 + apicRM = 13889.6757076 + bdendRM = 7068.31281683 + rall = 70.0015514222 + Vrest = -87.1335623948 + h.v_init = -88.7986728464 + gbar_h = 3.3176340367e-05 + axonCap = 2.4630760526 + somaCap = 2.4998269977 + apicCap = 2.74242941886 + bdendCap = 2.74086279376 + somaL = 48.4123467666 + somaDiam = 28.2149102762 + apicL = 261.904636003 + apicDiam = 1.5831889597 + bdendL = 299.810775175 + bdendDiam = 2.2799248874 + axonL = 594.292937602 + axonDiam = 1.40966286462 + h_ascale = 0.00320887293027 + h_bscale = 0.285307415701 + h_ashift = 119.696272155 + h_aslope = 7.09800576233 + h_bslope = 23.2995848558 + gbar_nap = 0.0 + gbar_ican = 0.0 + kap_vhalfn = 32.179925527 + kBK_caVhminShift = 89.9991422912 + + # properties from evolution + kBK_gpeak = 4.45651933019e-05 + kap_vhalfl = -36.7754836348 + gbar_kap = 0.0240195239098 + gbar_kdr = 0.00833766634808 + cal_gcalbar = 2.39132864454e-06 + kap_tq = -49.7149526489 + gbar_nax = 0.0768253702194 + can_gcanbar = 8.13137955053e-07 + cat_gcatbar = 9.29455717585e-07 + + elif params == 'BS1579': + # properties from subthreshold fits + axonRM = 3120.59603524 + somaRM = 25551.9729631 + apicRM = 48333.5799025 + bdendRM = 11763.9607778 + rall = 114.969186163 + Vrest = -79.8821836579 + h.v_init = -92.8364820902 + gbar_h = 3.13760461868e-05 + axonCap = 1.87389705992 + somaCap = 1.89133252551 + apicCap = 2.49841939531 + bdendCap = 2.46671987855 + somaL = 48.4123467666 + somaDiam = 28.2149102762 + apicL = 261.904636003 + apicDiam = 1.5831889597 + bdendL = 299.810775175 + bdendDiam = 2.2799248874 + axonL = 594.292937602 + axonDiam = 1.40966286462 + h_ascale = 0.00365676240119 + h_bscale = 0.26993550346 + h_ashift = 115.040811905 + h_aslope = 7.63692206734 + h_bslope = 37.2740194128 + gbar_nap = 0.0 + gbar_ican = 0.0 + + # properties from evolution + kBK_gpeak = 4.2923494376e-05 + kap_vhalfl = -78.3762490029 + gbar_kap = 0.306752147542 + gbar_kdr = 0.00501206206504 + cal_gcalbar = 7.79902252875e-05 + kap_tq = -55.772342395 + gbar_nax = 0.146326621958 + can_gcanbar = 8.43780573752e-05 + cat_gcatbar = 5.85477866612e-05 + + +# +# def prmstr (p,s,fctr=2.0,shift=5.0): +# if p == 0.0: +# print s,'=',str(p-shift),str(p+shift),str(p),'True' +# elif p < 0.0: +# print s, '=',str(p*fctr),str(p/fctr),str(p),'True' +# else: +# print s, ' = ' , str(p/fctr), str(p*fctr), str(p), 'True' + diff --git a/gui_tut3_norxd/cells/CSTR_cellParams.json b/gui_tut3_norxd/cells/CSTR_cellParams.json new file mode 100644 index 0000000..8e353ab --- /dev/null +++ b/gui_tut3_norxd/cells/CSTR_cellParams.json @@ -0,0 +1,554 @@ +{ + "secs": { + "soma": { + "ions": { + "na": { + "i": 10.0, + "e": 42.0, + "o": 140.0 + }, + "ca": { + "i": 0.00005, + "e": 132.4579341637009, + "o": 2.0 + }, + "k": { + "i": 54.4, + "e": -104.0, + "o": 2.5 + } + }, + "mechs": { + "kBK": { + "tau": 1.0, + "caPmax": 1.0, + "caPmin": 0.0, + "caVhh": 0.002, + "caVhmin": -2.1899738592999967, + "gpeak": 0.01529200755489, + "caPh": 0.002, + "caPk": 1.0, + "k": 17.0, + "caVhmax": 155.67 + }, + "pas": { + "e": -90.7942106535, + "g": 0.00008772270604035548 + }, + "cat": { + "gcatbar": 0.0 + }, + "ih": { + "aslope": 7.12195833953, + "gbar": 0.00000999986721729, + "ascale": 0.00276508832116, + "bslope": 28.5415800392, + "bscale": 0.154401580683, + "ashift": 118.919921764 + }, + "kap": { + "vhalfn": 32.7885075379, + "gbar": 0.0898600246397, + "sh": 0.0, + "vhalfl": -59.7867409796, + "tq": -52.0967985869 + }, + "can": { + "gcanbar": 0.00000460717910591 + }, + "cal": { + "gcalbar": 0.00000441583533572 + }, + "nax": { + "gbar": 0.0345117294903, + "sh": 0.0 + }, + "kdr": { + "gbar": 0.0131103978049, + "sh": 0.0, + "vhalfn": 11.6427471384 + } + }, + "geom": { + "diam": 13.5574965259, + "cm": 1.98838095104, + "nseg": 1, + "L": 12.53064375245, + "Ra": 88.8088669637, + "pt3d": [ + [ + 0, + 0, + 0, + 13.5574965259 + ], + [ + 0, + 12.53064375245, + 0, + 13.5574965259 + ] + ] + }, + "topol": {}, + "vinit": -75.8801688855 + }, + "Adend1": { + "ions": { + "na": { + "i": 10.0, + "e": 42.0, + "o": 140.0 + }, + "ca": { + "i": 0.00005, + "e": 132.4579341637009, + "o": 2.0 + }, + "k": { + "i": 54.4, + "e": -104.0, + "o": 2.5 + } + }, + "mechs": { + "kBK": { + "tau": 1.0, + "caPmax": 1.0, + "caPmin": 0.0, + "caVhh": 0.002, + "caVhmin": -2.1899738592999967, + "gpeak": 0.01529200755489, + "caPh": 0.002, + "caPk": 1.0, + "k": 17.0, + "caVhmax": 155.67 + }, + "pas": { + "e": -90.7942106535, + "g": 0.00008296662661333986 + }, + "cat": { + "gcatbar": 0.0 + }, + "ih": { + "aslope": 7.12195833953, + "gbar": 0.00000999986721729, + "ascale": 0.00276508832116, + "bslope": 28.5415800392, + "bscale": 0.154401580683, + "ashift": 118.919921764 + }, + "kap": { + "vhalfn": 32.7885075379, + "gbar": 0.0898600246397, + "sh": 0.0, + "vhalfl": -59.7867409796, + "tq": -52.0967985869 + }, + "can": { + "gcanbar": 0.00000460717910591 + }, + "cal": { + "gcalbar": 0.00000441583533572 + }, + "nax": { + "gbar": 0.0345117294903, + "sh": 0.0 + }, + "kdr": { + "gbar": 0.0131103978049, + "sh": 0.0, + "vhalfn": 11.6427471384 + } + }, + "geom": { + "diam": 2.86090460606, + "cm": 1.9931856141, + "nseg": 1, + "L": 58.9231269108, + "Ra": 88.8088669637, + "pt3d": [ + [ + 0, + 12.53064375245, + 0, + 2.86090460606 + ], + [ + 0, + 71.45377066325, + 0, + 2.86090460606 + ] + ] + }, + "topol": { + "childX": 0.0, + "parentSec": "soma", + "parentX": 1.0 + }, + "vinit": -75.8801688855 + }, + "Adend2": { + "ions": { + "na": { + "i": 10.0, + "e": 42.0, + "o": 140.0 + }, + "ca": { + "i": 0.00005, + "e": 132.4579341637009, + "o": 2.0 + }, + "k": { + "i": 54.4, + "e": -104.0, + "o": 2.5 + } + }, + "mechs": { + "kBK": { + "tau": 1.0, + "caPmax": 1.0, + "caPmin": 0.0, + "caVhh": 0.002, + "caVhmin": -2.1899738592999967, + "gpeak": 0.01529200755489, + "caPh": 0.002, + "caPk": 1.0, + "k": 17.0, + "caVhmax": 155.67 + }, + "pas": { + "e": -90.7942106535, + "g": 0.00008296662661333986 + }, + "cat": { + "gcatbar": 0.0 + }, + "ih": { + "aslope": 7.12195833953, + "gbar": 0.00000999986721729, + "ascale": 0.00276508832116, + "bslope": 28.5415800392, + "bscale": 0.154401580683, + "ashift": 118.919921764 + }, + "kap": { + "vhalfn": 32.7885075379, + "gbar": 0.0898600246397, + "sh": 0.0, + "vhalfl": -59.7867409796, + "tq": -52.0967985869 + }, + "can": { + "gcanbar": 0.00000460717910591 + }, + "cal": { + "gcalbar": 0.00000441583533572 + }, + "nax": { + "gbar": 0.0345117294903, + "sh": 0.0 + }, + "kdr": { + "gbar": 0.0131103978049, + "sh": 0.0, + "vhalfn": 11.6427471384 + } + }, + "geom": { + "diam": 2.86090460606, + "cm": 1.9931856141, + "nseg": 1, + "L": 58.9231269108, + "Ra": 88.8088669637, + "pt3d": [ + [ + 0, + 71.45377066325, + 0, + 2.86090460606 + ], + [ + 0, + 130.37689757405, + 0, + 2.86090460606 + ] + ] + }, + "topol": { + "childX": 0.0, + "parentSec": "Adend1", + "parentX": 1.0 + }, + "vinit": -75.8801688855 + }, + "Adend3": { + "ions": { + "na": { + "i": 10.0, + "e": 42.0, + "o": 140.0 + }, + "ca": { + "i": 0.00005, + "e": 132.4579341637009, + "o": 2.0 + }, + "k": { + "i": 54.4, + "e": -104.0, + "o": 2.5 + } + }, + "mechs": { + "kBK": { + "tau": 1.0, + "caPmax": 1.0, + "caPmin": 0.0, + "caVhh": 0.002, + "caVhmin": -2.1899738592999967, + "gpeak": 0.01529200755489, + "caPh": 0.002, + "caPk": 1.0, + "k": 17.0, + "caVhmax": 155.67 + }, + "pas": { + "e": -90.7942106535, + "g": 0.00008296662661333986 + }, + "cat": { + "gcatbar": 0.0 + }, + "ih": { + "aslope": 7.12195833953, + "gbar": 0.00000999986721729, + "ascale": 0.00276508832116, + "bslope": 28.5415800392, + "bscale": 0.154401580683, + "ashift": 118.919921764 + }, + "kap": { + "vhalfn": 32.7885075379, + "gbar": 0.0898600246397, + "sh": 0.0, + "vhalfl": -59.7867409796, + "tq": -52.0967985869 + }, + "can": { + "gcanbar": 0.00000460717910591 + }, + "cal": { + "gcalbar": 0.00000441583533572 + }, + "nax": { + "gbar": 0.0345117294903, + "sh": 0.0 + }, + "kdr": { + "gbar": 0.0131103978049, + "sh": 0.0, + "vhalfn": 11.6427471384 + } + }, + "geom": { + "diam": 2.86090460606, + "cm": 1.9931856141, + "nseg": 1, + "L": 58.9231269108, + "Ra": 88.8088669637, + "pt3d": [ + [ + 0, + 130.37689757405, + 0, + 2.86090460606 + ], + [ + 0, + 189.30002448484998, + 0, + 2.86090460606 + ] + ] + }, + "topol": { + "childX": 0.0, + "parentSec": "Adend2", + "parentX": 1.0 + }, + "vinit": -75.8801688855 + }, + "axon": { + "ions": { + "na": { + "i": 10.0, + "e": 42.0, + "o": 140.0 + }, + "k": { + "i": 54.4, + "e": -104.0, + "o": 2.5 + } + }, + "mechs": { + "nax": { + "gbar": 0.1725586474515, + "sh": 0.0 + }, + "kap": { + "vhalfn": 32.7885075379, + "gbar": 0.4493001231985, + "sh": 0.0, + "vhalfl": -59.7867409796, + "tq": -52.0967985869 + }, + "pas": { + "e": -90.7942106535, + "g": 0.0004120813684418219 + }, + "kdr": { + "gbar": 0.0655519890245, + "sh": 0.0, + "vhalfn": 11.6427471384 + } + }, + "geom": { + "diam": 0.552948640016, + "cm": 1.98999103645, + "nseg": 1, + "L": 119.72972477280001, + "Ra": 88.8088669637, + "pt3d": [ + [ + 0, + 0, + 0, + 0.552948640016 + ], + [ + 0, + -119.72972477280001, + 0, + 0.552948640016 + ] + ] + }, + "topol": { + "childX": 0.0, + "parentSec": "soma", + "parentX": 0.0 + }, + "vinit": -75.8801688855 + }, + "Bdend": { + "ions": { + "na": { + "i": 10.0, + "e": 42.0, + "o": 140.0 + }, + "ca": { + "i": 0.00005, + "e": 132.4579341637009, + "o": 2.0 + }, + "k": { + "i": 54.4, + "e": -104.0, + "o": 2.5 + } + }, + "mechs": { + "kBK": { + "tau": 1.0, + "caPmax": 1.0, + "caPmin": 0.0, + "caVhh": 0.002, + "caVhmin": -2.1899738592999967, + "gpeak": 0.01529200755489, + "caPh": 0.002, + "caPk": 1.0, + "k": 17.0, + "caVhmax": 155.67 + }, + "pas": { + "e": -90.7942106535, + "g": 0.00004343420865783602 + }, + "cat": { + "gcatbar": 0.0 + }, + "ih": { + "aslope": 7.12195833953, + "gbar": 0.00000999986721729, + "ascale": 0.00276508832116, + "bslope": 28.5415800392, + "bscale": 0.154401580683, + "ashift": 118.919921764 + }, + "kap": { + "vhalfn": 32.7885075379, + "gbar": 0.0898600246397, + "sh": 0.0, + "vhalfl": -59.7867409796, + "tq": -52.0967985869 + }, + "can": { + "gcanbar": 0.00000460717910591 + }, + "cal": { + "gcalbar": 0.00000441583533572 + }, + "nax": { + "gbar": 0.0345117294903, + "sh": 0.0 + }, + "kdr": { + "gbar": 0.0131103978049, + "sh": 0.0, + "vhalfn": 11.6427471384 + } + }, + "geom": { + "diam": 1.02617341611, + "cm": 1.98526067401, + "nseg": 1, + "L": 72.960082572, + "Ra": 88.8088669637, + "pt3d": [ + [ + 0, + 6.53064375245, + 0, + 1.02617341611 + ], + [ + 72.960082572, + 6.53064375245, + 0, + 1.02617341611 + ] + ] + }, + "topol": { + "childX": 0.0, + "parentSec": "soma", + "parentX": 0.5 + }, + "vinit": -75.8801688855 + } + }, + "globals": { + "celsius": 34.0, + "v_init": -75.8801688855, + "erev_ih": -37.0 + }, + "secLists": {} +} \ No newline at end of file diff --git a/gui_tut3_norxd/cells/FScell.hoc b/gui_tut3_norxd/cells/FScell.hoc new file mode 100755 index 0000000..e8c15fc --- /dev/null +++ b/gui_tut3_norxd/cells/FScell.hoc @@ -0,0 +1,177 @@ +//Interneuron for PFC - fast spiking parvalbumin interneuron +//Based on Durstewitz and Gabriel 2006 +//"Irregular spiking in NMDA-driven prefrontal cortex neurons" + + +begintemplate FScell + +public soma, axon, dend + +create soma, axon, dend + + +proc init () { + +create soma, axon, dend + +soma_nafin=0.045 +soma_kdrin=0.018 +soma_Kslowin=0.000725*0.1 +soma_hin=0.00001 +soma_kapin=0.0032*15 +soma_canin=0.0003 +soma_kctin=0.0001 + +soma { + nseg=1 + L=10 //27 + diam=11 //29 + + insert pas + cm=1.2 //microF/cm2 + g_pas =1/10000 //mho/cm2 + e_pas = v_initin //(Kawaguchi k Kubota, 1993 --> -73+-3.9) + v_initin= -73 + Ra=150 + + insert Nafx + gnafbar_Nafx= soma_nafin + + insert kdrin + gkdrbar_kdrin= soma_kdrin + + insert IKsin + gKsbar_IKsin= soma_Kslowin + + insert hin + gbar_hin=soma_hin + + insert kapin + gkabar_kapin=soma_kapin + + insert canin + gcalbar_canin=soma_canin + + insert kctin + gkcbar_kctin=soma_kctin + + insert cadyn + + insert kBK + tau_kBK = 1.0 + caPmax_kBK = 1.0 + caPmin_kBK = 0.0 + caVhh_kBK = 0.002 + caVhmin_kBK = -2.1899738592999967 + gpeak_kBK = 0.01529200755489 + caPh_kBK = 0.002 + caPk_kBK = 1.0 + k_kBK = 17.0 + caVhmax_kBK = 155.67 +} + +axon { + nseg=1 + L=115*2 + diam=1.5 + + insert pas + cm=1.2 //microF/cm2 + g_pas =1/10000 //mho/cm2 + e_pas = v_initin + v_initin= -73 + Ra=150 + + insert Nafx + gnafbar_Nafx=soma_nafin*10 + + insert kdrin + gkdrbar_kdrin=soma_kdrin*0.5 +} + + +dend { + nseg=1 + L=2*22*2 + diam=7 + + + insert pas + cm=1.2 //microF/cm2 + g_pas =1/10000 //mho/cm2 + e_pas = v_initin//(Kawaguchi k Kubota, 1993 --> -73+-3.9) + v_initin= -73 + Ra=150 + + insert Nafx + gnafbar_Nafx=0.018*5 + + insert kdrin + gkdrbar_kdrin=0.018*0.5 + + insert kapin + gkabar_kapin=soma_kapin*10 + +} + + ko0_k_ion = 3.82 //mM + ki0_k_ion = 140 //mM + celsius = 23 + + connect dend(0), soma(1) + connect axon(0), soma(0) +} + +init() + +endtemplate FScell + + +//Creating new interneurons + +// objref FScell1 + +// FScell1 = new FScell() + +// //Create list with segments +// objref insoma_list, incell_list + +// insoma_list = new SectionList() +// FScell1.soma insoma_list.append() + +// incell_list = new SectionList() +// FScell1.soma incell_list.append() +// FScell1.axon incell_list.append() +// FScell1.dend incell_list.append() + +// proc current_balancein() { + +// finitialize($1) +// fcurrent() + +// printf("Balancing each compartment to %d mV\n", $1) + +// forsec incell_list{ +// for (x) { +// if (ismembrane("na_ion")) {e_pas(x)=v(x)+ina(x)/g_pas(x)} +// if (ismembrane("k_ion")) {e_pas(x)=e_pas(x)+ik(x)/g_pas(x)} + +// if (ismembrane("ca_ion")) {e_pas(x)=e_pas(x)+ica(x)/g_pas(x)} +// // if (ismembrane("Ca_ion")) {e_pas(x)=e_pas(x)+iCa(x)/g_pas(x)} +// // if (ismembrane("in_ion")) {e_pas(x)=e_pas(x)+in(x)/g_pas(x)} //ican +// if (ismembrane("h")) {e_pas(x)=e_pas(x)+ihi(x)/g_pas(x)} + +// // d = distance(1,x) +// // xdist = find_vector_distance_precise(secname(),x) // calc. perpedicular distance +// // printf("x = %e, xdist = %e, d = %e, e_pas = %e mV, rm = %e mA/(mVcm2)\n", x, xdist, d, e_pas(x), 1./g_pas(x)) +// // fcurrent() +// } +// } + +// //finitialize(v_init) +// fcurrent() +// } + + + +// current_balancein(-73) diff --git a/gui_tut3_norxd/index.npjson b/gui_tut3_norxd/index.npjson new file mode 100644 index 0000000..dfd3f66 --- /dev/null +++ b/gui_tut3_norxd/index.npjson @@ -0,0 +1,5 @@ +{ + "mod_folder": "../mod", + "simConfig_python": "src/cfg.py", + "netParams_python": "src/netParams.py" +} \ No newline at end of file diff --git a/gui_tut3_norxd/src/cfg.py b/gui_tut3_norxd/src/cfg.py new file mode 100644 index 0000000..cd0157d --- /dev/null +++ b/gui_tut3_norxd/src/cfg.py @@ -0,0 +1,32 @@ +import imp +from netpyne import specs +from src.netParams import netParams + +#------------------------------------------------------------------------------ +# +# SIMULATION CONFIGURATION +# +#------------------------------------------------------------------------------ + +# Run parameters +cfg = specs.SimConfig() # object of class simConfig to store simulation configuration +cfg.duration = 1.0*1e3 # Duration of the simulation, in ms +cfg.hParams['v_init'] = -65 # set v_init to -65 mV +cfg.dt = 0.1 # Internal integration timestep to use +cfg.verbose = False # Show detailed messages +cfg.recordStep = 1 # Step size in ms to save data (eg. V traces, LFP, etc) +cfg.filename = 'rxd_net' # Set file output name + + +# Recording/plotting parameters +cfg.recordTraces = {'V_soma':{'sec': 'soma','loc': 0.5,'var': 'v'}, + 'ik_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'ik'}, + 'cai_soma': {'sec': 'soma', 'loc':0.5, 'var': 'cai'}, + 'cao_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'cao'}} + +cfg.recordLFP = [[-15, y, 1.0*netParams.sizeZ] for y in range(int(netParams.sizeY/3), int(netParams.sizeY), int(netParams.sizeY/3))] + +cfg.analysis['iplotTraces'] ={'include': [0]} +cfg.analysis['iplotRaster'] = {'orderBy': 'y', 'orderInverse': True, 'saveFig': True, 'figSize': (9,3)} # Plot a raster +cfg.analysis['iplotLFP'] = {'includeAxon': False, 'figSize': (6,10), 'saveFig': True} +cfg.analysis['iplotRxDConcentration'] = {'speciesLabel': 'ca', 'regionLabel': 'ecs'} diff --git a/gui_tut3_norxd.py b/gui_tut3_norxd/src/netParams.py similarity index 63% rename from gui_tut3_norxd.py rename to gui_tut3_norxd/src/netParams.py index 5f84511..e32c868 100644 --- a/gui_tut3_norxd.py +++ b/gui_tut3_norxd/src/netParams.py @@ -56,46 +56,4 @@ 'weight': 0.01, # synaptic weight 'delay': 'dist_3D/propVelocity', # transmission delay (ms) 'sec': ['soma','Bdend'], - 'synMech': 'inh'} # synaptic mechanism - - -#------------------------------------------------------------------------------ -# -# SIMULATION CONFIGURATION -# -#------------------------------------------------------------------------------ - -# Run parameters -simConfig = specs.SimConfig() # object of class simConfig to store simulation configuration -simConfig.duration = 1.0*1e3 # Duration of the simulation, in ms -simConfig.hParams['v_init'] = -65 # set v_init to -65 mV -simConfig.dt = 0.1 # Internal integration timestep to use -simConfig.verbose = False # Show detailed messages -simConfig.recordStep = 1 # Step size in ms to save data (eg. V traces, LFP, etc) -simConfig.filename = 'rxd_net' # Set file output name - - -# Recording/plotting parameters -simConfig.recordTraces = {'V_soma':{'sec': 'soma','loc': 0.5,'var': 'v'}, - 'ik_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'ik'}, - 'cai_soma': {'sec': 'soma', 'loc':0.5, 'var': 'cai'}, - 'cao_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'cao'}} - -simConfig.recordLFP = [[-15, y, 1.0*netParams.sizeZ] for y in range(int(netParams.sizeY/3), int(netParams.sizeY), int(netParams.sizeY/3))] - -simConfig.analysis['iplotTraces'] ={'include': [0]} -simConfig.analysis['iplotRaster'] = {'orderBy': 'y', 'orderInverse': True, 'saveFig': True, 'figSize': (9,3)} # Plot a raster -simConfig.analysis['iplotLFP'] = {'includeAxon': False, 'figSize': (6,10), 'saveFig': True} -simConfig.analysis['iplotRxDConcentration'] = {'speciesLabel': 'ca', 'regionLabel': 'ecs'} - - - -# ------------------------------------------------------------ -# Run sim -# ------------------------------------------------------------ -if __name__ == '__main__': - netpyne_geppetto.netParams=netParams - netpyne_geppetto.simConfig=simConfig - -#from netpyne import sim -#sim.createSimulateAnalyze(netParams, simConfig) \ No newline at end of file + 'synMech': 'inh'} # synaptic mechanism diff --git a/gui_tut_osc/index.npjson b/gui_tut_osc/index.npjson new file mode 100644 index 0000000..2bd23f1 --- /dev/null +++ b/gui_tut_osc/index.npjson @@ -0,0 +1,4 @@ +{ + "simConfig_python": "src/cfg.py", + "netParams_python": "src/netParams.py" +} \ No newline at end of file diff --git a/gui_tut_osc/src/cfg.py b/gui_tut_osc/src/cfg.py new file mode 100644 index 0000000..fea3526 --- /dev/null +++ b/gui_tut_osc/src/cfg.py @@ -0,0 +1,17 @@ +from netpyne import specs + +# Simulation options +cfg = specs.SimConfig() # object of class SimConfig to store simulation configuration + +cfg.duration = 1*1e3 # Duration of the simulation, in ms +cfg.dt = 0.025 # Internal integration timestep to use +cfg.verbose = False # Show detailed messages +cfg.recordTraces = {'V_soma': {'sec':'soma','loc':0.5, 'var':'v'}} # Dict with traces to record +cfg.recordStep = 0.1 # Step size in ms to save data (e.g. V traces, LFP, etc) +cfg.filename = 'model_output' # Set file output name +cfg.savePickle = False # Save params, network and sim output to pickle file + +cfg.analysis['plotTraces'] = {'include': [1]} # Plot recorded traces for this list of cells +cfg.analysis['plotRaster'] = {'orderInverse': True, 'syncLines': True} # Plot a raster +cfg.analysis['plotSpikeHist'] = {'include': ['E', 'I']} # Plot spike histogram +cfg.analysis['plotRateSpectrogram'] = {'include': ['allCells']} # Plot binned spiking rate spectrogram diff --git a/gui_tut_osc.py b/gui_tut_osc/src/netParams.py similarity index 66% rename from gui_tut_osc.py rename to gui_tut_osc/src/netParams.py index 9e91bc7..684aa54 100644 --- a/gui_tut_osc.py +++ b/gui_tut_osc/src/netParams.py @@ -47,25 +47,7 @@ 'delay': 5, # transmission delay (ms) 'synMech': 'inh'} # synaptic mechanism - -# Simulation options -simConfig = specs.SimConfig() # object of class SimConfig to store simulation configuration - -simConfig.duration = 1*1e3 # Duration of the simulation, in ms -simConfig.dt = 0.025 # Internal integration timestep to use -simConfig.verbose = False # Show detailed messages -simConfig.recordTraces = {'V_soma': {'sec':'soma','loc':0.5, 'var':'v'}} # Dict with traces to record -simConfig.recordStep = 0.1 # Step size in ms to save data (e.g. V traces, LFP, etc) -simConfig.filename = 'model_output' # Set file output name -simConfig.savePickle = False # Save params, network and sim output to pickle file - -simConfig.analysis['plotTraces'] = {'include': [1]} # Plot recorded traces for this list of cells -simConfig.analysis['plotRaster'] = {'orderInverse': True, 'syncLines': True} # Plot a raster -simConfig.analysis['plotSpikeHist'] = {'include': ['E', 'I']} # Plot spike histogram -simConfig.analysis['plotRateSpectrogram'] = {'include': ['allCells']} # Plot binned spiking rate spectrogram - - # Play around with model and see how parameters affect oscillations, e.g.: # - set I->E connection probability to 0.0 (set back to 0.7 afterwards) # - increase I->E connection delay to 20 ms (set back to 5 ms afterwards) -# - increase 'inh' synapse tau2 time constatn to 20 ms (set back to 5 ms afterwards) \ No newline at end of file +# - increase 'inh' synapse tau2 time constatn to 20 ms (set back to 5 ms afterwards) diff --git a/hnn/index.npjson b/hnn/index.npjson new file mode 100644 index 0000000..0d20c07 --- /dev/null +++ b/hnn/index.npjson @@ -0,0 +1,8 @@ +{ + "mod_folder": "../mod", + "simConfig_python": "src/cfg.py", + "netParams_python": "src/netParams.py", + "netParams_json": "params/hnn.json", + "simConfig_json": "params/hnn.json", + "simConfig_variable": "simConfig" +} \ No newline at end of file diff --git a/hnn.json b/hnn/params/hnn.json similarity index 100% rename from hnn.json rename to hnn/params/hnn.json diff --git a/hnn/src/cfg.py b/hnn/src/cfg.py new file mode 100644 index 0000000..4cde4d7 --- /dev/null +++ b/hnn/src/cfg.py @@ -0,0 +1,429 @@ +""" +cfg.py + +Simulationg configuration for NetPyNE-based HNN network model + +Contributors: salvadordura@gmail.com +""" + +from netpyne import specs + +cfg = specs.SimConfig() + +cfg.checkErrors = False # True # leave as False to avoid extra printouts + + +# ############################################################################ +# +# SIMULATION CONFIGURATION +# +# ############################################################################ + +# ---------------------------------------------------------------------------- +# +# NetPyNE config parameters (not part of original HNN implementation) +# +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Run parameters +# ---------------------------------------------------------------------------- +cfg.duration = 170 +cfg.dt = 0.025 +cfg.seeds = {'conn': 4321, 'stim': 1234, 'loc': 4321} +cfg.hParams['v_init'] = -65 +cfg.verbose = 0 +cfg.cvode_active = False +cfg.printRunTime = 0.1 +cfg.printPopAvgRates = True +cfg.distributeSynsUniformly = False # one syn per section in list of sections +cfg.allowSelfConns = False # allow connections from a cell to itself +cfg.allowConnsWithWeight0 = False # do not allow conns with weight 0 (faster) +cfg.oneSynPerNetcon = False # allow using the same synapse for multiple netcons + + +# ---------------------------------------------------------------------------- +# Recording +# ---------------------------------------------------------------------------- +cfg.recordTraces = {'V_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'v'}} +cfg.recordCells = [('L2Basket',0), ('L2Pyr',0), ('L5Basket',0), ('L5Pyr',0)] +cfg.recordStims = False +cfg.recordStep = 0.025 +cfg.recordDipoles = {'L2': ['L2Pyr'], 'L5': ['L5Pyr']} + +# cfg.recordLFP = [[50, 50, 50], [50, 1300, 50]] + +# ---------------------------------------------------------------------------- +# Saving +# ---------------------------------------------------------------------------- +cfg.sim_prefix = cfg.simLabel = 'default' + +cfg.saveFolder = '.' +cfg.savePickle = False +cfg.saveJson = False +cfg.saveDataInclude = ['simData', 'simConfig'] #, 'netParams', 'net'] + +# ---------------------------------------------------------------------------- +# Analysis and plotting +# ---------------------------------------------------------------------------- +pops = ['L2Basket', 'L2Pyr', 'L5Basket', 'L5Pyr'] +evprox = ['evokedProximal_1_L2Basket', 'evokedProximal_1_L2Pyr', 'evokedProximal_1_L5Basket', 'evokedProximal_1_L5Pyr', + 'evokedProximal_2_L2Basket', 'evokedProximal_2_L2Pyr', 'evokedProximal_2_L5Basket', 'evokedProximal_2_L5Pyr'] +evdist = ['evokedDistal_1_L2Basket', 'evokedDistal_1_L2Pyr', 'evokedDistal_1_L5Basket', 'evokedDistal_1_L5Pyr'] + +popColors = {'L2Basket': [0.0, 0.0, 0.0], 'L2Pyr': [0.0, 0.6, 0.0], 'L5Basket': [0.0, 0.0, 1.0], 'L5Pyr': [1.0, 0.0, 0.0], + 'Evoked proximal': [0.0, 1.0, 1.0], 'Evoked distal': [1.0, 1.0, 0.0]} + +cfg.analysis['iplotTraces'] = {'include': [('L5Pyr',0) ], 'oneFigPer': 'cell', 'saveFig': False, + 'showFig': True, 'timeRange': [0, cfg.duration]} + +cfg.analysis['iplotRaster'] = {'include': pops, 'showFig': True, 'popColors': popColors, 'markerSize': 6, 'orderInverse': True} + +cfg.analysis['iplotSpikeHist'] = {'include': [*pops, evprox, evdist, 'extRhythmicProximal', 'extRhythmicDistal'], 'legendLabels': pops + ['Evoked proximal', 'Evoked distal', 'Rhythmic proximal', 'Rhythmic distal'], 'popColors': popColors, 'yaxis': 'count', 'showFig': True} + +cfg.analysis['iplotDipole'] = {'showFig': True} + +cfg.analysis['iplotDipolePSD'] = {'showFig': True, 'maxFreq': 80} # change freq to 40 for alpha&beta tut + +cfg.analysis['iplotDipoleSpectrogram'] = {'showFig': True, 'maxFreq': 80} # change freq to 40 for alpha&beta tut + +cfg.analysis['iplotConn'] = {'includePre': pops, 'includePost': pops, 'feature': 'strength'} + +# cfg.analysis['iplotLFP'] = {'showFig': True} + +#cfg.analysis['iplotRatePSD'] = {'include': pops, 'showFig': True} + + +# ---------------------------------------------------------------------------- +# Network parameters +# ---------------------------------------------------------------------------- +cfg.gridSpacingPyr = 1 # 50 +cfg.gridSpacingBasket = [1, 1, 3] +cfg.xzScaling = 1 #100 +cfg.sizeY = 2000 + +cfg.localConn = True +cfg.rhythmicInputs = True +cfg.evokedInputs = True +cfg.tonicInputs = True +cfg.poissonInputs = True +cfg.gaussInputs = True + + +# ---------------------------------------------------------------------------- +# +# HNN original config parameters (adapted to NetPyNE) +# +# ---------------------------------------------------------------------------- + +# Params from 'ERPYes100Trials.param'; copied from cfg.__dict__ +cfg.__dict__.update({ + 'duration': 170.0, + 'tstop': 170, + 'dt': 0.05, + 'hParams': {'celsius': 37, 'v_init': -65, 'clamp_resist': 0.001}, + 'cache_efficient': False, + 'cvode_active': False, + 'cvode_atol': 0.001, + 'seeds': {'conn': 4321, 'stim': 1234, 'loc': 4321}, + 'rand123GlobalIndex': None, + 'createNEURONObj': True, + 'createPyStruct': True, + 'addSynMechs': True, + 'includeParamsLabel': True, + 'gatherOnlySimData': False, + 'compactConnFormat': False, + 'connRandomSecFromList': True, + 'distributeSynsUniformly': False, + 'pt3dRelativeToCellLocation': True, + 'invertedYCoord': True, + 'allowSelfConns': False, + 'allowConnsWithWeight0': False, + 'oneSynPerNetcon': False, + 'saveCellSecs': True, + 'saveCellConns': True, + 'timing': True, + 'saveTiming': False, + 'printRunTime': 0.1, + 'printPopAvgRates': True, + 'printSynsAfterRule': False, + 'verbose': 0, + 'recordCells': [('L2Basket', 0), ('L2Pyr', 0), ('L5Basket', 0), ('L5Pyr', 0)], + 'recordTraces': {'V_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'v'}}, + 'recordCellsSpikes': -1, + 'recordStim': False, + 'recordLFP': [], + 'recordDipoles': {'L2': ['L2Pyr'], 'L5': ['L5Pyr']}, + 'saveLFPCells': False, + 'recordStep': 0.05, + 'recordTime': True, + 'simLabel': 'default', + 'saveFolder': '.', + 'filename': './default', + 'saveDataInclude': ['simData', 'simConfig'], + 'timestampFilename': False, + 'savePickle': False, + 'saveJson': False, + 'saveMat': False, + 'saveCSV': False, + 'saveDpk': False, + 'saveHDF5': False, + 'saveDat': False, + 'backupCfgFile': [], + 'checkErrors': False, + 'checkErrorsVerbose': False, + 'recordStims': False, + 'sim_prefix': 'ERPYes100Trials', + 'gridSpacingPyr': 1, + 'gridSpacingBasket': [1, 1, 3], + 'xzScaling': 1, + 'sizeY': 2000, + 'localConn': True, + 'rhythmicInputs': True, + 'evokedInputs': True, + 'tonicInputs': True, + 'poissonInputs': True, + 'gaussInputs': True, + 'EEgain': 1.0, + 'EIgain': 1.0, + 'IEgain': 1.0, + 'IIgain': 1.0, + 'celsius': 37.0, + 'threshold': 0.0, + 'L2Pyr_soma_L': 22.1, + 'L2Pyr_soma_diam': 23.4, + 'L2Pyr_soma_cm': 0.6195, + 'L2Pyr_soma_Ra': 200.0, + 'L2Pyr_dend_cm': 0.6195, + 'L2Pyr_dend_Ra': 200.0, + 'L2Pyr_apicaltrunk_L': 59.5, + 'L2Pyr_apicaltrunk_diam': 4.25, + 'L2Pyr_apical1_L': 306.0, + 'L2Pyr_apical1_diam': 4.08, + 'L2Pyr_apicaltuft_L': 238.0, + 'L2Pyr_apicaltuft_diam': 3.4, + 'L2Pyr_apicaloblique_L': 340.0, + 'L2Pyr_apicaloblique_diam': 3.91, + 'L2Pyr_basal1_L': 85.0, + 'L2Pyr_basal1_diam': 4.25, + 'L2Pyr_basal2_L': 255.0, + 'L2Pyr_basal2_diam': 2.72, + 'L2Pyr_basal3_L': 255.0, + 'L2Pyr_basal3_diam': 2.72, + 'L2Pyr_ampa_e': 0.0, + 'L2Pyr_ampa_tau1': 0.5, + 'L2Pyr_ampa_tau2': 5.0, + 'L2Pyr_nmda_e': 0.0, + 'L2Pyr_nmda_tau1': 1.0, + 'L2Pyr_nmda_tau2': 20.0, + 'L2Pyr_gabaa_e': -80.0, + 'L2Pyr_gabaa_tau1': 0.5, + 'L2Pyr_gabaa_tau2': 5.0, + 'L2Pyr_gabab_e': -80.0, + 'L2Pyr_gabab_tau1': 1.0, + 'L2Pyr_gabab_tau2': 20.0, + 'L2Pyr_soma_gkbar_hh2': 0.01, + 'L2Pyr_soma_gnabar_hh2': 0.18, + 'L2Pyr_soma_el_hh2': -65.0, + 'L2Pyr_soma_gl_hh2': 4.26e-05, + 'L2Pyr_soma_gbar_km': 250.0, + 'L2Pyr_dend_gkbar_hh2': 0.01, + 'L2Pyr_dend_gnabar_hh2': 0.15, + 'L2Pyr_dend_el_hh2': -65.0, + 'L2Pyr_dend_gl_hh2': 4.26e-05, + 'L2Pyr_dend_gbar_km': 250.0, + 'L5Pyr_soma_L': 39.0, + 'L5Pyr_soma_diam': 28.9, + 'L5Pyr_soma_cm': 0.85, + 'L5Pyr_soma_Ra': 200.0, + 'L5Pyr_dend_cm': 0.85, + 'L5Pyr_dend_Ra': 200.0, + 'L5Pyr_apicaltrunk_L': 102.0, + 'L5Pyr_apicaltrunk_diam': 10.2, + 'L5Pyr_apical1_L': 680.0, + 'L5Pyr_apical1_diam': 7.48, + 'L5Pyr_apical2_L': 680.0, + 'L5Pyr_apical2_diam': 4.93, + 'L5Pyr_apicaltuft_L': 425.0, + 'L5Pyr_apicaltuft_diam': 3.4, + 'L5Pyr_apicaloblique_L': 255.0, + 'L5Pyr_apicaloblique_diam': 5.1, + 'L5Pyr_basal1_L': 85.0, + 'L5Pyr_basal1_diam': 6.8, + 'L5Pyr_basal2_L': 255.0, + 'L5Pyr_basal2_diam': 8.5, + 'L5Pyr_basal3_L': 255.0, + 'L5Pyr_basal3_diam': 8.5, + 'L5Pyr_ampa_e': 0.0, + 'L5Pyr_ampa_tau1': 0.5, + 'L5Pyr_ampa_tau2': 5.0, + 'L5Pyr_nmda_e': 0.0, + 'L5Pyr_nmda_tau1': 1.0, + 'L5Pyr_nmda_tau2': 20.0, + 'L5Pyr_gabaa_e': -80.0, + 'L5Pyr_gabaa_tau1': 0.5, + 'L5Pyr_gabaa_tau2': 5.0, + 'L5Pyr_gabab_e': -80.0, + 'L5Pyr_gabab_tau1': 1.0, + 'L5Pyr_gabab_tau2': 20.0, + 'L5Pyr_soma_gkbar_hh2': 0.01, + 'L5Pyr_soma_gnabar_hh2': 0.16, + 'L5Pyr_soma_el_hh2': -65.0, + 'L5Pyr_soma_gl_hh2': 4.26e-05, + 'L5Pyr_soma_gbar_ca': 60.0, + 'L5Pyr_soma_taur_cad': 20.0, + 'L5Pyr_soma_gbar_kca': 0.0002, + 'L5Pyr_soma_gbar_km': 200.0, + 'L5Pyr_soma_gbar_cat': 0.0002, + 'L5Pyr_soma_gbar_ar': 1e-06, + 'L5Pyr_dend_gkbar_hh2': 0.01, + 'L5Pyr_dend_gnabar_hh2': 0.14, + 'L5Pyr_dend_el_hh2': -71.0, + 'L5Pyr_dend_gl_hh2': 4.26e-05, + 'L5Pyr_dend_gbar_ca': 60.0, + 'L5Pyr_dend_taur_cad': 20.0, + 'L5Pyr_dend_gbar_kca': 0.0002, + 'L5Pyr_dend_gbar_km': 200.0, + 'L5Pyr_dend_gbar_cat': 0.0002, + 'L5Pyr_dend_gbar_ar': 1e-06, + 'N_pyr_x': 10, + 'N_pyr_y': 10, + 'gbar_L2Pyr_L2Pyr_ampa': 0.0005, + 'gbar_L2Pyr_L2Pyr_nmda': 0.0005, + 'gbar_L2Basket_L2Pyr_gabaa': 0.05, + 'gbar_L2Basket_L2Pyr_gabab': 0.05, + 'gbar_L2Pyr_L2Basket': 0.0005, + 'gbar_L2Basket_L2Basket': 0.02, + 'gbar_L5Pyr_L5Pyr_ampa': 0.0005, + 'gbar_L5Pyr_L5Pyr_nmda': 0.0005, + 'gbar_L2Pyr_L5Pyr': 0.00025, + 'gbar_L2Basket_L5Pyr': 0.001, + 'gbar_L5Basket_L5Pyr_gabaa': 0.025, + 'gbar_L5Basket_L5Pyr_gabab': 0.025, + 'gbar_L5Basket_L5Basket': 0.02, + 'gbar_L5Pyr_L5Basket': 0.0005, + 'gbar_L2Pyr_L5Basket': 0.00025, + 'L2Basket_Gauss_A_weight': 0.0, + 'L2Basket_Gauss_mu': 2000.0, + 'L2Basket_Gauss_sigma': 3.6, + 'L2Basket_Pois_A_weight_ampa': 0.0, + 'L2Basket_Pois_A_weight_nmda': 0.0, + 'L2Basket_Pois_lamtha': 0.0, + 'L2Pyr_Gauss_A_weight': 0.0, + 'L2Pyr_Gauss_mu': 2000.0, + 'L2Pyr_Gauss_sigma': 3.6, + 'L2Pyr_Pois_A_weight_ampa': 0.0, + 'L2Pyr_Pois_A_weight_nmda': 0.0, + 'L2Pyr_Pois_lamtha': 0.0, + 'L5Pyr_Gauss_A_weight': 0.0, + 'L5Pyr_Gauss_mu': 2000.0, + 'L5Pyr_Gauss_sigma': 4.8, + 'L5Pyr_Pois_A_weight_ampa': 0.0, + 'L5Pyr_Pois_A_weight_nmda': 0.0, + 'L5Pyr_Pois_lamtha': 0.0, + 'L5Basket_Gauss_A_weight': 0.0, + 'L5Basket_Gauss_mu': 2000.0, + 'L5Basket_Gauss_sigma': 2.0, + 'L5Basket_Pois_A_weight_ampa': 0.0, + 'L5Basket_Pois_A_weight_nmda': 0.0, + 'L5Basket_Pois_lamtha': 0.0, + 't0_pois': 0.0, + 'T_pois': -1, + 'distribution_prox': 'normal', + 't0_input_prox': 1000.0, + 'tstop_input_prox': 1001, + 'f_input_prox': 10.0, + 'f_stdev_prox': 20.0, + 'events_per_cycle_prox': 2, + 'repeats_prox': 10, + 't0_input_stdev_prox': 0.0, + 'distribution_dist': 'normal', + 't0_input_dist': 1000, + 'tstop_input_dist': 1001, + 'f_input_dist': 10.0, + 'f_stdev_dist': 20.0, + 'events_per_cycle_dist': 2, + 'repeats_dist': 10, + 't0_input_stdev_dist': 0.0, + 'input_prox_A_weight_L2Pyr_ampa': 0.0, + 'input_prox_A_weight_L2Pyr_nmda': 0.0, + 'input_prox_A_weight_L5Pyr_ampa': 0.0, + 'input_prox_A_weight_L5Pyr_nmda': 0.0, + 'input_prox_A_weight_L2Basket_ampa': 0.0, + 'input_prox_A_weight_L2Basket_nmda': 0.0, + 'input_prox_A_weight_L5Basket_ampa': 0.0, + 'input_prox_A_weight_L5Basket_nmda': 0.0, + 'input_prox_A_delay_L2': 0.1, + 'input_prox_A_delay_L5': 1.0, + 'input_dist_A_weight_L2Pyr_ampa': 0.0, + 'input_dist_A_weight_L2Pyr_nmda': 0.0, + 'input_dist_A_weight_L5Pyr_ampa': 0.0, + 'input_dist_A_weight_L5Pyr_nmda': 0.0, + 'input_dist_A_weight_L2Basket_ampa': 0.0, + 'input_dist_A_weight_L2Basket_nmda': 0.0, + 'input_dist_A_delay_L2': 5.0, + 'input_dist_A_delay_L5': 5.0, + 'dt_evprox0_evdist': (-1,), + 'dt_evprox0_evprox1': (-1,), + 'sync_evinput': 0, + 'inc_evinput': 0.0, + 'Itonic_A_L2Pyr_soma': 0.0, + 'Itonic_t0_L2Pyr_soma': 0.0, + 'Itonic_T_L2Pyr_soma': -1.0, + 'Itonic_A_L2Basket': 0.0, + 'Itonic_t0_L2Basket': 0.0, + 'Itonic_T_L2Basket': -1.0, + 'Itonic_A_L5Pyr_soma': 0.0, + 'Itonic_t0_L5Pyr_soma': 0.0, + 'Itonic_T_L5Pyr_soma': -1.0, + 'Itonic_A_L5Basket': 0.0, + 'Itonic_t0_L5Basket': 0.0, + 'Itonic_T_L5Basket': -1.0, + 'save_spec_data': 0, + 'f_max_spec': 100, + 'dipole_scalefctr': 3000, + 'dipole_smooth_win': 30, + 'save_figs': 0, + 'save_vsoma': 0, + 'N_trials': 100, + 'prng_state': None, + 'prng_seedcore_input_prox': 4, + 'prng_seedcore_input_dist': 4, + 'prng_seedcore_extpois': 4, + 'prng_seedcore_extgauss': 4, + 'expmt_groups': '{ERPYes100Trials}', + 'prng_seedcore_evprox_1': 4, + 'prng_seedcore_evdist_1': 4, + 'prng_seedcore_evprox_2': 4, + 'prng_seedcore_evdist_2': 0, + 't_evprox_1': 26.61, + 'sigma_t_evprox_1': 2.47, + 'numspikes_evprox_1': 1, + 'gbar_evprox_1_L2Pyr_ampa': 0.01525, + 'gbar_evprox_1_L2Pyr_nmda': 0.0, + 'gbar_evprox_1_L2Basket_ampa': 0.08831, + 'gbar_evprox_1_L2Basket_nmda': 0.0, + 'gbar_evprox_1_L5Pyr_ampa': 0.00865, + 'gbar_evprox_1_L5Pyr_nmda': 0.0, + 'gbar_evprox_1_L5Basket_ampa': 0.19934, + 'gbar_evprox_1_L5Basket_nmda': 0.0, + 't_evdist_1': 63.53, + 'sigma_t_evdist_1': 3.85, + 'numspikes_evdist_1': 1, + 'gbar_evdist_1_L2Pyr_ampa': 7e-06, + 'gbar_evdist_1_L2Pyr_nmda': 0.004317, + 'gbar_evdist_1_L2Basket_ampa': 0.006562, + 'gbar_evdist_1_L2Basket_nmda': 0.019482, + 'gbar_evdist_1_L5Pyr_ampa': 0.1423, + 'gbar_evdist_1_L5Pyr_nmda': 0.080074, + 't_evprox_2': 137.12, + 'sigma_t_evprox_2': 8.33, + 'numspikes_evprox_2': 1, + 'gbar_evprox_2_L2Pyr_ampa': 1.43884, + 'gbar_evprox_2_L2Pyr_nmda': 0.0, + 'gbar_evprox_2_L2Basket_ampa': 3e-06, + 'gbar_evprox_2_L2Basket_nmda': 0.0, + 'gbar_evprox_2_L5Pyr_ampa': 0.684013, + 'gbar_evprox_2_L5Pyr_nmda': 0.0, + 'gbar_evprox_2_L5Basket_ampa': 0.008958, + 'gbar_evprox_2_L5Basket_nmda': 0.0}) diff --git a/hnn.py b/hnn/src/netParams.py similarity index 80% rename from hnn.py rename to hnn/src/netParams.py index acf71ca..02a01cd 100644 --- a/hnn.py +++ b/hnn/src/netParams.py @@ -8,449 +8,12 @@ """ from netpyne import specs - +from __main__ import cfg import numpy as np import itertools as it -""" -cfg.py - -Simulationg configuration for NetPyNE-based HNN network model - -Contributors: salvadordura@gmail.com -""" - -from netpyne import specs - -cfg = specs.SimConfig() -simConfig = cfg - -cfg.checkErrors = False # True # leave as False to avoid extra printouts - - -# ############################################################################ -# -# SIMULATION CONFIGURATION -# -# ############################################################################ - -# ---------------------------------------------------------------------------- -# -# NetPyNE config parameters (not part of original HNN implementation) -# -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Run parameters -# ---------------------------------------------------------------------------- -cfg.duration = 170 -cfg.dt = 0.025 -cfg.seeds = {'conn': 4321, 'stim': 1234, 'loc': 4321} -cfg.hParams['v_init'] = -65 -cfg.verbose = 0 -cfg.cvode_active = False -cfg.printRunTime = 0.1 -cfg.printPopAvgRates = True -cfg.distributeSynsUniformly = False # one syn per section in list of sections -cfg.allowSelfConns = False # allow connections from a cell to itself -cfg.allowConnsWithWeight0 = False # do not allow conns with weight 0 (faster) -cfg.oneSynPerNetcon = False # allow using the same synapse for multiple netcons - - -# ---------------------------------------------------------------------------- -# Recording -# ---------------------------------------------------------------------------- -cfg.recordTraces = {'V_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'v'}} -cfg.recordCells = [('L2Basket',0), ('L2Pyr',0), ('L5Basket',0), ('L5Pyr',0)] -cfg.recordStims = False -cfg.recordStep = 0.025 -cfg.recordDipoles = {'L2': ['L2Pyr'], 'L5': ['L5Pyr']} - -# cfg.recordLFP = [[50, 50, 50], [50, 1300, 50]] - -# ---------------------------------------------------------------------------- -# Saving -# ---------------------------------------------------------------------------- -cfg.sim_prefix = cfg.simLabel = 'default' - -cfg.saveFolder = '.' -cfg.savePickle = False -cfg.saveJson = False -cfg.saveDataInclude = ['simData', 'simConfig'] #, 'netParams', 'net'] - -# ---------------------------------------------------------------------------- -# Analysis and plotting -# ---------------------------------------------------------------------------- -pops = ['L2Basket', 'L2Pyr', 'L5Basket', 'L5Pyr'] -evprox = ['evokedProximal_1_L2Basket', 'evokedProximal_1_L2Pyr', 'evokedProximal_1_L5Basket', 'evokedProximal_1_L5Pyr', - 'evokedProximal_2_L2Basket', 'evokedProximal_2_L2Pyr', 'evokedProximal_2_L5Basket', 'evokedProximal_2_L5Pyr'] -evdist = ['evokedDistal_1_L2Basket', 'evokedDistal_1_L2Pyr', 'evokedDistal_1_L5Basket', 'evokedDistal_1_L5Pyr'] - -popColors = {'L2Basket': [0.0, 0.0, 0.0], 'L2Pyr': [0.0, 0.6, 0.0], 'L5Basket': [0.0, 0.0, 1.0], 'L5Pyr': [1.0, 0.0, 0.0], - 'Evoked proximal': [0.0, 1.0, 1.0], 'Evoked distal': [1.0, 1.0, 0.0]} - -cfg.analysis['iplotTraces'] = {'include': [('L5Pyr',0) ], 'oneFigPer': 'cell', 'saveFig': False, - 'showFig': True, 'timeRange': [0, cfg.duration]} - -cfg.analysis['iplotRaster'] = {'include': pops, 'showFig': True, 'popColors': popColors, 'markerSize': 6, 'orderInverse': True} - -cfg.analysis['iplotSpikeHist'] = {'include': [*pops, evprox, evdist, 'extRhythmicProximal', 'extRhythmicDistal'], 'legendLabels': pops + ['Evoked proximal', 'Evoked distal', 'Rhythmic proximal', 'Rhythmic distal'], 'popColors': popColors, 'yaxis': 'count', 'showFig': True} - -cfg.analysis['iplotDipole'] = {'showFig': True} - -cfg.analysis['iplotDipolePSD'] = {'showFig': True, 'maxFreq': 80} # change freq to 40 for alpha&beta tut - -cfg.analysis['iplotDipoleSpectrogram'] = {'showFig': True, 'maxFreq': 80} # change freq to 40 for alpha&beta tut - -cfg.analysis['iplotConn'] = {'includePre': pops, 'includePost': pops, 'feature': 'strength'} - -# cfg.analysis['iplotLFP'] = {'showFig': True} - -#cfg.analysis['iplotRatePSD'] = {'include': pops, 'showFig': True} - - -# ---------------------------------------------------------------------------- -# Network parameters -# ---------------------------------------------------------------------------- -cfg.gridSpacingPyr = 1 # 50 -cfg.gridSpacingBasket = [1, 1, 3] -cfg.xzScaling = 1 #100 -cfg.sizeY = 2000 - -cfg.localConn = True -cfg.rhythmicInputs = True -cfg.evokedInputs = True -cfg.tonicInputs = True -cfg.poissonInputs = True -cfg.gaussInputs = True - - -# ---------------------------------------------------------------------------- -# -# HNN original config parameters (adapted to NetPyNE) -# -# ---------------------------------------------------------------------------- - -# Params from 'ERPYes100Trials.param'; copied from cfg.__dict__ -cfg.__dict__.update({ - 'duration': 170.0, - 'tstop': 170, - 'dt': 0.05, - 'hParams': {'celsius': 37, 'v_init': -65, 'clamp_resist': 0.001}, - 'cache_efficient': False, - 'cvode_active': False, - 'cvode_atol': 0.001, - 'seeds': {'conn': 4321, 'stim': 1234, 'loc': 4321}, - 'rand123GlobalIndex': None, - 'createNEURONObj': True, - 'createPyStruct': True, - 'addSynMechs': True, - 'includeParamsLabel': True, - 'gatherOnlySimData': False, - 'compactConnFormat': False, - 'connRandomSecFromList': True, - 'distributeSynsUniformly': False, - 'pt3dRelativeToCellLocation': True, - 'invertedYCoord': True, - 'allowSelfConns': False, - 'allowConnsWithWeight0': False, - 'oneSynPerNetcon': False, - 'saveCellSecs': True, - 'saveCellConns': True, - 'timing': True, - 'saveTiming': False, - 'printRunTime': 0.1, - 'printPopAvgRates': True, - 'printSynsAfterRule': False, - 'verbose': 0, - 'recordCells': [('L2Basket', 0), ('L2Pyr', 0), ('L5Basket', 0), ('L5Pyr', 0)], - 'recordTraces': {'V_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'v'}}, - 'recordCellsSpikes': -1, - 'recordStim': False, - 'recordLFP': [], - 'recordDipoles': {'L2': ['L2Pyr'], 'L5': ['L5Pyr']}, - 'saveLFPCells': False, - 'recordStep': 0.05, - 'recordTime': True, - 'simLabel': 'default', - 'saveFolder': '.', - 'filename': './default', - 'saveDataInclude': ['simData', 'simConfig'], - 'timestampFilename': False, - 'savePickle': False, - 'saveJson': False, - 'saveMat': False, - 'saveCSV': False, - 'saveDpk': False, - 'saveHDF5': False, - 'saveDat': False, - 'backupCfgFile': [], - 'checkErrors': False, - 'checkErrorsVerbose': False, - 'recordStims': False, - 'sim_prefix': 'ERPYes100Trials', - 'gridSpacingPyr': 1, - 'gridSpacingBasket': [1, 1, 3], - 'xzScaling': 1, - 'sizeY': 2000, - 'localConn': True, - 'rhythmicInputs': True, - 'evokedInputs': True, - 'tonicInputs': True, - 'poissonInputs': True, - 'gaussInputs': True, - 'EEgain': 1.0, - 'EIgain': 1.0, - 'IEgain': 1.0, - 'IIgain': 1.0, - 'celsius': 37.0, - 'threshold': 0.0, - 'L2Pyr_soma_L': 22.1, - 'L2Pyr_soma_diam': 23.4, - 'L2Pyr_soma_cm': 0.6195, - 'L2Pyr_soma_Ra': 200.0, - 'L2Pyr_dend_cm': 0.6195, - 'L2Pyr_dend_Ra': 200.0, - 'L2Pyr_apicaltrunk_L': 59.5, - 'L2Pyr_apicaltrunk_diam': 4.25, - 'L2Pyr_apical1_L': 306.0, - 'L2Pyr_apical1_diam': 4.08, - 'L2Pyr_apicaltuft_L': 238.0, - 'L2Pyr_apicaltuft_diam': 3.4, - 'L2Pyr_apicaloblique_L': 340.0, - 'L2Pyr_apicaloblique_diam': 3.91, - 'L2Pyr_basal1_L': 85.0, - 'L2Pyr_basal1_diam': 4.25, - 'L2Pyr_basal2_L': 255.0, - 'L2Pyr_basal2_diam': 2.72, - 'L2Pyr_basal3_L': 255.0, - 'L2Pyr_basal3_diam': 2.72, - 'L2Pyr_ampa_e': 0.0, - 'L2Pyr_ampa_tau1': 0.5, - 'L2Pyr_ampa_tau2': 5.0, - 'L2Pyr_nmda_e': 0.0, - 'L2Pyr_nmda_tau1': 1.0, - 'L2Pyr_nmda_tau2': 20.0, - 'L2Pyr_gabaa_e': -80.0, - 'L2Pyr_gabaa_tau1': 0.5, - 'L2Pyr_gabaa_tau2': 5.0, - 'L2Pyr_gabab_e': -80.0, - 'L2Pyr_gabab_tau1': 1.0, - 'L2Pyr_gabab_tau2': 20.0, - 'L2Pyr_soma_gkbar_hh2': 0.01, - 'L2Pyr_soma_gnabar_hh2': 0.18, - 'L2Pyr_soma_el_hh2': -65.0, - 'L2Pyr_soma_gl_hh2': 4.26e-05, - 'L2Pyr_soma_gbar_km': 250.0, - 'L2Pyr_dend_gkbar_hh2': 0.01, - 'L2Pyr_dend_gnabar_hh2': 0.15, - 'L2Pyr_dend_el_hh2': -65.0, - 'L2Pyr_dend_gl_hh2': 4.26e-05, - 'L2Pyr_dend_gbar_km': 250.0, - 'L5Pyr_soma_L': 39.0, - 'L5Pyr_soma_diam': 28.9, - 'L5Pyr_soma_cm': 0.85, - 'L5Pyr_soma_Ra': 200.0, - 'L5Pyr_dend_cm': 0.85, - 'L5Pyr_dend_Ra': 200.0, - 'L5Pyr_apicaltrunk_L': 102.0, - 'L5Pyr_apicaltrunk_diam': 10.2, - 'L5Pyr_apical1_L': 680.0, - 'L5Pyr_apical1_diam': 7.48, - 'L5Pyr_apical2_L': 680.0, - 'L5Pyr_apical2_diam': 4.93, - 'L5Pyr_apicaltuft_L': 425.0, - 'L5Pyr_apicaltuft_diam': 3.4, - 'L5Pyr_apicaloblique_L': 255.0, - 'L5Pyr_apicaloblique_diam': 5.1, - 'L5Pyr_basal1_L': 85.0, - 'L5Pyr_basal1_diam': 6.8, - 'L5Pyr_basal2_L': 255.0, - 'L5Pyr_basal2_diam': 8.5, - 'L5Pyr_basal3_L': 255.0, - 'L5Pyr_basal3_diam': 8.5, - 'L5Pyr_ampa_e': 0.0, - 'L5Pyr_ampa_tau1': 0.5, - 'L5Pyr_ampa_tau2': 5.0, - 'L5Pyr_nmda_e': 0.0, - 'L5Pyr_nmda_tau1': 1.0, - 'L5Pyr_nmda_tau2': 20.0, - 'L5Pyr_gabaa_e': -80.0, - 'L5Pyr_gabaa_tau1': 0.5, - 'L5Pyr_gabaa_tau2': 5.0, - 'L5Pyr_gabab_e': -80.0, - 'L5Pyr_gabab_tau1': 1.0, - 'L5Pyr_gabab_tau2': 20.0, - 'L5Pyr_soma_gkbar_hh2': 0.01, - 'L5Pyr_soma_gnabar_hh2': 0.16, - 'L5Pyr_soma_el_hh2': -65.0, - 'L5Pyr_soma_gl_hh2': 4.26e-05, - 'L5Pyr_soma_gbar_ca': 60.0, - 'L5Pyr_soma_taur_cad': 20.0, - 'L5Pyr_soma_gbar_kca': 0.0002, - 'L5Pyr_soma_gbar_km': 200.0, - 'L5Pyr_soma_gbar_cat': 0.0002, - 'L5Pyr_soma_gbar_ar': 1e-06, - 'L5Pyr_dend_gkbar_hh2': 0.01, - 'L5Pyr_dend_gnabar_hh2': 0.14, - 'L5Pyr_dend_el_hh2': -71.0, - 'L5Pyr_dend_gl_hh2': 4.26e-05, - 'L5Pyr_dend_gbar_ca': 60.0, - 'L5Pyr_dend_taur_cad': 20.0, - 'L5Pyr_dend_gbar_kca': 0.0002, - 'L5Pyr_dend_gbar_km': 200.0, - 'L5Pyr_dend_gbar_cat': 0.0002, - 'L5Pyr_dend_gbar_ar': 1e-06, - 'N_pyr_x': 10, - 'N_pyr_y': 10, - 'gbar_L2Pyr_L2Pyr_ampa': 0.0005, - 'gbar_L2Pyr_L2Pyr_nmda': 0.0005, - 'gbar_L2Basket_L2Pyr_gabaa': 0.05, - 'gbar_L2Basket_L2Pyr_gabab': 0.05, - 'gbar_L2Pyr_L2Basket': 0.0005, - 'gbar_L2Basket_L2Basket': 0.02, - 'gbar_L5Pyr_L5Pyr_ampa': 0.0005, - 'gbar_L5Pyr_L5Pyr_nmda': 0.0005, - 'gbar_L2Pyr_L5Pyr': 0.00025, - 'gbar_L2Basket_L5Pyr': 0.001, - 'gbar_L5Basket_L5Pyr_gabaa': 0.025, - 'gbar_L5Basket_L5Pyr_gabab': 0.025, - 'gbar_L5Basket_L5Basket': 0.02, - 'gbar_L5Pyr_L5Basket': 0.0005, - 'gbar_L2Pyr_L5Basket': 0.00025, - 'L2Basket_Gauss_A_weight': 0.0, - 'L2Basket_Gauss_mu': 2000.0, - 'L2Basket_Gauss_sigma': 3.6, - 'L2Basket_Pois_A_weight_ampa': 0.0, - 'L2Basket_Pois_A_weight_nmda': 0.0, - 'L2Basket_Pois_lamtha': 0.0, - 'L2Pyr_Gauss_A_weight': 0.0, - 'L2Pyr_Gauss_mu': 2000.0, - 'L2Pyr_Gauss_sigma': 3.6, - 'L2Pyr_Pois_A_weight_ampa': 0.0, - 'L2Pyr_Pois_A_weight_nmda': 0.0, - 'L2Pyr_Pois_lamtha': 0.0, - 'L5Pyr_Gauss_A_weight': 0.0, - 'L5Pyr_Gauss_mu': 2000.0, - 'L5Pyr_Gauss_sigma': 4.8, - 'L5Pyr_Pois_A_weight_ampa': 0.0, - 'L5Pyr_Pois_A_weight_nmda': 0.0, - 'L5Pyr_Pois_lamtha': 0.0, - 'L5Basket_Gauss_A_weight': 0.0, - 'L5Basket_Gauss_mu': 2000.0, - 'L5Basket_Gauss_sigma': 2.0, - 'L5Basket_Pois_A_weight_ampa': 0.0, - 'L5Basket_Pois_A_weight_nmda': 0.0, - 'L5Basket_Pois_lamtha': 0.0, - 't0_pois': 0.0, - 'T_pois': -1, - 'distribution_prox': 'normal', - 't0_input_prox': 1000.0, - 'tstop_input_prox': 1001, - 'f_input_prox': 10.0, - 'f_stdev_prox': 20.0, - 'events_per_cycle_prox': 2, - 'repeats_prox': 10, - 't0_input_stdev_prox': 0.0, - 'distribution_dist': 'normal', - 't0_input_dist': 1000, - 'tstop_input_dist': 1001, - 'f_input_dist': 10.0, - 'f_stdev_dist': 20.0, - 'events_per_cycle_dist': 2, - 'repeats_dist': 10, - 't0_input_stdev_dist': 0.0, - 'input_prox_A_weight_L2Pyr_ampa': 0.0, - 'input_prox_A_weight_L2Pyr_nmda': 0.0, - 'input_prox_A_weight_L5Pyr_ampa': 0.0, - 'input_prox_A_weight_L5Pyr_nmda': 0.0, - 'input_prox_A_weight_L2Basket_ampa': 0.0, - 'input_prox_A_weight_L2Basket_nmda': 0.0, - 'input_prox_A_weight_L5Basket_ampa': 0.0, - 'input_prox_A_weight_L5Basket_nmda': 0.0, - 'input_prox_A_delay_L2': 0.1, - 'input_prox_A_delay_L5': 1.0, - 'input_dist_A_weight_L2Pyr_ampa': 0.0, - 'input_dist_A_weight_L2Pyr_nmda': 0.0, - 'input_dist_A_weight_L5Pyr_ampa': 0.0, - 'input_dist_A_weight_L5Pyr_nmda': 0.0, - 'input_dist_A_weight_L2Basket_ampa': 0.0, - 'input_dist_A_weight_L2Basket_nmda': 0.0, - 'input_dist_A_delay_L2': 5.0, - 'input_dist_A_delay_L5': 5.0, - 'dt_evprox0_evdist': (-1,), - 'dt_evprox0_evprox1': (-1,), - 'sync_evinput': 0, - 'inc_evinput': 0.0, - 'Itonic_A_L2Pyr_soma': 0.0, - 'Itonic_t0_L2Pyr_soma': 0.0, - 'Itonic_T_L2Pyr_soma': -1.0, - 'Itonic_A_L2Basket': 0.0, - 'Itonic_t0_L2Basket': 0.0, - 'Itonic_T_L2Basket': -1.0, - 'Itonic_A_L5Pyr_soma': 0.0, - 'Itonic_t0_L5Pyr_soma': 0.0, - 'Itonic_T_L5Pyr_soma': -1.0, - 'Itonic_A_L5Basket': 0.0, - 'Itonic_t0_L5Basket': 0.0, - 'Itonic_T_L5Basket': -1.0, - 'save_spec_data': 0, - 'f_max_spec': 100, - 'dipole_scalefctr': 3000, - 'dipole_smooth_win': 30, - 'save_figs': 0, - 'save_vsoma': 0, - 'N_trials': 100, - 'prng_state': None, - 'prng_seedcore_input_prox': 4, - 'prng_seedcore_input_dist': 4, - 'prng_seedcore_extpois': 4, - 'prng_seedcore_extgauss': 4, - 'expmt_groups': '{ERPYes100Trials}', - 'prng_seedcore_evprox_1': 4, - 'prng_seedcore_evdist_1': 4, - 'prng_seedcore_evprox_2': 4, - 'prng_seedcore_evdist_2': 0, - 't_evprox_1': 26.61, - 'sigma_t_evprox_1': 2.47, - 'numspikes_evprox_1': 1, - 'gbar_evprox_1_L2Pyr_ampa': 0.01525, - 'gbar_evprox_1_L2Pyr_nmda': 0.0, - 'gbar_evprox_1_L2Basket_ampa': 0.08831, - 'gbar_evprox_1_L2Basket_nmda': 0.0, - 'gbar_evprox_1_L5Pyr_ampa': 0.00865, - 'gbar_evprox_1_L5Pyr_nmda': 0.0, - 'gbar_evprox_1_L5Basket_ampa': 0.19934, - 'gbar_evprox_1_L5Basket_nmda': 0.0, - 't_evdist_1': 63.53, - 'sigma_t_evdist_1': 3.85, - 'numspikes_evdist_1': 1, - 'gbar_evdist_1_L2Pyr_ampa': 7e-06, - 'gbar_evdist_1_L2Pyr_nmda': 0.004317, - 'gbar_evdist_1_L2Basket_ampa': 0.006562, - 'gbar_evdist_1_L2Basket_nmda': 0.019482, - 'gbar_evdist_1_L5Pyr_ampa': 0.1423, - 'gbar_evdist_1_L5Pyr_nmda': 0.080074, - 't_evprox_2': 137.12, - 'sigma_t_evprox_2': 8.33, - 'numspikes_evprox_2': 1, - 'gbar_evprox_2_L2Pyr_ampa': 1.43884, - 'gbar_evprox_2_L2Pyr_nmda': 0.0, - 'gbar_evprox_2_L2Basket_ampa': 3e-06, - 'gbar_evprox_2_L2Basket_nmda': 0.0, - 'gbar_evprox_2_L5Pyr_ampa': 0.684013, - 'gbar_evprox_2_L5Pyr_nmda': 0.0, - 'gbar_evprox_2_L5Basket_ampa': 0.008958, - 'gbar_evprox_2_L5Basket_nmda': 0.0}) - - - - - - - # ---------------------------------------------------------------------------- # Cell parameters # ---------------------------------------------------------------------------- diff --git a/hnn_simple/index.npjson b/hnn_simple/index.npjson new file mode 100644 index 0000000..dfd3f66 --- /dev/null +++ b/hnn_simple/index.npjson @@ -0,0 +1,5 @@ +{ + "mod_folder": "../mod", + "simConfig_python": "src/cfg.py", + "netParams_python": "src/netParams.py" +} \ No newline at end of file diff --git a/hnn_simple/src/cfg.py b/hnn_simple/src/cfg.py new file mode 100644 index 0000000..3046322 --- /dev/null +++ b/hnn_simple/src/cfg.py @@ -0,0 +1,430 @@ +""" +cfg.py + +Simulationg configuration for NetPyNE-based HNN network model + +Contributors: salvadordura@gmail.com +""" + +from netpyne import specs + +cfg = specs.SimConfig() +simConfig = cfg + +cfg.checkErrors = False # True # leave as False to avoid extra printouts + + +# ############################################################################ +# +# SIMULATION CONFIGURATION +# +# ############################################################################ + +# ---------------------------------------------------------------------------- +# +# NetPyNE config parameters (not part of original HNN implementation) +# +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Run parameters +# ---------------------------------------------------------------------------- +cfg.duration = 170 +cfg.dt = 0.025 +cfg.seeds = {'conn': 4321, 'stim': 1234, 'loc': 4321} +cfg.hParams['v_init'] = -65 +cfg.verbose = 0 +cfg.cvode_active = False +cfg.printRunTime = 0.1 +cfg.printPopAvgRates = True +cfg.distributeSynsUniformly = False # one syn per section in list of sections +cfg.allowSelfConns = False # allow connections from a cell to itself +cfg.allowConnsWithWeight0 = False # do not allow conns with weight 0 (faster) +cfg.oneSynPerNetcon = False # allow using the same synapse for multiple netcons + + +# ---------------------------------------------------------------------------- +# Recording +# ---------------------------------------------------------------------------- +cfg.recordTraces = {'V_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'v'}} +cfg.recordCells = [('L2Basket',0), ('L2Pyr',0), ('L5Basket',0), ('L5Pyr',0)] +cfg.recordStims = False +cfg.recordStep = 0.025 +cfg.recordDipoles = {'L2': ['L2Pyr'], 'L5': ['L5Pyr']} + +# cfg.recordLFP = [[50, 50, 50], [50, 1300, 50]] + +# ---------------------------------------------------------------------------- +# Saving +# ---------------------------------------------------------------------------- +cfg.sim_prefix = cfg.simLabel = 'default' + +cfg.saveFolder = '.' +cfg.savePickle = False +cfg.saveJson = False +cfg.saveDataInclude = ['simData', 'simConfig'] #, 'netParams', 'net'] + +# ---------------------------------------------------------------------------- +# Analysis and plotting +# ---------------------------------------------------------------------------- +pops = ['L2Basket', 'L2Pyr', 'L5Basket', 'L5Pyr'] +evprox = ['evokedProximal_1_L2Basket', 'evokedProximal_1_L2Pyr', 'evokedProximal_1_L5Basket', 'evokedProximal_1_L5Pyr', + 'evokedProximal_2_L2Basket', 'evokedProximal_2_L2Pyr', 'evokedProximal_2_L5Basket', 'evokedProximal_2_L5Pyr'] +evdist = ['evokedDistal_1_L2Basket', 'evokedDistal_1_L2Pyr', 'evokedDistal_1_L5Basket', 'evokedDistal_1_L5Pyr'] + +popColors = {'L2Basket': [0.0, 0.0, 0.0], 'L2Pyr': [0.0, 0.6, 0.0], 'L5Basket': [0.0, 0.0, 1.0], 'L5Pyr': [1.0, 0.0, 0.0], + 'Evoked proximal': [0.0, 1.0, 1.0], 'Evoked distal': [1.0, 1.0, 0.0]} + +cfg.analysis['iplotTraces'] = {'include': [('L5Pyr',0) ], 'oneFigPer': 'cell', 'saveFig': False, + 'showFig': True, 'timeRange': [0, cfg.duration]} + +cfg.analysis['iplotRaster'] = {'include': pops, 'showFig': True, 'popColors': popColors, 'markerSize': 6, 'orderInverse': True} + +cfg.analysis['iplotSpikeHist'] = {'include': [*pops, evprox, evdist, 'extRhythmicProximal', 'extRhythmicDistal'], 'legendLabels': pops + ['Evoked proximal', 'Evoked distal', 'Rhythmic proximal', 'Rhythmic distal'], 'popColors': popColors, 'yaxis': 'count', 'showFig': True} + +cfg.analysis['iplotDipole'] = {'showFig': True} + +cfg.analysis['iplotDipolePSD'] = {'showFig': True, 'maxFreq': 80} # change freq to 40 for alpha&beta tut + +cfg.analysis['iplotDipoleSpectrogram'] = {'showFig': True, 'maxFreq': 80} # change freq to 40 for alpha&beta tut + +cfg.analysis['iplotConn'] = {'includePre': pops, 'includePost': pops, 'feature': 'strength'} + +# cfg.analysis['iplotLFP'] = {'showFig': True} + +#cfg.analysis['iplotRatePSD'] = {'include': pops, 'showFig': True} + + +# ---------------------------------------------------------------------------- +# Network parameters +# ---------------------------------------------------------------------------- +cfg.gridSpacingPyr = 1 # 50 +cfg.gridSpacingBasket = [1, 1, 3] +cfg.xzScaling = 1 #100 +cfg.sizeY = 2000 + +cfg.localConn = True +cfg.rhythmicInputs = True +cfg.evokedInputs = True +cfg.tonicInputs = True +cfg.poissonInputs = True +cfg.gaussInputs = True + + +# ---------------------------------------------------------------------------- +# +# HNN original config parameters (adapted to NetPyNE) +# +# ---------------------------------------------------------------------------- + +# Params from 'ERPYes100Trials.param'; copied from cfg.__dict__ +cfg.__dict__.update({ + 'duration': 170.0, + 'tstop': 170, + 'dt': 0.05, + 'hParams': {'celsius': 37, 'v_init': -65, 'clamp_resist': 0.001}, + 'cache_efficient': False, + 'cvode_active': False, + 'cvode_atol': 0.001, + 'seeds': {'conn': 4321, 'stim': 1234, 'loc': 4321}, + 'rand123GlobalIndex': None, + 'createNEURONObj': True, + 'createPyStruct': True, + 'addSynMechs': True, + 'includeParamsLabel': True, + 'gatherOnlySimData': False, + 'compactConnFormat': False, + 'connRandomSecFromList': True, + 'distributeSynsUniformly': False, + 'pt3dRelativeToCellLocation': True, + 'invertedYCoord': True, + 'allowSelfConns': False, + 'allowConnsWithWeight0': False, + 'oneSynPerNetcon': False, + 'saveCellSecs': True, + 'saveCellConns': True, + 'timing': True, + 'saveTiming': False, + 'printRunTime': 0.1, + 'printPopAvgRates': True, + 'printSynsAfterRule': False, + 'verbose': 0, + 'recordCells': [('L2Basket', 0), ('L2Pyr', 0), ('L5Basket', 0), ('L5Pyr', 0)], + 'recordTraces': {'V_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'v'}}, + 'recordCellsSpikes': -1, + 'recordStim': False, + 'recordLFP': [], + 'recordDipoles': {'L2': ['L2Pyr'], 'L5': ['L5Pyr']}, + 'saveLFPCells': False, + 'recordStep': 0.05, + 'recordTime': True, + 'simLabel': 'default', + 'saveFolder': '.', + 'filename': './default', + 'saveDataInclude': ['simData', 'simConfig'], + 'timestampFilename': False, + 'savePickle': False, + 'saveJson': False, + 'saveMat': False, + 'saveCSV': False, + 'saveDpk': False, + 'saveHDF5': False, + 'saveDat': False, + 'backupCfgFile': [], + 'checkErrors': False, + 'checkErrorsVerbose': False, + 'recordStims': False, + 'sim_prefix': 'ERPYes100Trials', + 'gridSpacingPyr': 1, + 'gridSpacingBasket': [1, 1, 3], + 'xzScaling': 1, + 'sizeY': 2000, + 'localConn': True, + 'rhythmicInputs': True, + 'evokedInputs': True, + 'tonicInputs': True, + 'poissonInputs': True, + 'gaussInputs': True, + 'EEgain': 1.0, + 'EIgain': 1.0, + 'IEgain': 1.0, + 'IIgain': 1.0, + 'celsius': 37.0, + 'threshold': 0.0, + 'L2Pyr_soma_L': 22.1, + 'L2Pyr_soma_diam': 23.4, + 'L2Pyr_soma_cm': 0.6195, + 'L2Pyr_soma_Ra': 200.0, + 'L2Pyr_dend_cm': 0.6195, + 'L2Pyr_dend_Ra': 200.0, + 'L2Pyr_apicaltrunk_L': 59.5, + 'L2Pyr_apicaltrunk_diam': 4.25, + 'L2Pyr_apical1_L': 306.0, + 'L2Pyr_apical1_diam': 4.08, + 'L2Pyr_apicaltuft_L': 238.0, + 'L2Pyr_apicaltuft_diam': 3.4, + 'L2Pyr_apicaloblique_L': 340.0, + 'L2Pyr_apicaloblique_diam': 3.91, + 'L2Pyr_basal1_L': 85.0, + 'L2Pyr_basal1_diam': 4.25, + 'L2Pyr_basal2_L': 255.0, + 'L2Pyr_basal2_diam': 2.72, + 'L2Pyr_basal3_L': 255.0, + 'L2Pyr_basal3_diam': 2.72, + 'L2Pyr_ampa_e': 0.0, + 'L2Pyr_ampa_tau1': 0.5, + 'L2Pyr_ampa_tau2': 5.0, + 'L2Pyr_nmda_e': 0.0, + 'L2Pyr_nmda_tau1': 1.0, + 'L2Pyr_nmda_tau2': 20.0, + 'L2Pyr_gabaa_e': -80.0, + 'L2Pyr_gabaa_tau1': 0.5, + 'L2Pyr_gabaa_tau2': 5.0, + 'L2Pyr_gabab_e': -80.0, + 'L2Pyr_gabab_tau1': 1.0, + 'L2Pyr_gabab_tau2': 20.0, + 'L2Pyr_soma_gkbar_hh2': 0.01, + 'L2Pyr_soma_gnabar_hh2': 0.18, + 'L2Pyr_soma_el_hh2': -65.0, + 'L2Pyr_soma_gl_hh2': 4.26e-05, + 'L2Pyr_soma_gbar_km': 250.0, + 'L2Pyr_dend_gkbar_hh2': 0.01, + 'L2Pyr_dend_gnabar_hh2': 0.15, + 'L2Pyr_dend_el_hh2': -65.0, + 'L2Pyr_dend_gl_hh2': 4.26e-05, + 'L2Pyr_dend_gbar_km': 250.0, + 'L5Pyr_soma_L': 39.0, + 'L5Pyr_soma_diam': 28.9, + 'L5Pyr_soma_cm': 0.85, + 'L5Pyr_soma_Ra': 200.0, + 'L5Pyr_dend_cm': 0.85, + 'L5Pyr_dend_Ra': 200.0, + 'L5Pyr_apicaltrunk_L': 102.0, + 'L5Pyr_apicaltrunk_diam': 10.2, + 'L5Pyr_apical1_L': 680.0, + 'L5Pyr_apical1_diam': 7.48, + 'L5Pyr_apical2_L': 680.0, + 'L5Pyr_apical2_diam': 4.93, + 'L5Pyr_apicaltuft_L': 425.0, + 'L5Pyr_apicaltuft_diam': 3.4, + 'L5Pyr_apicaloblique_L': 255.0, + 'L5Pyr_apicaloblique_diam': 5.1, + 'L5Pyr_basal1_L': 85.0, + 'L5Pyr_basal1_diam': 6.8, + 'L5Pyr_basal2_L': 255.0, + 'L5Pyr_basal2_diam': 8.5, + 'L5Pyr_basal3_L': 255.0, + 'L5Pyr_basal3_diam': 8.5, + 'L5Pyr_ampa_e': 0.0, + 'L5Pyr_ampa_tau1': 0.5, + 'L5Pyr_ampa_tau2': 5.0, + 'L5Pyr_nmda_e': 0.0, + 'L5Pyr_nmda_tau1': 1.0, + 'L5Pyr_nmda_tau2': 20.0, + 'L5Pyr_gabaa_e': -80.0, + 'L5Pyr_gabaa_tau1': 0.5, + 'L5Pyr_gabaa_tau2': 5.0, + 'L5Pyr_gabab_e': -80.0, + 'L5Pyr_gabab_tau1': 1.0, + 'L5Pyr_gabab_tau2': 20.0, + 'L5Pyr_soma_gkbar_hh2': 0.01, + 'L5Pyr_soma_gnabar_hh2': 0.16, + 'L5Pyr_soma_el_hh2': -65.0, + 'L5Pyr_soma_gl_hh2': 4.26e-05, + 'L5Pyr_soma_gbar_ca': 60.0, + 'L5Pyr_soma_taur_cad': 20.0, + 'L5Pyr_soma_gbar_kca': 0.0002, + 'L5Pyr_soma_gbar_km': 200.0, + 'L5Pyr_soma_gbar_cat': 0.0002, + 'L5Pyr_soma_gbar_ar': 1e-06, + 'L5Pyr_dend_gkbar_hh2': 0.01, + 'L5Pyr_dend_gnabar_hh2': 0.14, + 'L5Pyr_dend_el_hh2': -71.0, + 'L5Pyr_dend_gl_hh2': 4.26e-05, + 'L5Pyr_dend_gbar_ca': 60.0, + 'L5Pyr_dend_taur_cad': 20.0, + 'L5Pyr_dend_gbar_kca': 0.0002, + 'L5Pyr_dend_gbar_km': 200.0, + 'L5Pyr_dend_gbar_cat': 0.0002, + 'L5Pyr_dend_gbar_ar': 1e-06, + 'N_pyr_x': 10, + 'N_pyr_y': 10, + 'gbar_L2Pyr_L2Pyr_ampa': 0.0005, + 'gbar_L2Pyr_L2Pyr_nmda': 0.0005, + 'gbar_L2Basket_L2Pyr_gabaa': 0.05, + 'gbar_L2Basket_L2Pyr_gabab': 0.05, + 'gbar_L2Pyr_L2Basket': 0.0005, + 'gbar_L2Basket_L2Basket': 0.02, + 'gbar_L5Pyr_L5Pyr_ampa': 0.0005, + 'gbar_L5Pyr_L5Pyr_nmda': 0.0005, + 'gbar_L2Pyr_L5Pyr': 0.00025, + 'gbar_L2Basket_L5Pyr': 0.001, + 'gbar_L5Basket_L5Pyr_gabaa': 0.025, + 'gbar_L5Basket_L5Pyr_gabab': 0.025, + 'gbar_L5Basket_L5Basket': 0.02, + 'gbar_L5Pyr_L5Basket': 0.0005, + 'gbar_L2Pyr_L5Basket': 0.00025, + 'L2Basket_Gauss_A_weight': 0.0, + 'L2Basket_Gauss_mu': 2000.0, + 'L2Basket_Gauss_sigma': 3.6, + 'L2Basket_Pois_A_weight_ampa': 0.0, + 'L2Basket_Pois_A_weight_nmda': 0.0, + 'L2Basket_Pois_lamtha': 0.0, + 'L2Pyr_Gauss_A_weight': 0.0, + 'L2Pyr_Gauss_mu': 2000.0, + 'L2Pyr_Gauss_sigma': 3.6, + 'L2Pyr_Pois_A_weight_ampa': 0.0, + 'L2Pyr_Pois_A_weight_nmda': 0.0, + 'L2Pyr_Pois_lamtha': 0.0, + 'L5Pyr_Gauss_A_weight': 0.0, + 'L5Pyr_Gauss_mu': 2000.0, + 'L5Pyr_Gauss_sigma': 4.8, + 'L5Pyr_Pois_A_weight_ampa': 0.0, + 'L5Pyr_Pois_A_weight_nmda': 0.0, + 'L5Pyr_Pois_lamtha': 0.0, + 'L5Basket_Gauss_A_weight': 0.0, + 'L5Basket_Gauss_mu': 2000.0, + 'L5Basket_Gauss_sigma': 2.0, + 'L5Basket_Pois_A_weight_ampa': 0.0, + 'L5Basket_Pois_A_weight_nmda': 0.0, + 'L5Basket_Pois_lamtha': 0.0, + 't0_pois': 0.0, + 'T_pois': -1, + 'distribution_prox': 'normal', + 't0_input_prox': 1000.0, + 'tstop_input_prox': 1001, + 'f_input_prox': 10.0, + 'f_stdev_prox': 20.0, + 'events_per_cycle_prox': 2, + 'repeats_prox': 10, + 't0_input_stdev_prox': 0.0, + 'distribution_dist': 'normal', + 't0_input_dist': 1000, + 'tstop_input_dist': 1001, + 'f_input_dist': 10.0, + 'f_stdev_dist': 20.0, + 'events_per_cycle_dist': 2, + 'repeats_dist': 10, + 't0_input_stdev_dist': 0.0, + 'input_prox_A_weight_L2Pyr_ampa': 0.0, + 'input_prox_A_weight_L2Pyr_nmda': 0.0, + 'input_prox_A_weight_L5Pyr_ampa': 0.0, + 'input_prox_A_weight_L5Pyr_nmda': 0.0, + 'input_prox_A_weight_L2Basket_ampa': 0.0, + 'input_prox_A_weight_L2Basket_nmda': 0.0, + 'input_prox_A_weight_L5Basket_ampa': 0.0, + 'input_prox_A_weight_L5Basket_nmda': 0.0, + 'input_prox_A_delay_L2': 0.1, + 'input_prox_A_delay_L5': 1.0, + 'input_dist_A_weight_L2Pyr_ampa': 0.0, + 'input_dist_A_weight_L2Pyr_nmda': 0.0, + 'input_dist_A_weight_L5Pyr_ampa': 0.0, + 'input_dist_A_weight_L5Pyr_nmda': 0.0, + 'input_dist_A_weight_L2Basket_ampa': 0.0, + 'input_dist_A_weight_L2Basket_nmda': 0.0, + 'input_dist_A_delay_L2': 5.0, + 'input_dist_A_delay_L5': 5.0, + 'dt_evprox0_evdist': (-1,), + 'dt_evprox0_evprox1': (-1,), + 'sync_evinput': 0, + 'inc_evinput': 0.0, + 'Itonic_A_L2Pyr_soma': 0.0, + 'Itonic_t0_L2Pyr_soma': 0.0, + 'Itonic_T_L2Pyr_soma': -1.0, + 'Itonic_A_L2Basket': 0.0, + 'Itonic_t0_L2Basket': 0.0, + 'Itonic_T_L2Basket': -1.0, + 'Itonic_A_L5Pyr_soma': 0.0, + 'Itonic_t0_L5Pyr_soma': 0.0, + 'Itonic_T_L5Pyr_soma': -1.0, + 'Itonic_A_L5Basket': 0.0, + 'Itonic_t0_L5Basket': 0.0, + 'Itonic_T_L5Basket': -1.0, + 'save_spec_data': 0, + 'f_max_spec': 100, + 'dipole_scalefctr': 3000, + 'dipole_smooth_win': 30, + 'save_figs': 0, + 'save_vsoma': 0, + 'N_trials': 100, + 'prng_state': None, + 'prng_seedcore_input_prox': 4, + 'prng_seedcore_input_dist': 4, + 'prng_seedcore_extpois': 4, + 'prng_seedcore_extgauss': 4, + 'expmt_groups': '{ERPYes100Trials}', + 'prng_seedcore_evprox_1': 4, + 'prng_seedcore_evdist_1': 4, + 'prng_seedcore_evprox_2': 4, + 'prng_seedcore_evdist_2': 0, + 't_evprox_1': 26.61, + 'sigma_t_evprox_1': 2.47, + 'numspikes_evprox_1': 1, + 'gbar_evprox_1_L2Pyr_ampa': 0.01525, + 'gbar_evprox_1_L2Pyr_nmda': 0.0, + 'gbar_evprox_1_L2Basket_ampa': 0.08831, + 'gbar_evprox_1_L2Basket_nmda': 0.0, + 'gbar_evprox_1_L5Pyr_ampa': 0.00865, + 'gbar_evprox_1_L5Pyr_nmda': 0.0, + 'gbar_evprox_1_L5Basket_ampa': 0.19934, + 'gbar_evprox_1_L5Basket_nmda': 0.0, + 't_evdist_1': 63.53, + 'sigma_t_evdist_1': 3.85, + 'numspikes_evdist_1': 1, + 'gbar_evdist_1_L2Pyr_ampa': 7e-06, + 'gbar_evdist_1_L2Pyr_nmda': 0.004317, + 'gbar_evdist_1_L2Basket_ampa': 0.006562, + 'gbar_evdist_1_L2Basket_nmda': 0.019482, + 'gbar_evdist_1_L5Pyr_ampa': 0.1423, + 'gbar_evdist_1_L5Pyr_nmda': 0.080074, + 't_evprox_2': 137.12, + 'sigma_t_evprox_2': 8.33, + 'numspikes_evprox_2': 1, + 'gbar_evprox_2_L2Pyr_ampa': 1.43884, + 'gbar_evprox_2_L2Pyr_nmda': 0.0, + 'gbar_evprox_2_L2Basket_ampa': 3e-06, + 'gbar_evprox_2_L2Basket_nmda': 0.0, + 'gbar_evprox_2_L5Pyr_ampa': 0.684013, + 'gbar_evprox_2_L5Pyr_nmda': 0.0, + 'gbar_evprox_2_L5Basket_ampa': 0.008958, + 'gbar_evprox_2_L5Basket_nmda': 0.0}) diff --git a/hnn_simple.py b/hnn_simple/src/netParams.py similarity index 80% rename from hnn_simple.py rename to hnn_simple/src/netParams.py index a807713..17fbec7 100644 --- a/hnn_simple.py +++ b/hnn_simple/src/netParams.py @@ -1,4 +1,3 @@ - """ netParams.py @@ -8,449 +7,12 @@ """ from netpyne import specs - +from __main__ import cfg import numpy as np import itertools as it -""" -cfg.py - -Simulationg configuration for NetPyNE-based HNN network model - -Contributors: salvadordura@gmail.com -""" - -from netpyne import specs - -cfg = specs.SimConfig() -simConfig = cfg - -cfg.checkErrors = False # True # leave as False to avoid extra printouts - - -# ############################################################################ -# -# SIMULATION CONFIGURATION -# -# ############################################################################ - -# ---------------------------------------------------------------------------- -# -# NetPyNE config parameters (not part of original HNN implementation) -# -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Run parameters -# ---------------------------------------------------------------------------- -cfg.duration = 170 -cfg.dt = 0.025 -cfg.seeds = {'conn': 4321, 'stim': 1234, 'loc': 4321} -cfg.hParams['v_init'] = -65 -cfg.verbose = 0 -cfg.cvode_active = False -cfg.printRunTime = 0.1 -cfg.printPopAvgRates = True -cfg.distributeSynsUniformly = False # one syn per section in list of sections -cfg.allowSelfConns = False # allow connections from a cell to itself -cfg.allowConnsWithWeight0 = False # do not allow conns with weight 0 (faster) -cfg.oneSynPerNetcon = False # allow using the same synapse for multiple netcons - - -# ---------------------------------------------------------------------------- -# Recording -# ---------------------------------------------------------------------------- -cfg.recordTraces = {'V_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'v'}} -cfg.recordCells = [('L2Basket',0), ('L2Pyr',0), ('L5Basket',0), ('L5Pyr',0)] -cfg.recordStims = False -cfg.recordStep = 0.025 -cfg.recordDipoles = {'L2': ['L2Pyr'], 'L5': ['L5Pyr']} - -# cfg.recordLFP = [[50, 50, 50], [50, 1300, 50]] - -# ---------------------------------------------------------------------------- -# Saving -# ---------------------------------------------------------------------------- -cfg.sim_prefix = cfg.simLabel = 'default' - -cfg.saveFolder = '.' -cfg.savePickle = False -cfg.saveJson = False -cfg.saveDataInclude = ['simData', 'simConfig'] #, 'netParams', 'net'] - -# ---------------------------------------------------------------------------- -# Analysis and plotting -# ---------------------------------------------------------------------------- -pops = ['L2Basket', 'L2Pyr', 'L5Basket', 'L5Pyr'] -evprox = ['evokedProximal_1_L2Basket', 'evokedProximal_1_L2Pyr', 'evokedProximal_1_L5Basket', 'evokedProximal_1_L5Pyr', - 'evokedProximal_2_L2Basket', 'evokedProximal_2_L2Pyr', 'evokedProximal_2_L5Basket', 'evokedProximal_2_L5Pyr'] -evdist = ['evokedDistal_1_L2Basket', 'evokedDistal_1_L2Pyr', 'evokedDistal_1_L5Basket', 'evokedDistal_1_L5Pyr'] - -popColors = {'L2Basket': [0.0, 0.0, 0.0], 'L2Pyr': [0.0, 0.6, 0.0], 'L5Basket': [0.0, 0.0, 1.0], 'L5Pyr': [1.0, 0.0, 0.0], - 'Evoked proximal': [0.0, 1.0, 1.0], 'Evoked distal': [1.0, 1.0, 0.0]} - -cfg.analysis['iplotTraces'] = {'include': [('L5Pyr',0) ], 'oneFigPer': 'cell', 'saveFig': False, - 'showFig': True, 'timeRange': [0, cfg.duration]} - -cfg.analysis['iplotRaster'] = {'include': pops, 'showFig': True, 'popColors': popColors, 'markerSize': 6, 'orderInverse': True} - -cfg.analysis['iplotSpikeHist'] = {'include': [*pops, evprox, evdist, 'extRhythmicProximal', 'extRhythmicDistal'], 'legendLabels': pops + ['Evoked proximal', 'Evoked distal', 'Rhythmic proximal', 'Rhythmic distal'], 'popColors': popColors, 'yaxis': 'count', 'showFig': True} - -cfg.analysis['iplotDipole'] = {'showFig': True} - -cfg.analysis['iplotDipolePSD'] = {'showFig': True, 'maxFreq': 80} # change freq to 40 for alpha&beta tut - -cfg.analysis['iplotDipoleSpectrogram'] = {'showFig': True, 'maxFreq': 80} # change freq to 40 for alpha&beta tut - -cfg.analysis['iplotConn'] = {'includePre': pops, 'includePost': pops, 'feature': 'strength'} - -# cfg.analysis['iplotLFP'] = {'showFig': True} - -#cfg.analysis['iplotRatePSD'] = {'include': pops, 'showFig': True} - - -# ---------------------------------------------------------------------------- -# Network parameters -# ---------------------------------------------------------------------------- -cfg.gridSpacingPyr = 1 # 50 -cfg.gridSpacingBasket = [1, 1, 3] -cfg.xzScaling = 1 #100 -cfg.sizeY = 2000 - -cfg.localConn = True -cfg.rhythmicInputs = True -cfg.evokedInputs = True -cfg.tonicInputs = True -cfg.poissonInputs = True -cfg.gaussInputs = True - - -# ---------------------------------------------------------------------------- -# -# HNN original config parameters (adapted to NetPyNE) -# -# ---------------------------------------------------------------------------- - -# Params from 'ERPYes100Trials.param'; copied from cfg.__dict__ -cfg.__dict__.update({ - 'duration': 170.0, - 'tstop': 170, - 'dt': 0.05, - 'hParams': {'celsius': 37, 'v_init': -65, 'clamp_resist': 0.001}, - 'cache_efficient': False, - 'cvode_active': False, - 'cvode_atol': 0.001, - 'seeds': {'conn': 4321, 'stim': 1234, 'loc': 4321}, - 'rand123GlobalIndex': None, - 'createNEURONObj': True, - 'createPyStruct': True, - 'addSynMechs': True, - 'includeParamsLabel': True, - 'gatherOnlySimData': False, - 'compactConnFormat': False, - 'connRandomSecFromList': True, - 'distributeSynsUniformly': False, - 'pt3dRelativeToCellLocation': True, - 'invertedYCoord': True, - 'allowSelfConns': False, - 'allowConnsWithWeight0': False, - 'oneSynPerNetcon': False, - 'saveCellSecs': True, - 'saveCellConns': True, - 'timing': True, - 'saveTiming': False, - 'printRunTime': 0.1, - 'printPopAvgRates': True, - 'printSynsAfterRule': False, - 'verbose': 0, - 'recordCells': [('L2Basket', 0), ('L2Pyr', 0), ('L5Basket', 0), ('L5Pyr', 0)], - 'recordTraces': {'V_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'v'}}, - 'recordCellsSpikes': -1, - 'recordStim': False, - 'recordLFP': [], - 'recordDipoles': {'L2': ['L2Pyr'], 'L5': ['L5Pyr']}, - 'saveLFPCells': False, - 'recordStep': 0.05, - 'recordTime': True, - 'simLabel': 'default', - 'saveFolder': '.', - 'filename': './default', - 'saveDataInclude': ['simData', 'simConfig'], - 'timestampFilename': False, - 'savePickle': False, - 'saveJson': False, - 'saveMat': False, - 'saveCSV': False, - 'saveDpk': False, - 'saveHDF5': False, - 'saveDat': False, - 'backupCfgFile': [], - 'checkErrors': False, - 'checkErrorsVerbose': False, - 'recordStims': False, - 'sim_prefix': 'ERPYes100Trials', - 'gridSpacingPyr': 1, - 'gridSpacingBasket': [1, 1, 3], - 'xzScaling': 1, - 'sizeY': 2000, - 'localConn': True, - 'rhythmicInputs': True, - 'evokedInputs': True, - 'tonicInputs': True, - 'poissonInputs': True, - 'gaussInputs': True, - 'EEgain': 1.0, - 'EIgain': 1.0, - 'IEgain': 1.0, - 'IIgain': 1.0, - 'celsius': 37.0, - 'threshold': 0.0, - 'L2Pyr_soma_L': 22.1, - 'L2Pyr_soma_diam': 23.4, - 'L2Pyr_soma_cm': 0.6195, - 'L2Pyr_soma_Ra': 200.0, - 'L2Pyr_dend_cm': 0.6195, - 'L2Pyr_dend_Ra': 200.0, - 'L2Pyr_apicaltrunk_L': 59.5, - 'L2Pyr_apicaltrunk_diam': 4.25, - 'L2Pyr_apical1_L': 306.0, - 'L2Pyr_apical1_diam': 4.08, - 'L2Pyr_apicaltuft_L': 238.0, - 'L2Pyr_apicaltuft_diam': 3.4, - 'L2Pyr_apicaloblique_L': 340.0, - 'L2Pyr_apicaloblique_diam': 3.91, - 'L2Pyr_basal1_L': 85.0, - 'L2Pyr_basal1_diam': 4.25, - 'L2Pyr_basal2_L': 255.0, - 'L2Pyr_basal2_diam': 2.72, - 'L2Pyr_basal3_L': 255.0, - 'L2Pyr_basal3_diam': 2.72, - 'L2Pyr_ampa_e': 0.0, - 'L2Pyr_ampa_tau1': 0.5, - 'L2Pyr_ampa_tau2': 5.0, - 'L2Pyr_nmda_e': 0.0, - 'L2Pyr_nmda_tau1': 1.0, - 'L2Pyr_nmda_tau2': 20.0, - 'L2Pyr_gabaa_e': -80.0, - 'L2Pyr_gabaa_tau1': 0.5, - 'L2Pyr_gabaa_tau2': 5.0, - 'L2Pyr_gabab_e': -80.0, - 'L2Pyr_gabab_tau1': 1.0, - 'L2Pyr_gabab_tau2': 20.0, - 'L2Pyr_soma_gkbar_hh2': 0.01, - 'L2Pyr_soma_gnabar_hh2': 0.18, - 'L2Pyr_soma_el_hh2': -65.0, - 'L2Pyr_soma_gl_hh2': 4.26e-05, - 'L2Pyr_soma_gbar_km': 250.0, - 'L2Pyr_dend_gkbar_hh2': 0.01, - 'L2Pyr_dend_gnabar_hh2': 0.15, - 'L2Pyr_dend_el_hh2': -65.0, - 'L2Pyr_dend_gl_hh2': 4.26e-05, - 'L2Pyr_dend_gbar_km': 250.0, - 'L5Pyr_soma_L': 39.0, - 'L5Pyr_soma_diam': 28.9, - 'L5Pyr_soma_cm': 0.85, - 'L5Pyr_soma_Ra': 200.0, - 'L5Pyr_dend_cm': 0.85, - 'L5Pyr_dend_Ra': 200.0, - 'L5Pyr_apicaltrunk_L': 102.0, - 'L5Pyr_apicaltrunk_diam': 10.2, - 'L5Pyr_apical1_L': 680.0, - 'L5Pyr_apical1_diam': 7.48, - 'L5Pyr_apical2_L': 680.0, - 'L5Pyr_apical2_diam': 4.93, - 'L5Pyr_apicaltuft_L': 425.0, - 'L5Pyr_apicaltuft_diam': 3.4, - 'L5Pyr_apicaloblique_L': 255.0, - 'L5Pyr_apicaloblique_diam': 5.1, - 'L5Pyr_basal1_L': 85.0, - 'L5Pyr_basal1_diam': 6.8, - 'L5Pyr_basal2_L': 255.0, - 'L5Pyr_basal2_diam': 8.5, - 'L5Pyr_basal3_L': 255.0, - 'L5Pyr_basal3_diam': 8.5, - 'L5Pyr_ampa_e': 0.0, - 'L5Pyr_ampa_tau1': 0.5, - 'L5Pyr_ampa_tau2': 5.0, - 'L5Pyr_nmda_e': 0.0, - 'L5Pyr_nmda_tau1': 1.0, - 'L5Pyr_nmda_tau2': 20.0, - 'L5Pyr_gabaa_e': -80.0, - 'L5Pyr_gabaa_tau1': 0.5, - 'L5Pyr_gabaa_tau2': 5.0, - 'L5Pyr_gabab_e': -80.0, - 'L5Pyr_gabab_tau1': 1.0, - 'L5Pyr_gabab_tau2': 20.0, - 'L5Pyr_soma_gkbar_hh2': 0.01, - 'L5Pyr_soma_gnabar_hh2': 0.16, - 'L5Pyr_soma_el_hh2': -65.0, - 'L5Pyr_soma_gl_hh2': 4.26e-05, - 'L5Pyr_soma_gbar_ca': 60.0, - 'L5Pyr_soma_taur_cad': 20.0, - 'L5Pyr_soma_gbar_kca': 0.0002, - 'L5Pyr_soma_gbar_km': 200.0, - 'L5Pyr_soma_gbar_cat': 0.0002, - 'L5Pyr_soma_gbar_ar': 1e-06, - 'L5Pyr_dend_gkbar_hh2': 0.01, - 'L5Pyr_dend_gnabar_hh2': 0.14, - 'L5Pyr_dend_el_hh2': -71.0, - 'L5Pyr_dend_gl_hh2': 4.26e-05, - 'L5Pyr_dend_gbar_ca': 60.0, - 'L5Pyr_dend_taur_cad': 20.0, - 'L5Pyr_dend_gbar_kca': 0.0002, - 'L5Pyr_dend_gbar_km': 200.0, - 'L5Pyr_dend_gbar_cat': 0.0002, - 'L5Pyr_dend_gbar_ar': 1e-06, - 'N_pyr_x': 10, - 'N_pyr_y': 10, - 'gbar_L2Pyr_L2Pyr_ampa': 0.0005, - 'gbar_L2Pyr_L2Pyr_nmda': 0.0005, - 'gbar_L2Basket_L2Pyr_gabaa': 0.05, - 'gbar_L2Basket_L2Pyr_gabab': 0.05, - 'gbar_L2Pyr_L2Basket': 0.0005, - 'gbar_L2Basket_L2Basket': 0.02, - 'gbar_L5Pyr_L5Pyr_ampa': 0.0005, - 'gbar_L5Pyr_L5Pyr_nmda': 0.0005, - 'gbar_L2Pyr_L5Pyr': 0.00025, - 'gbar_L2Basket_L5Pyr': 0.001, - 'gbar_L5Basket_L5Pyr_gabaa': 0.025, - 'gbar_L5Basket_L5Pyr_gabab': 0.025, - 'gbar_L5Basket_L5Basket': 0.02, - 'gbar_L5Pyr_L5Basket': 0.0005, - 'gbar_L2Pyr_L5Basket': 0.00025, - 'L2Basket_Gauss_A_weight': 0.0, - 'L2Basket_Gauss_mu': 2000.0, - 'L2Basket_Gauss_sigma': 3.6, - 'L2Basket_Pois_A_weight_ampa': 0.0, - 'L2Basket_Pois_A_weight_nmda': 0.0, - 'L2Basket_Pois_lamtha': 0.0, - 'L2Pyr_Gauss_A_weight': 0.0, - 'L2Pyr_Gauss_mu': 2000.0, - 'L2Pyr_Gauss_sigma': 3.6, - 'L2Pyr_Pois_A_weight_ampa': 0.0, - 'L2Pyr_Pois_A_weight_nmda': 0.0, - 'L2Pyr_Pois_lamtha': 0.0, - 'L5Pyr_Gauss_A_weight': 0.0, - 'L5Pyr_Gauss_mu': 2000.0, - 'L5Pyr_Gauss_sigma': 4.8, - 'L5Pyr_Pois_A_weight_ampa': 0.0, - 'L5Pyr_Pois_A_weight_nmda': 0.0, - 'L5Pyr_Pois_lamtha': 0.0, - 'L5Basket_Gauss_A_weight': 0.0, - 'L5Basket_Gauss_mu': 2000.0, - 'L5Basket_Gauss_sigma': 2.0, - 'L5Basket_Pois_A_weight_ampa': 0.0, - 'L5Basket_Pois_A_weight_nmda': 0.0, - 'L5Basket_Pois_lamtha': 0.0, - 't0_pois': 0.0, - 'T_pois': -1, - 'distribution_prox': 'normal', - 't0_input_prox': 1000.0, - 'tstop_input_prox': 1001, - 'f_input_prox': 10.0, - 'f_stdev_prox': 20.0, - 'events_per_cycle_prox': 2, - 'repeats_prox': 10, - 't0_input_stdev_prox': 0.0, - 'distribution_dist': 'normal', - 't0_input_dist': 1000, - 'tstop_input_dist': 1001, - 'f_input_dist': 10.0, - 'f_stdev_dist': 20.0, - 'events_per_cycle_dist': 2, - 'repeats_dist': 10, - 't0_input_stdev_dist': 0.0, - 'input_prox_A_weight_L2Pyr_ampa': 0.0, - 'input_prox_A_weight_L2Pyr_nmda': 0.0, - 'input_prox_A_weight_L5Pyr_ampa': 0.0, - 'input_prox_A_weight_L5Pyr_nmda': 0.0, - 'input_prox_A_weight_L2Basket_ampa': 0.0, - 'input_prox_A_weight_L2Basket_nmda': 0.0, - 'input_prox_A_weight_L5Basket_ampa': 0.0, - 'input_prox_A_weight_L5Basket_nmda': 0.0, - 'input_prox_A_delay_L2': 0.1, - 'input_prox_A_delay_L5': 1.0, - 'input_dist_A_weight_L2Pyr_ampa': 0.0, - 'input_dist_A_weight_L2Pyr_nmda': 0.0, - 'input_dist_A_weight_L5Pyr_ampa': 0.0, - 'input_dist_A_weight_L5Pyr_nmda': 0.0, - 'input_dist_A_weight_L2Basket_ampa': 0.0, - 'input_dist_A_weight_L2Basket_nmda': 0.0, - 'input_dist_A_delay_L2': 5.0, - 'input_dist_A_delay_L5': 5.0, - 'dt_evprox0_evdist': (-1,), - 'dt_evprox0_evprox1': (-1,), - 'sync_evinput': 0, - 'inc_evinput': 0.0, - 'Itonic_A_L2Pyr_soma': 0.0, - 'Itonic_t0_L2Pyr_soma': 0.0, - 'Itonic_T_L2Pyr_soma': -1.0, - 'Itonic_A_L2Basket': 0.0, - 'Itonic_t0_L2Basket': 0.0, - 'Itonic_T_L2Basket': -1.0, - 'Itonic_A_L5Pyr_soma': 0.0, - 'Itonic_t0_L5Pyr_soma': 0.0, - 'Itonic_T_L5Pyr_soma': -1.0, - 'Itonic_A_L5Basket': 0.0, - 'Itonic_t0_L5Basket': 0.0, - 'Itonic_T_L5Basket': -1.0, - 'save_spec_data': 0, - 'f_max_spec': 100, - 'dipole_scalefctr': 3000, - 'dipole_smooth_win': 30, - 'save_figs': 0, - 'save_vsoma': 0, - 'N_trials': 100, - 'prng_state': None, - 'prng_seedcore_input_prox': 4, - 'prng_seedcore_input_dist': 4, - 'prng_seedcore_extpois': 4, - 'prng_seedcore_extgauss': 4, - 'expmt_groups': '{ERPYes100Trials}', - 'prng_seedcore_evprox_1': 4, - 'prng_seedcore_evdist_1': 4, - 'prng_seedcore_evprox_2': 4, - 'prng_seedcore_evdist_2': 0, - 't_evprox_1': 26.61, - 'sigma_t_evprox_1': 2.47, - 'numspikes_evprox_1': 1, - 'gbar_evprox_1_L2Pyr_ampa': 0.01525, - 'gbar_evprox_1_L2Pyr_nmda': 0.0, - 'gbar_evprox_1_L2Basket_ampa': 0.08831, - 'gbar_evprox_1_L2Basket_nmda': 0.0, - 'gbar_evprox_1_L5Pyr_ampa': 0.00865, - 'gbar_evprox_1_L5Pyr_nmda': 0.0, - 'gbar_evprox_1_L5Basket_ampa': 0.19934, - 'gbar_evprox_1_L5Basket_nmda': 0.0, - 't_evdist_1': 63.53, - 'sigma_t_evdist_1': 3.85, - 'numspikes_evdist_1': 1, - 'gbar_evdist_1_L2Pyr_ampa': 7e-06, - 'gbar_evdist_1_L2Pyr_nmda': 0.004317, - 'gbar_evdist_1_L2Basket_ampa': 0.006562, - 'gbar_evdist_1_L2Basket_nmda': 0.019482, - 'gbar_evdist_1_L5Pyr_ampa': 0.1423, - 'gbar_evdist_1_L5Pyr_nmda': 0.080074, - 't_evprox_2': 137.12, - 'sigma_t_evprox_2': 8.33, - 'numspikes_evprox_2': 1, - 'gbar_evprox_2_L2Pyr_ampa': 1.43884, - 'gbar_evprox_2_L2Pyr_nmda': 0.0, - 'gbar_evprox_2_L2Basket_ampa': 3e-06, - 'gbar_evprox_2_L2Basket_nmda': 0.0, - 'gbar_evprox_2_L5Pyr_ampa': 0.684013, - 'gbar_evprox_2_L5Pyr_nmda': 0.0, - 'gbar_evprox_2_L5Basket_ampa': 0.008958, - 'gbar_evprox_2_L5Basket_nmda': 0.0}) - - - - - - - # ---------------------------------------------------------------------------- # Cell parameters # ----------------------------------------------------------------------------