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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ jobs:
profile: minimal
toolchain: stable
override: true
- uses: actions/setup-python@v4
with:
python-version: '3.10'
Comment thread
thorstenhater marked this conversation as resolved.
- run: pip install arbor seaborn matplotlib
- run: bash bootstrap.sh
- uses: actions-rs/cargo@v1
with:
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ pretty_assertions = { version = "^1.3.0" }
serde_json = { version = "^1.0" }
serde = { version = "^1.0", features = ["derive"] }

[dev-dependencies]
tempfile = "3"

[[bin]]
name = "nmlcc"
path = "src/main.rs"
Expand Down
68 changes: 68 additions & 0 deletions tests/hay11/CaDynamics_E2_NML2.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<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_v2beta3.xsd"
id="CaDynamics_E2_NML2">

<notes>NeuroML 2 implementation of the Ca Pool mechanism</notes>

<!--<decayingPoolConcentrationModel id="CaDynamics_E2_NML2" restingConc="1e-10mol_per_cm3" decayConstant="80ms" ion="ca" shellThickness="2.787e-4cm"/>-->

<concentrationModel id="CaDynamics_E2_NML2" type="concentrationModelHayEtAl" minCai="1e-4 mM" decay="80 ms" depth="0.1 um" gamma="0.05" ion="ca"/>


<!--
This is a new, custom ComponentType to handle the calcium mechanism with parameters

PARAMETER {
gamma = 0.05 : percent of free calcium (not buffered)
decay = 80 (ms) : rate of removal of calcium
depth = 0.1 (um) : depth of shell
minCai = 1e-4 (mM)
}

and derivative mechanism:

DERIVATIVE states {
cai' = -(10000)*(ica*gamma/(2*FARADAY*depth)) - (cai - minCai)/decay
}

See https://github.com/OpenSourceBrain/L5bPyrCellHayEtAl2011/blob/master/neuroConstruct/cellMechanisms/CaDynamics_E2_init_mod/CaDynamics_E2.mod

-->


<ComponentType name="concentrationModelHayEtAl" extends="concentrationModel" description="Model of buffering of concentration of specific to Hay Et Al 2011">

<Parameter name="gamma" dimension="none"/>
<Parameter name="minCai" dimension="concentration"/>
<Parameter name="decay" dimension="time"/>
<Parameter name="depth" dimension="length"/>


<Constant name="Faraday" dimension="charge_per_mole" value="96485.3C_per_mol"/>

<Requirement name="iCa" dimension="current"/>

<Text name="species"/>

<Dynamics>

<StateVariable name="concentration" exposure="concentration" dimension="concentration"/>
<StateVariable name="extConcentration" exposure="extConcentration" dimension="concentration"/>

<DerivedVariable name="currDensCa" dimension="currentDensity" value="iCa / surfaceArea"/>

<TimeDerivative variable="concentration" value="(currDensCa * gamma/(2 * Faraday * depth)) - ((concentration - minCai) / decay)"/>

<OnStart>
<StateAssignment variable="concentration" value="initialConcentration"/>
<StateAssignment variable="extConcentration" value="initialExtConcentration"/>
</OnStart>

</Dynamics>

</ComponentType>


</neuroml>
78 changes: 78 additions & 0 deletions tests/hay11/CaDynamics_E2_NML2__decay122__gamma5_09Emin4.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
This file has been generated by neuroConstruct because a cell mechanism (NeuroML 2 Component [InstanceName: CaDynamics_E2_NML2, neuroml2File: CaDynamics_E2_NML2.nml])
has a different set of parameters (decay = 122.0, gamma = 5.09E-4) on a group of sections.

Conversion of the original NML2 file to use the updated parameters is implemented in handleExtraParamsForNml2()
in https://github.com/NeuralEnsemble/neuroConstruct/blob/master/src/ucl/physiol/neuroconstruct/neuroml/NeuroMLFileManager.java
See that file to check/improve this conversion
-->

<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_v2beta3.xsd"
id="CaDynamics_E2_NML2__decay122__gamma5_09Emin4">

<notes>NeuroML 2 implementation of the Ca Pool mechanism</notes>

<!--<decayingPoolConcentrationModel id="CaDynamics_E2_NML2__decay122__gamma5_09Emin4" restingConc="1e-10mol_per_cm3" decayConstant="80ms" ion="ca" shellThickness="2.787e-4cm"/>-->

<concentrationModel id="CaDynamics_E2_NML2__decay122__gamma5_09Emin4" type="concentrationModelHayEtAl" minCai="1e-4 mM" decay="122.0 ms" depth="0.1 um" gamma="5.09E-4 " ion="ca"/>


<!--
This is a new, custom ComponentType to handle the calcium mechanism with parameters

PARAMETER {
gamma = 0.05 : percent of free calcium (not buffered)
decay = 80 (ms) : rate of removal of calcium
depth = 0.1 (um) : depth of shell
minCai = 1e-4 (mM)
}

and derivative mechanism:

DERIVATIVE states {
cai' = -(10000)*(ica*gamma/(2*FARADAY*depth)) - (cai - minCai)/decay
}

See https://github.com/OpenSourceBrain/L5bPyrCellHayEtAl2011/blob/master/neuroConstruct/cellMechanisms/CaDynamics_E2_init_mod/CaDynamics_E2.mod

-->


<!--<ComponentType name="concentrationModelHayEtAl" extends="concentrationModel" description="Model of buffering of concentration of specific to Hay Et Al 2011">

<Parameter name="gamma" dimension="none"/>
<Parameter name="minCai" dimension="concentration"/>
<Parameter name="decay" dimension="time"/>
<Parameter name="depth" dimension="length"/>


<Constant name="Faraday" dimension="charge_per_mole" value="96485.3C_per_mol"/>

<Requirement name="iCa" dimension="current"/>

<Text name="species"/>

<Dynamics>

<StateVariable name="concentration" exposure="concentration" dimension="concentration"/>
<StateVariable name="extConcentration" exposure="extConcentration" dimension="concentration"/>

<DerivedVariable name="currDensCa" dimension="currentDensity" value="iCa / surfaceArea"/>

<TimeDerivative variable="concentration" value="(currDensCa * gamma/(2 * Faraday * depth)) - ((concentration - minCai) / decay)"/>

<OnStart>
<StateAssignment variable="concentration" value="initialConcentration"/>
<StateAssignment variable="extConcentration" value="initialExtConcentration"/>
</OnStart>

</Dynamics>

</ComponentType>-->


</neuroml>
78 changes: 78 additions & 0 deletions tests/hay11/CaDynamics_E2_NML2__decay460__gamma5_01Emin4.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
This file has been generated by neuroConstruct because a cell mechanism (NeuroML 2 Component [InstanceName: CaDynamics_E2_NML2, neuroml2File: CaDynamics_E2_NML2.nml])
has a different set of parameters (decay = 460.0, gamma = 5.01E-4) on a group of sections.

Conversion of the original NML2 file to use the updated parameters is implemented in handleExtraParamsForNml2()
in https://github.com/NeuralEnsemble/neuroConstruct/blob/master/src/ucl/physiol/neuroconstruct/neuroml/NeuroMLFileManager.java
See that file to check/improve this conversion
-->

<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_v2beta3.xsd"
id="CaDynamics_E2_NML2__decay460__gamma5_01Emin4">

<notes>NeuroML 2 implementation of the Ca Pool mechanism</notes>

<!--<decayingPoolConcentrationModel id="CaDynamics_E2_NML2__decay460__gamma5_01Emin4" restingConc="1e-10mol_per_cm3" decayConstant="80ms" ion="ca" shellThickness="2.787e-4cm"/>-->

<concentrationModel id="CaDynamics_E2_NML2__decay460__gamma5_01Emin4" type="concentrationModelHayEtAl" minCai="1e-4 mM" decay="460.0 ms" depth="0.1 um" gamma="5.01E-4 " ion="ca"/>


<!--
This is a new, custom ComponentType to handle the calcium mechanism with parameters

PARAMETER {
gamma = 0.05 : percent of free calcium (not buffered)
decay = 80 (ms) : rate of removal of calcium
depth = 0.1 (um) : depth of shell
minCai = 1e-4 (mM)
}

and derivative mechanism:

DERIVATIVE states {
cai' = -(10000)*(ica*gamma/(2*FARADAY*depth)) - (cai - minCai)/decay
}

See https://github.com/OpenSourceBrain/L5bPyrCellHayEtAl2011/blob/master/neuroConstruct/cellMechanisms/CaDynamics_E2_init_mod/CaDynamics_E2.mod

-->


<!--<ComponentType name="concentrationModelHayEtAl" extends="concentrationModel" description="Model of buffering of concentration of specific to Hay Et Al 2011">

<Parameter name="gamma" dimension="none"/>
<Parameter name="minCai" dimension="concentration"/>
<Parameter name="decay" dimension="time"/>
<Parameter name="depth" dimension="length"/>


<Constant name="Faraday" dimension="charge_per_mole" value="96485.3C_per_mol"/>

<Requirement name="iCa" dimension="current"/>

<Text name="species"/>

<Dynamics>

<StateVariable name="concentration" exposure="concentration" dimension="concentration"/>
<StateVariable name="extConcentration" exposure="extConcentration" dimension="concentration"/>

<DerivedVariable name="currDensCa" dimension="currentDensity" value="iCa / surfaceArea"/>

<TimeDerivative variable="concentration" value="(currDensCa * gamma/(2 * Faraday * depth)) - ((concentration - minCai) / decay)"/>

<OnStart>
<StateAssignment variable="concentration" value="initialConcentration"/>
<StateAssignment variable="extConcentration" value="initialExtConcentration"/>
</OnStart>

</Dynamics>

</ComponentType>-->


</neuroml>
49 changes: 49 additions & 0 deletions tests/hay11/Ca_HVA.channel.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<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_HVA">

<notes>NeuroML file containing a single Channel description</notes>

<ionChannel id="Ca_HVA" conductance="10pS" type="ionChannelHH" species="ca">

<notes>High voltage activated Ca2+ current.

Comment from original mod file:
Reuveni, Friedman, Amitai, and Gutnick, J.Neurosci. 1993</notes>

<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="Ca_HVA">

<bqmodel:isDescribedBy xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
<rdf:Bag>
<rdf:li>Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties,
Etay Hay, Sean Hill, Felix Schürmann, Henry Markram and Idan Segev, PLoS Comp Biol 2011</rdf:li>
<rdf:li rdf:resource="http://www.ncbi.nlm.nih.gov/pubmed/21829333"/>
</rdf:Bag>
</bqmodel:isDescribedBy>


<bqbiol:isVersionOf xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Bag>
<rdf:li>Calcium channels</rdf:li>
<rdf:li rdf:resource="http://senselab.med.yale.edu/neurondb/channelGene2.aspx#table1"/>
</rdf:Bag>
</bqbiol:isVersionOf>

</rdf:Description>
</rdf:RDF>
</annotation>

<gate id="m" type="gateHHrates" instances="2">
<forwardRate type="HHExpLinearRate" rate="0.209per_ms" scale="3.8mV" midpoint="-27mV"/>
<reverseRate type="HHExpRate" rate="0.94per_ms" scale="-17mV" midpoint="-75mV"/>
</gate>

<gate id="h" type="gateHHrates" instances="1">
<forwardRate type="HHExpRate" rate="0.000457per_ms" scale="-50mV" midpoint="-13mV"/>
<reverseRate type="HHSigmoidRate" rate="0.0065per_ms" scale="28mV" midpoint="-15mV"/>
</gate>

</ionChannel>

</neuroml>
76 changes: 76 additions & 0 deletions tests/hay11/Ca_LVAst.channel.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<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_LVAst">

<notes>NeuroML file containing a single Channel description</notes>

<ionChannel id="Ca_LVAst" conductance="10pS" type="ionChannelHH" species="ca">

<notes>Low voltage activated Ca2+ current

Comment from original mod file:
Note: mtau is an approximation from the plots
:Reference : : Avery and Johnston 1996, tau from Randall 1997
:Comment: shifted by -10 mv to correct for junction potential
:Comment: corrected rates using q10 = 2.3, target temperature 34, orginal 21</notes>

<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="Ca_LVAst">

<bqmodel:isDescribedBy xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
<rdf:Bag>
<rdf:li>Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties,
Etay Hay, Sean Hill, Felix Schürmann, Henry Markram and Idan Segev, PLoS Comp Biol 2011</rdf:li>
<rdf:li rdf:resource="http://www.ncbi.nlm.nih.gov/pubmed/21829333"/>
</rdf:Bag>
</bqmodel:isDescribedBy>


<bqbiol:isVersionOf xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Bag>
<rdf:li>Ca channels</rdf:li>
<rdf:li rdf:resource="http://senselab.med.yale.edu/neurondb/channelGene2.aspx#table1"/>
</rdf:Bag>
</bqbiol:isVersionOf>

</rdf:Description>
</rdf:RDF>
</annotation>

<gate id="m" type="gateHHtauInf" instances="2">
<q10Settings type="q10Fixed" fixedQ10="2.95288264"/>
<timeCourse type="Ca_LVAst_m_tau_tau"/>
<steadyState type="HHSigmoidVariable" rate="1" scale="6mV" midpoint="-40mV"/>
</gate>

<gate id="h" type="gateHHtauInf" instances="1">
<q10Settings type="q10Fixed" fixedQ10="2.95288264"/>
<timeCourse type="Ca_LVAst_h_tau_tau"/>
<steadyState type="HHSigmoidVariable" rate="1" scale="-6.4mV" midpoint="-90mV"/>
</gate>

</ionChannel>

<ComponentType name="Ca_LVAst_m_tau_tau" extends="baseVoltageDepTime">
<Constant name="TIME_SCALE" dimension="time" value="1 ms"/>
<Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>

<Dynamics>
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>
<DerivedVariable name="t" exposure="t" dimension="time" value="(5 + 20 / (1 + (exp ((V+35)/5) ))) * TIME_SCALE"/>
</Dynamics>

</ComponentType>

<ComponentType name="Ca_LVAst_h_tau_tau" extends="baseVoltageDepTime">
<Constant name="TIME_SCALE" dimension="time" value="1 ms"/>
<Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>

<Dynamics>
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>
<DerivedVariable name="t" exposure="t" dimension="time" value="(20 + 50 / (1 + (exp ((V+50)/7) ))) * TIME_SCALE"/>
</Dynamics>

</ComponentType>

</neuroml>
Loading