Skip to content

Commit e8ebab9

Browse files
committed
Add nmllite generation
1 parent 1686dd5 commit e8ebab9

File tree

9 files changed

+594
-0
lines changed

9 files changed

+594
-0
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,15 @@
1010
/Tutorial/*.dat
1111
/Tutorial/x86_64
1212
/Tutorial/simulator.props
13+
*.gv*
14+
/NeuroML2/IClamp_PassiveCell.json
15+
/NeuroML2/IClamp_PassiveCell.net.nml
16+
report.Sim_IClamp_PassiveCell.txt
17+
report*.txt
18+
/NeuroML2/IClamp_cADpyr229_L23_PC_5ecbf9b163_0_0.net.nml
19+
/NeuroML2/IClamp_pyr_4_sym.json
20+
/NeuroML2/IClamp_pyr_4_sym.net.nml
21+
/NeuroML2/LEMS_Sim_IClamp_PassiveCell.xml
22+
/NeuroML2/LEMS_Sim_IClamp_cADpyr229_L23_PC_5ecbf9b163_0_0.xml
23+
/NeuroML2/LEMS_Sim_IClamp_pyr_4_sym.xml
24+
/NeuroML2/Sim_IClamp_pyr_4_sym.json

NeuroML2/Ca_conc.nml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2beta4.xsd" id="Ca_conc">
3+
4+
<notes>NeuroML file describing intracellular Calcium dynamics, from the Hippocampal CA3 neuron model presented in Traub et al., 1991.</notes>
5+
6+
<fixedFactorConcentrationModel id="Ca_conc" restingConc="0.0mM" decayConstant="0.1s" ion="ca" rho="9543.150099999999mol_per_m_per_A_per_s"/>
7+
8+
</neuroml>

NeuroML2/Ca_pyr.channel.nml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2beta4.xsd" id="Ca_pyr">
3+
4+
<notes>NeuroML file containing a single Calcium Channel description, from the Hippocampal CA3 neuron model presented in Traub et al., 1991.</notes>
5+
6+
<ionChannel id="Ca_pyr" conductance="10pS" type="ionChannelHH" species="ca">
7+
8+
<notes>NeuroML file containing a single Calcium Channel description, from the Hippocampal CA3 neuron model presented in Traub et al., 1991.</notes>
9+
10+
<annotation>
11+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12+
<rdf:Description rdf:about="Ca_pyr">
13+
14+
<bqmodel:isDescribedBy xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
15+
<rdf:Bag>
16+
<rdf:li>Traub, R. D., Wong, R. K., Miles, R., and Michelson, H. (1991). A model of a CA3 hippocampal pyramidal neuron incorporating voltage-clamp data on intrinsic conductances. Journal of neurophysiology, 66(2), 635-50.</rdf:li>
17+
<rdf:li rdf:resource="http://www.ncbi.nlm.nih.gov/pubmed/1663538"/>
18+
</rdf:Bag>
19+
</bqmodel:isDescribedBy>
20+
21+
22+
<bqbiol:isVersionOf xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
23+
<rdf:Bag>
24+
<rdf:li>Ca channels</rdf:li>
25+
<rdf:li rdf:resource="http://senselab.med.yale.edu/neurondb/NeuronProp.aspx?id=259&amp;mo=1&amp;re=&amp;pr=C"/>
26+
</rdf:Bag>
27+
</bqbiol:isVersionOf>
28+
29+
</rdf:Description>
30+
</rdf:RDF>
31+
</annotation>
32+
33+
<gate id="m" type="gateHHrates" instances="2">
34+
<forwardRate type="HHSigmoidRate" rate="1.6e3per_s" scale="0.01389V" midpoint="5e-03V"/>
35+
<reverseRate type="HHExpLinearRate" rate="1e2per_s" scale="-0.005V" midpoint="-8.9e-3V"/>
36+
</gate>
37+
38+
<gate id="h" type="gateHHtauInf" instances="1">
39+
<timeCourse type="Ca_pyr_h_tau_tau"/>
40+
<steadyState type="Ca_pyr_h_inf_inf"/>
41+
</gate>
42+
43+
</ionChannel>
44+
45+
<ComponentType name="Ca_pyr_h_tau_tau" extends="baseVoltageDepTime">
46+
<Constant name="TIME_SCALE" dimension="time" value="1 s"/>
47+
<Constant name="VOLT_SCALE" dimension="voltage" value="1 V"/>
48+
49+
<Dynamics>
50+
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>
51+
<DerivedVariable name="t" exposure="t" dimension="time" value="(0.2) * TIME_SCALE"/>
52+
</Dynamics>
53+
54+
</ComponentType>
55+
56+
<ComponentType name="Ca_pyr_h_inf_inf" extends="baseVoltageDepVariable">
57+
<Constant name="TIME_SCALE" dimension="time" value="1 s"/>
58+
<Constant name="VOLT_SCALE" dimension="voltage" value="1 V"/>
59+
60+
<Dynamics>
61+
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>
62+
<ConditionalDerivedVariable name="x" exposure="x" dimension="none">
63+
<Case condition="V .gt. ( -0.06 )" value=" (exp (-50*(V + 0.06))) "/>
64+
<Case value=" 1"/>
65+
</ConditionalDerivedVariable>
66+
</Dynamics>
67+
68+
</ComponentType>
69+
70+
</neuroml>

NeuroML2/GenerateExamples.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
from neuromllite import *
2+
from neuromllite.NetworkGenerator import *
3+
from neuromllite.utils import create_new_model
4+
import sys
5+
6+
sys.path.append("..")
7+
8+
colors = {'PassiveCell':'0 0 0.8', 'cADpyr229_L23_PC_5ecbf9b163_0_0':'0.8 0 0', 'pyr_4_sym':'0 0 0.8', 'IB':'0.8 0 0', 'IBR':'0.8 0 0'}
9+
10+
def generate(cell, duration, config='IClamp'):
11+
12+
reference = "%s_%s"%(config, cell)
13+
14+
cell_id = '%s'%cell
15+
cell_nmll = Cell(id=cell_id, neuroml2_source_file='%s.cell.nml'%(cell))
16+
17+
################################################################################
18+
### Add some inputs
19+
20+
if 'IClamp' in config:
21+
parameters = {}
22+
parameters['stim_amp'] = '350pA'
23+
parameters['stim_delay'] = '100ms'
24+
parameters['stim_dur'] = '500ms'
25+
input_source = InputSource(id='iclamp_0',
26+
neuroml2_input='PulseGenerator',
27+
parameters={'amplitude':'stim_amp', 'delay':'stim_delay', 'duration':'stim_dur'})
28+
29+
30+
else:
31+
32+
parameters = {}
33+
parameters['average_rate'] = '100 Hz'
34+
parameters['number_per_cell'] = '10'
35+
input_source = InputSource(id='pfs0',
36+
neuroml2_input='PoissonFiringSynapse',
37+
parameters={'average_rate':'average_rate',
38+
'synapse':syn_exc.id,
39+
'spike_target':"./%s"%syn_exc.id})
40+
41+
sim, net = create_new_model(reference,
42+
duration,
43+
dt=0.01, # ms
44+
temperature=34, # degC
45+
default_region='Cortex',
46+
parameters = parameters,
47+
cell_for_default_population=cell_nmll,
48+
color_for_default_population=colors[cell],
49+
input_for_default_population=input_source)
50+
51+
sim.recordVariables={'2/v':{'all':'*'}}
52+
'''
53+
sim.recordVariables={'biophys/membraneProperties/Na_all/Na/m/q':{'all':'*'},
54+
'biophys/membraneProperties/Na_all/Na/h/q':{'all':'*'},
55+
'biophys/membraneProperties/Kd_all/Kd/n/q':{'all':'*'}}
56+
57+
if cell != 'FS':
58+
sim.recordVariables['biophys/membraneProperties/IM_all/IM/p/q']={'all':'*'}
59+
60+
if cell == 'IB' or cell == 'IBR':
61+
sim.recordVariables['biophys/membraneProperties/IL_all/IL/q/q']={'all':'*'}
62+
sim.recordVariables['biophys/membraneProperties/IL_all/IL/r/q']={'all':'*'}
63+
64+
if cell == 'LTS':
65+
sim.recordVariables['biophys/membraneProperties/IT_all/IT/s/q']={'all':'*'}
66+
sim.recordVariables['biophys/membraneProperties/IT_all/IT/u/q']={'all':'*'}'''
67+
68+
sim.to_json_file()
69+
70+
return sim, net
71+
72+
73+
74+
if __name__ == "__main__":
75+
76+
if '-all' in sys.argv:
77+
for cell in colors:
78+
generate('PassiveCell', 700, config="IClamp")
79+
generate('pyr_4_sym', 700, config="IClamp")
80+
generate('cADpyr229_L23_PC_5ecbf9b163_0_0', 700, config="IClamp")
81+
82+
83+
else:
84+
#generate('IFcurve_PV')
85+
#generate('olm')
86+
sim, net = generate('pyr_4_sym', 700, config="IClamp")
87+
#generate('olm', 1000, config="PoissonFiringSynapse")
88+
#generate('bistratified')
89+
#generate('IClamp_Pyr')
90+
91+
check_to_generate_or_run(sys.argv, sim)
92+

NeuroML2/Kahp_pyr.channel.nml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2beta4.xsd" id="Kahp_pyr">
3+
4+
<notes>NeuroML file containing a single Calcium-dependent Potassium Channel description, from the Hippocampal CA3 neuron model presented in Traub et al., 1991.</notes>
5+
6+
<ionChannel id="Kahp_pyr" conductance="10pS" type="ionChannelHH" species="k">
7+
8+
<notes>NeuroML file containing a single Calcium-dependent Potassium Channel description, from the Hippocampal CA3 neuron model presented in Traub et al., 1991.</notes>
9+
10+
<annotation>
11+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12+
<rdf:Description rdf:about="Kahp_pyr">
13+
14+
<bqmodel:isDescribedBy xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
15+
<rdf:Bag>
16+
<rdf:li>Traub, R. D., Wong, R. K., Miles, R., and Michelson, H. (1991). A model of a CA3 hippocampal pyramidal neuron incorporating voltage-clamp data on intrinsic conductances. Journal of neurophysiology, 66(2), 635-50.</rdf:li>
17+
<rdf:li rdf:resource="http://www.ncbi.nlm.nih.gov/pubmed/1663538"/>
18+
</rdf:Bag>
19+
</bqmodel:isDescribedBy>
20+
21+
22+
<bqbiol:isVersionOf xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
23+
<rdf:Bag>
24+
<rdf:li>K channels</rdf:li>
25+
<rdf:li rdf:resource="http://senselab.med.yale.edu/neurondb/NeuronProp.aspx?id=259&amp;mo=1&amp;re=&amp;pr=C"/>
26+
</rdf:Bag>
27+
</bqbiol:isVersionOf>
28+
29+
</rdf:Description>
30+
</rdf:RDF>
31+
</annotation>
32+
33+
<gate id="z" type="gateHHrates" instances="1">
34+
<forwardRate type="Kahp_pyr_z_alpha_rate"/>
35+
<reverseRate type="Kahp_pyr_z_beta_rate"/>
36+
</gate>
37+
38+
</ionChannel>
39+
40+
<ComponentType name="Kahp_pyr_z_alpha_rate" extends="baseVoltageConcDepRate">
41+
<Constant name="TIME_SCALE" dimension="time" value="1 s"/>
42+
<Constant name="VOLT_SCALE" dimension="voltage" value="1 V"/>
43+
<Constant name="CONC_SCALE" dimension="concentration" value="1 mM"/>
44+
45+
<Dynamics>
46+
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>
47+
<DerivedVariable name="ca_conc" dimension="none" value="caConc / CONC_SCALE"/>
48+
<ConditionalDerivedVariable name="r" exposure="r" dimension="per_time">
49+
<Case condition="ca_conc .lt. ( 500.0 )" value="( 0.4 * ca_conc ) / TIME_SCALE"/>
50+
<Case value="( 200) / TIME_SCALE"/>
51+
</ConditionalDerivedVariable>
52+
</Dynamics>
53+
54+
</ComponentType>
55+
56+
<ComponentType name="Kahp_pyr_z_beta_rate" extends="baseVoltageConcDepRate">
57+
<Constant name="TIME_SCALE" dimension="time" value="1 s"/>
58+
<Constant name="VOLT_SCALE" dimension="voltage" value="1 V"/>
59+
<Constant name="CONC_SCALE" dimension="concentration" value="1 mM"/>
60+
61+
<Dynamics>
62+
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>
63+
<DerivedVariable name="ca_conc" dimension="none" value="caConc / CONC_SCALE"/>
64+
<DerivedVariable name="r" exposure="r" dimension="per_time" value="(20) / TIME_SCALE"/>
65+
</Dynamics>
66+
67+
</ComponentType>
68+
69+
</neuroml>

NeuroML2/Kdr_pyr.channel.nml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2beta4.xsd" id="Kdr_pyr">
3+
4+
<notes>NeuroML file containing a single Potassium Channel description, from the Hippocampal CA3 neuron model presented in Traub et al., 1991.</notes>
5+
6+
<ionChannel id="Kdr_pyr" conductance="10pS" type="ionChannelHH" species="k">
7+
8+
<notes>NeuroML file containing a single Potassium Channel description, from the Hippocampal CA3 neuron model presented in Traub et al., 1991.</notes>
9+
10+
<annotation>
11+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12+
<rdf:Description rdf:about="Kdr_pyr">
13+
14+
<bqmodel:isDescribedBy xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
15+
<rdf:Bag>
16+
<rdf:li>Traub, R. D., Wong, R. K., Miles, R., and Michelson, H. (1991). A model of a CA3 hippocampal pyramidal neuron incorporating voltage-clamp data on intrinsic conductances. Journal of neurophysiology, 66(2), 635-50.</rdf:li>
17+
<rdf:li rdf:resource="http://www.ncbi.nlm.nih.gov/pubmed/1663538"/>
18+
</rdf:Bag>
19+
</bqmodel:isDescribedBy>
20+
21+
22+
<bqbiol:isVersionOf xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
23+
<rdf:Bag>
24+
<rdf:li>K channels</rdf:li>
25+
<rdf:li rdf:resource="http://senselab.med.yale.edu/neurondb/NeuronProp.aspx?id=259&amp;mo=1&amp;re=&amp;pr=C"/>
26+
</rdf:Bag>
27+
</bqbiol:isVersionOf>
28+
29+
</rdf:Description>
30+
</rdf:RDF>
31+
</annotation>
32+
33+
<gate id="n" type="gateHHrates" instances="1">
34+
<forwardRate type="HHExpLinearRate" rate="40per_s" scale="0.005V" midpoint="-2.49e-2V"/>
35+
<reverseRate type="HHExpRate" rate="125per_s" scale="-0.04V" midpoint="-4e-2V"/>
36+
</gate>
37+
38+
</ionChannel>
39+
40+
</neuroml>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2beta4.xsd" id="LeakConductance_pyr">
3+
4+
<notes>NeuroML file containing a single Channel description</notes>
5+
6+
<ionChannel id="LeakConductance_pyr" conductance="10pS" type="ionChannelPassive">
7+
8+
<notes>Passive conductance for pyramidal cell</notes>
9+
10+
</ionChannel>
11+
12+
</neuroml>

NeuroML2/Na_pyr.channel.nml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2beta4.xsd" id="Na_pyr">
3+
4+
<notes>NeuroML file containing a single Sodium Channel description, from the Hippocampal CA3 neuron model presented in Traub et al., 1991.</notes>
5+
6+
<ionChannel id="Na_pyr" conductance="10pS" type="ionChannelHH" species="na">
7+
8+
<notes>NeuroML file containing a single Sodium Channel description, from the Hippocampal CA3 neuron model presented in Traub et al., 1991.</notes>
9+
10+
<annotation>
11+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12+
<rdf:Description rdf:about="Na_pyr">
13+
14+
<bqmodel:isDescribedBy xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
15+
<rdf:Bag>
16+
<rdf:li>Traub, R. D., Wong, R. K., Miles, R., and Michelson, H. (1991). A model of a CA3 hippocampal pyramidal neuron incorporating voltage-clamp data on intrinsic conductances. Journal of neurophysiology, 66(2), 635-50.</rdf:li>
17+
<rdf:li rdf:resource="http://www.ncbi.nlm.nih.gov/pubmed/1663538"/>
18+
</rdf:Bag>
19+
</bqmodel:isDescribedBy>
20+
21+
22+
<bqbiol:isVersionOf xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
23+
<rdf:Bag>
24+
<rdf:li>Na channels</rdf:li>
25+
<rdf:li rdf:resource="http://senselab.med.yale.edu/neurondb/NeuronProp.aspx?id=259&amp;mo=1&amp;re=&amp;pr=C"/>
26+
</rdf:Bag>
27+
</bqbiol:isVersionOf>
28+
29+
</rdf:Description>
30+
</rdf:RDF>
31+
</annotation>
32+
33+
<gate id="m" type="gateHHrates" instances="2">
34+
<forwardRate type="HHExpLinearRate" rate="1.28e3per_s" scale="0.004V" midpoint="-4.69e-2V"/>
35+
<reverseRate type="HHExpLinearRate" rate="1.4e3per_s" scale="-0.005V" midpoint="-19.9e-3V"/>
36+
</gate>
37+
38+
<gate id="h" type="gateHHrates" instances="1">
39+
<forwardRate type="HHExpRate" rate="1.28e2per_s" scale="-0.018V" midpoint="-4.3e-2V"/>
40+
<reverseRate type="HHSigmoidRate" rate="4e3per_s" scale="0.005V" midpoint="-2e-2V"/>
41+
</gate>
42+
43+
</ionChannel>
44+
45+
</neuroml>

0 commit comments

Comments
 (0)