Skip to content

Commit

Permalink
Merge pull request #5 from sanjayankur31/neuroml-ankur
Browse files Browse the repository at this point in the history
Convert ion channels, KC cell
  • Loading branch information
pgleeson authored Apr 10, 2024
2 parents 7809e3d + c3bfccd commit d1c86af
Show file tree
Hide file tree
Showing 26 changed files with 286 additions and 184 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.dat
x86_64/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions NeuroML2/.test.validate.omt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Script for running automated tests on OSB using Travis-CI, see https://github.com/OpenSourceBrain/osb-model-validation
# Still in development, subject to change without notice!!


# This test will validate MOST all of the NeuroML 2 files in the current directory
target: "*.c*.nml"
engine: jNeuroML_validate
39 changes: 39 additions & 0 deletions NeuroML2/KC.cell.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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_v2.3.xsd" id="KC_doc">
<include href="channels/pas.channel.nml"/>
<include href="channels/nas.channel.nml"/>
<include href="channels/naf.channel.nml"/>
<include href="channels/kv.channel.nml"/>
<include href="channels/ka.channel.nml"/>
<include href="channels/kst.channel.nml"/>
<cell id="KC">
<morphology id="morphology">
<segment id="0" name="Seg0">
<proximal x="0.0" y="0.0" z="0.0" diameter="20.0"/>
<distal x="0.0" y="0.0" z="6.366" diameter="20.0"/>
</segment>
<segmentGroup id="soma_group" neuroLexId="GO:0043025">
<notes>Default soma segment group for the cell</notes>
<member segment="0"/>
</segmentGroup>
<segmentGroup id="all">
<notes>Default segment group for all segments in the cell</notes>
<member segment="0"/>
</segmentGroup>
</morphology>
<biophysicalProperties id="biophys">
<membraneProperties>
<channelDensity id="pas" ionChannel="pas" condDensity=".0000975 S_per_cm2" erev="-70 mV" ion="non_specific"/>
<channelDensity id="nas" ionChannel="nas" condDensity="3e-3 S_per_cm2" erev="-58 mV" ion="na"/>
<channelDensity id="naf" ionChannel="naf" condDensity="3.5e-2 S_per_cm2" erev="-58 mV" ion="na"/>
<channelDensity id="kv" ionChannel="kv" condDensity="1.5e-3 S_per_cm2" erev="-81 mV" ion="k"/>
<channelDensity id="ka" ionChannel="ka" condDensity="1.4525e-2 S_per_cm2" erev="-81 mV" ion="k"/>
<channelDensity id="kst" ionChannel="kst" condDensity="2.0275e-3 S_per_cm2" erev="-81 mV" ion="k"/>
<specificCapacitance value="1 uF_per_cm2"/>
<initMembPotential value="-80mV"/>
</membraneProperties>
<intracellularProperties>
<resistivity value="35.4 ohm_cm"/>
</intracellularProperties>
</biophysicalProperties>
</cell>
</neuroml>
42 changes: 42 additions & 0 deletions NeuroML2/channels/RaySigmoid.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?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="NeuroML_ionChannel">

<notes>NeuroML file containing variations of steady state and tau expressions for ion channels used in Ray et al 2020. These are required because in the mod files, the tables stop at 40, and so we need to tweak our implementations.</notes>

<ComponentType name="Ray_inf"
extends="baseVoltageDepVariable"
description="Inf parameter to describe naf" >

<Constant name="TIME_SCALE" dimension="time" value="1 s"/>
<Constant name="table_max" dimension="voltage" value="40 mV"/>
<Parameter name="rate" dimension="none"/>
<Parameter name="midpoint" dimension="voltage"/>
<Parameter name="scale" dimension="voltage"/>
<Dynamics>
<ConditionalDerivedVariable name="x" dimension="per_time" exposure="x">
<Case condition="v .gt. table_max" value="(rate / (1 + exp(0 - (table_max - midpoint) / scale)))/TIME_SCALE"/>
<Case value="(rate / (1 + exp(0 - (v - midpoint) / scale)))/TIME_SCALE"/>
</ConditionalDerivedVariable>
</Dynamics>
</ComponentType>

<ComponentType name="Ray_tau"
extends="baseVoltageDepTime"
description="Tau parameter to describe naf">

<Constant name="TIME_SCALE" dimension="time" value="1 ms"/>
<Constant name="table_max" dimension="voltage" value="40 mV"/>
<Parameter name="max_tau" dimension="per_time"/>
<Parameter name="min_tau" dimension="per_time"/>
<Parameter name="midpoint" dimension="voltage"/>
<Parameter name="scale" dimension="voltage"/>
<Dynamics>
<ConditionalDerivedVariable name="t" dimension="per_time" exposure="t" >
<Case condition="v .gt. table_max" value="((max_tau - min_tau) / (1 + exp(0 - (table_max - midpoint) / scale))) + min_tau"/>
<Case value="((max_tau - min_tau) / (1 + exp(0 - (v - midpoint) / scale))) + min_tau"/>
</ConditionalDerivedVariable>

</Dynamics>

</ComponentType>
</neuroml>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions NeuroML2/channels/ka.channel.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?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="NeuroML_ionChannel">

<notes>NeuroML file containing a single ion channel</notes>
<include href="RaySigmoid.nml" />

<ionChannel id="ka" conductance="1pS" type="ionChannelHH" species="k">

<notes>
Implementation of A type K+ channel ( KA ) from Wustenberg DG, Boytcheva M, Grunewald B, Byrne JH, Menzel R, Baxter DA.
This is transient A type K+ channel in Apis mellifera Kenyon cells (cultured).
</notes>

<!-- custom component types because the tables in the mod files only go to 40 -->
<gate id="m" type="gateHHtauInf" instances="3">
<steadyState type="Ray_inf" rate="1.0" midpoint="-20.1mV" scale="16.1mV"/>
<timeCourse type="Ray_ka_taum"/>
</gate>

<gate id="h" type="gateHHtauInf" instances="1">
<steadyState type="Ray_inf" rate="1.0" midpoint="-74.7mV" scale="-7.0mV"/>
<timeCourse type="Ray_ka_tauh"/>
</gate>

</ionChannel>

<ComponentType name="Ray_ka_taum"
extends="baseVoltageDepTime"
description="Tau parameter to describe ka">

<Constant name="TIME_SCALE" dimension="time" value="1 ms"/>
<Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>
<Constant name="max_tau" dimension="per_time" value="1.65 per_s"/>
<Constant name="min_tau" dimension="per_time" value="0.35 per_s"/>
<Dynamics>
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>
<ConditionalDerivedVariable name="t" dimension="per_time" exposure="t" >
<Case condition="V .gt. 40" value="(max_tau - min_tau) / ((1 + exp(-(40. + 70.0) / 4.0)) * ( 1 + exp((40. + 2.0) / 12.0))) + min_tau"/>
<Case value="(max_tau - min_tau) / ((1 + exp(-(V + 70.0) / 4.0)) * ( 1 + exp((V + 2.0) / 12.0))) + min_tau"/>

</ConditionalDerivedVariable>
</Dynamics>

</ComponentType>

<ComponentType name="Ray_ka_tauh"
extends="baseVoltageDepTime"
description="Tau parameter to describe ka">

<Constant name="TIME_SCALE" dimension="time" value="1 ms"/>
<Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>
<Constant name="max_tau" dimension="per_time" value="90.0 per_s"/>
<Constant name="min_tau" dimension="per_time" value="2.5 per_s"/>
<Dynamics>
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>
<ConditionalDerivedVariable name="t" dimension="per_time" exposure="t" >
<Case condition="V .gt. 40" value="(max_tau - min_tau) / ((1 + exp(-(40. + 60.) / 25.0)) * (1 + exp((40. + 62.0) / 16.0))) + min_tau"/>
<Case value="(max_tau - min_tau) / ((1 + exp(-(V + 60.) / 25.0)) * (1 + exp((V + 62.0) / 16.0))) + min_tau"/>
</ConditionalDerivedVariable>

</Dynamics>

</ComponentType>

</neuroml>
25 changes: 25 additions & 0 deletions NeuroML2/channels/kst.channel.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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="NeuroML_ionChannel">

<notes>NeuroML file containing a single ion channel</notes>
<include href="RaySigmoid.nml" />

<ionChannel id="kst" conductance="1pS" type="ionChannelHH" species="k">

<notes>
NEURON implementation of slow transient K+ channel ( KST ) from Wustenberg DG, Boytcheva M, Grunewald B, Byrne JH, Menzel R, Baxter DA

This is slow transient K+ channel in Apis mellifera Kenyon cells (cultured).
</notes>

<gate id="m" type="gateHHtauInf" instances="3">
<steadyState type="Ray_inf" rate="1" midpoint="-20.1mV" scale="16.1mV"/>
<timeCourse type="Ray_tau" min_tau="0.5 per_s" max_tau="5.0 per_s" midpoint="20.0 mV" scale="-20.0mV"/>
</gate>

<gate id="h" type="gateHHtauInf" instances="1">
<steadyState type="Ray_inf" rate="1" midpoint="-74.7mV" scale="-7.0mV"/>
<timeCourse type="Ray_tau" min_tau="150.0 per_s" max_tau="200.0 per_s" midpoint="52.0 mV" scale="-15.0mV"/>
</gate>
</ionChannel>
</neuroml>
21 changes: 21 additions & 0 deletions NeuroML2/channels/kv.channel.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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="NeuroML_ionChannel">

<notes>NeuroML file containing a single ion channel</notes>
<include href="RaySigmoid.nml" />

<ionChannel id="kv" conductance="1pS" type="ionChannelHH" species="k">

<notes>
Implementation of A type K+ channel ( KV ) from Wustenberg DG, Boytcheva M, Grunewald B, Byrne JH, Menzel R, Baxter DA.
This is a delayed rectifier type K+ channel in Apis mellifera Kenyon cells (cultured).
</notes>

<!-- custom component types because the tables in the mod files only go to 40 -->
<gate id="m" type="gateHHtauInf" instances="4">
<steadyState type="Ray_inf" rate="1.0" midpoint="-37.6mV" scale="27.24mV"/>
<timeCourse type="Ray_tau" min_tau="1.85 per_s" max_tau="3.53 per_s" midpoint="45.0 mV" scale="-13.71mV"/>
</gate>

</ionChannel>
</neuroml>
26 changes: 26 additions & 0 deletions NeuroML2/channels/naf.channel.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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="NeuroML_ionChannel">

<notes>NeuroML file containing a single ion channel</notes>
<include href="RaySigmoid.nml" />

<ionChannel id="naf" conductance="1pS" type="ionChannelHH" species="na">

<notes>
Implementation of fast Na+ channel ( NAF ) from Wustenberg DG, Boytcheva M, Grunewald B, Byrne JH, Menzel R, Baxter DA

This is fast Na+ channel in Apis mellifera Kenyon cells :(cultured).
</notes>

<gate id="m" type="gateHHtauInf" instances="3">
<steadyState type="Ray_inf" rate="1.0" midpoint="-30.1mV" scale="6.65mV"/>
<timeCourse type="Ray_tau" min_tau="0.83 per_s" max_tau="0.093 per_s" midpoint="-20.3 mV" scale="6.45mV"/>
</gate>

<gate id="h" type="gateHHtauInf" instances="1">
<steadyState type="Ray_inf" rate="1.0" midpoint="-51.4mV" scale="-5.9mV"/>
<timeCourse type="Ray_tau" min_tau="0.12 per_s" max_tau="1.660 per_s" midpoint="-8.03 mV" scale="-8.69mV"/>
</gate>

</ionChannel>
</neuroml>
128 changes: 8 additions & 120 deletions NeuroML2/channels/nas.channel.nml
Original file line number Diff line number Diff line change
Expand Up @@ -2,136 +2,24 @@
<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="NeuroML_ionChannel">

<notes>NeuroML file containing a single ion channel</notes>
<include href="RaySigmoid.nml" />

<ionChannel id="Navp" conductance="1pS" type="ionChannelHH" species="na">
<ionChannel id="nas" conductance="1pS" type="ionChannelHH" species="na">

<notes>
Implementation of slow Na+ channel ( NAS ) from Wustenberg DG, Boytcheva M, Grunewald B, Byrne JH, Menzel R, Baxter DA

This is slow Na+ channel in Apis mellifera Kenyon cells :(cultured).
</notes>

<gate id="m" type="gateHHratesTau" instances="3">
<forwardRate type="HHExpLinearRate" rate="1per_ms" midpoint="-30.1mV" scale="6.65mV"/>
<timeCourse type="Ray_nas_taum"/>
<gate id="m" type="gateHHtauInf" instances="3">
<steadyState type="Ray_inf" rate="1" midpoint="-30.1mV" scale="6.65mV"/>
<timeCourse type="Ray_tau" min_tau="0.83 per_s" max_tau="0.093 per_s" midpoint="-20.3 mV" scale="6.45mV"/>
</gate>

<gate id="h" type="gateHHratesTau" instances="1">
<forwardRate type="HHExpLinearRate" rate="1per_ms" midpoint="-51.4mV" scale="5.9mV"/>
<timeCourse type="Ray_nas_tauh"/>
<gate id="h" type="gateHHtauInf" instances="1">
<steadyState type="Ray_inf" rate="1" midpoint="-51.4mV" scale="-5.9mV"/>
<timeCourse type="Ray_tau" min_tau="1.9 per_s" max_tau="12.24 per_s" midpoint="-32.6 mV" scale="-8.0mV"/>
</gate>

</ionChannel>

<ComponentType name="Ray_nas_taum"
extends="baseVoltageDepTime"
description="Tau parameter to describe Navp">

<Constant name="TIME_SCALE" dimension="time" value="1 ms"/>
<Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>
<Constant name="max_tau" dimension="per_time" value="0.83 per_time"/>
<Constant name="min_tau" dimension="per_time" value="0.093 per_time"/>
<Dynamics>
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>
<ConditionalDerivedVariable name="t" dimension="time" exposure="t">
<Case condition="(ALPHA + BETA) .eq. 0" value="( 0 ) * TIME_SCALE"/>
<Case condition="1/( (ALPHA + BETA) * rateScale ) .lt. ( 0.02 )" value="( (0.02 * rateScale) ) * TIME_SCALE"/>
<Case value="( 1/(ALPHA + BETA) ) * TIME_SCALE"/>
</ConditionalDerivedVariable>

</Dynamics>

</ComponentType>

<ComponentType name="Ray_nas_tauh"
extends="baseVoltageDepTime"
description="Tau parameter to describe Navp">

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

<Requirement name="alpha" dimension="per_time"/>
<Requirement name="beta" dimension="per_time"/>
<Requirement name="rateScale" dimension="none"/>

<Dynamics>
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>
<DerivedVariable name="ALPHA" dimension="none" value="alpha * TIME_SCALE"/>
<DerivedVariable name="BETA" dimension="none" value="beta * TIME_SCALE"/>

<ConditionalDerivedVariable name="t" exposure="t" dimension="time">
<Case condition="(ALPHA + BETA) .eq. 0" value="( 0 ) * TIME_SCALE"/>
<Case condition="1/( (ALPHA + BETA) * rateScale ) .lt. ( 0.5 )" value="( (0.5 * rateScale) ) * TIME_SCALE"/>
<Case value="( 1/(ALPHA + BETA) ) * TIME_SCALE"/>
</ConditionalDerivedVariable>

</Dynamics>

</ComponentType>

<ComponentType name="Ray_nas_taus"
extends="baseVoltageDepTime"
description="Tau parameter to describe Navp">

<Constant name="TIME_SCALE" dimension="time" value="1 ms"/>
<Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>
<Constant name="TEMP_SCALE" dimension="temperature" value="1 K"/>
<Constant name="R" dimension="none" value="8.315"/>
<Constant name="F" dimension="none" value="96480"/>

<Requirement name="rateScale" dimension="none"/>
<Requirement name="temperature" dimension="temperature"/>

<Dynamics>
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>
<DerivedVariable name="T" dimension="none" value="temperature / TEMP_SCALE"/>

<DerivedVariable name="alpha" dimension="none" value="exp((1e-3*12*(V+45)*F) / (R*(T+0.01)))"/> <!-- NEURON code: 273.16 + celsius-->
<DerivedVariable name="beta" dimension="none" value="exp((1e-3*12*0.2*(V+45)*F) / (R*(T+0.01)))"/> <!-- NEURON code: 273.16 + celsius-->

<DerivedVariable name="tmp" value="beta / (3e-4*(1 + alpha))" dimension="none"/>
<ConditionalDerivedVariable name="t" dimension="time" exposure="t" >
<Case condition="(tmp / rateScale) .lt. 10" value="10 * rateScale * TIME_SCALE"/>
<Case value="tmp * TIME_SCALE"/>
</ConditionalDerivedVariable>

</Dynamics>

</ComponentType>

<ComponentType name="Ray_nas_sss_ar2_1"
extends="baseVoltageDepVariable"
description="steadyState parameter to describe Navp">

<Constant name="no_inact" dimension="none" value="1"/> <!-- 1: no inact, 0: max inact-->
<Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>

<Dynamics>
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>

<DerivedVariable name="alpha" dimension="none" value="1 / (1 + exp((V+43)/2))"/>

<DerivedVariable name="x" exposure="x" dimension="none" value="alpha + no_inact*(1 - alpha)"/>
</Dynamics>

</ComponentType>


<ComponentType name="Ray_nas_sss_ar2_0_8"
extends="baseVoltageDepVariable"
description="steadyState parameter to describe Navp">

<Constant name="no_inact" dimension="none" value="0.8"/> <!-- 1: no inact, 0: max inact-->
<Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>

<Dynamics>
<DerivedVariable name="V" dimension="none" value="v / VOLT_SCALE"/>

<DerivedVariable name="alpha" dimension="none" value="1 / (1 + exp((V+43)/2))"/>

<DerivedVariable name="x" exposure="x" dimension="none" value="alpha + no_inact*(1 - alpha)"/>
</Dynamics>

</ComponentType>

</neuroml>
Loading

0 comments on commit d1c86af

Please sign in to comment.