Skip to content

Commit

Permalink
Merge pull request #6 from OpenSourceBrain/master
Browse files Browse the repository at this point in the history
Master->dev
  • Loading branch information
pgleeson authored May 31, 2024
2 parents b044d69 + d1c86af commit d992e40
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 65 deletions.
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.
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>
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.
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>
2 changes: 1 addition & 1 deletion NeuroML2/channels/nas.channel.nml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<notes>NeuroML file containing a single ion channel</notes>
<include href="RaySigmoid.nml" />

<ionChannel id="Nas" 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
Expand Down
115 changes: 51 additions & 64 deletions NeuroML2/postprocess_cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,77 +117,64 @@ def postprocess_KC():
cell.set_specific_capacitance("1 uF_per_cm2", group_id="all")
cell.set_init_memb_potential("-80mV")

# L1 validation
# cell.validate(recursive=True)
cell.summary(morph=False, biophys=True)
# use pynml writer to also run L2 validation
write_neuroml2_file(celldoc, "KC.cell.nml")


def KC_create_na_channel():
"""Create the Na channel.
This will create the Na channel and save it to a file.
It will also validate this file.
returns: name of the created file
"""
na_channel = component_factory(
"IonChannelHH",
id="na_channel",
notes="Sodium channel for HH cell",
conductance="10pS",
species="na",
validate=False,
)
gate_m = component_factory(
"GateHHRates",
id="m",
instances="3",
notes="m gate for na channel",
validate=False,
)
m_forward_rate = component_factory(
"HHRate", type="HHExpLinearRate", rate="1per_ms", midpoint="-40mV", scale="10mV"
)
m_reverse_rate = component_factory(
"HHRate", type="HHExpRate", rate="4per_ms", midpoint="-65mV", scale="-18mV"
)

gate_m.add(m_forward_rate, hint="forward_rate", validate=False)
gate_m.add(m_reverse_rate, hint="reverse_rate")
na_channel.add(gate_m)

gate_h = component_factory(
"GateHHRates",
id="h",
instances="1",
notes="h gate for na channel",
validate=False,
cell.add_channel_density(
nml_cell_doc=celldoc,
cd_id="nas",
ion_channel="nas",
cond_density="3e-3 S_per_cm2",
erev="-58 mV",
group_id="all",
ion="na",
ion_chan_def_file="channels/nas.channel.nml",
)
h_forward_rate = component_factory(
"HHRate", type="HHExpRate", rate="0.07per_ms", midpoint="-65mV", scale="-20mV"
cell.add_channel_density(
nml_cell_doc=celldoc,
cd_id="naf",
ion_channel="naf",
cond_density="3.5e-2 S_per_cm2",
erev="-58 mV",
group_id="all",
ion="na",
ion_chan_def_file="channels/naf.channel.nml",
)
h_reverse_rate = component_factory(
"HHRate", type="HHSigmoidRate", rate="1per_ms", midpoint="-35mV", scale="10mV"
cell.add_channel_density(
nml_cell_doc=celldoc,
cd_id="kv",
ion_channel="kv",
cond_density="1.5e-3 S_per_cm2",
erev="-81 mV",
group_id="all",
ion="k",
ion_chan_def_file="channels/kv.channel.nml",
)
gate_h.add(h_forward_rate, hint="forward_rate", validate=False)
gate_h.add(h_reverse_rate, hint="reverse_rate")
na_channel.add(gate_h)

na_channel_doc = component_factory(
"NeuroMLDocument", id="na_channel", notes="Na channel for HH neuron"
cell.add_channel_density(
nml_cell_doc=celldoc,
cd_id="ka",
ion_channel="ka",
cond_density="1.4525e-2 S_per_cm2",
erev="-81 mV",
group_id="all",
ion="k",
ion_chan_def_file="channels/ka.channel.nml",
)
na_channel_fn = "HH_example_na_channel.nml"
na_channel_doc.add(na_channel)
na_channel_doc.validate(recursive=True)

write_neuroml2_file(
nml2_doc=na_channel_doc, nml2_file_name=na_channel_fn, validate=True
cell.add_channel_density(
nml_cell_doc=celldoc,
cd_id="kst",
ion_channel="kst",
cond_density="2.0275e-3 S_per_cm2",
erev="-81 mV",
group_id="all",
ion="k",
ion_chan_def_file="channels/kst.channel.nml",
)

return na_channel_fn
# L1 validation
# cell.validate(recursive=True)
cell.summary(morph=False, biophys=True)
# use pynml writer to also run L2 validation
write_neuroml2_file(celldoc, "KC.cell.nml")


if __name__ == "__main__":
postprocess_GGN()
postprocess_KC()

0 comments on commit d992e40

Please sign in to comment.