Skip to content

Commit

Permalink
Fixed issue with AWC volume
Browse files Browse the repository at this point in the history
  • Loading branch information
pgleeson committed May 22, 2024
1 parent 1a72b69 commit cbd2054
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 43 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ arm64
/NeuroML2/log
/LEMS_RMD.xml
/report.txt
/NeuroML2/Test_AWCon.ode
38 changes: 19 additions & 19 deletions NeuroML2/AWCon.cell.nml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<morphology id="morphology">
<segment id="0" name="soma">
<proximal x="0.0" y="0.0" z="0.0" diameter="1.7841242"/>
<distal x="0.0" y="2.26" z="0.0" diameter="1.7841242"/>
<distal x="0.0" y="12.463998828476363" z="0.0" diameter="1.7841242"/>
</segment>
<segmentGroup id="soma_group" neuroLexId="GO:0043025">
<notes>Default soma segment group for the cell</notes>
Expand All @@ -35,28 +35,28 @@
</morphology>
<biophysicalProperties id="biophys">
<membraneProperties>
<channelDensity id="leak_chans" ionChannel="AWCon_leak" condDensity="21.314756138163613 S_per_m2" erev="-80.0mV" ion="non_specific"/>
<channelDensity id="nca_chans" ionChannel="AWCon_nca" condDensity="4.34189476888518 S_per_m2" erev="30.0mV" ion="non_specific"/>
<channelDensity id="shal_chans" ionChannel="AWCon_shal" condDensity="228.93626963212768 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="kvs1_chans" ionChannel="AWCon_kvs1" condDensity="63.15483300196626 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="shak_chans" ionChannel="AWCon_shak" condDensity="7.8943541252457825 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="kqt3_chans" ionChannel="AWCon_kqt3" condDensity="43.4189476888518 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="egl2_chans" ionChannel="AWCon_egl2" condDensity="67.10201006458915 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="kir_chans" ionChannel="AWCon_kir" condDensity="51.313301814097585 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="unc2_chans" ionChannel="AWCon_unc2" condDensity="78.94354125245782 S_per_m2" erev="60.0mV" ion="ca"/>
<channelDensity id="egl19_chans" ionChannel="AWCon_egl19" condDensity="122.36248894130962 S_per_m2" erev="60.0mV" ion="ca"/>
<channelDensity id="cca_chans" ionChannel="AWCon_cca" condDensity="55.26047887672047 S_per_m2" erev="60.0mV" ion="ca"/>
<channelDensity id="bk_chans" ionChannel="AWCon_bk" condDensity="8.68378953777036 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="slo1_chans" ionChannel="AWCon_slo1" condDensity="8.68378953777036 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="bk2_chans" ionChannel="AWCon_bk2" condDensity="7.8943541252457825 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="slo2_chans" ionChannel="AWCon_slo2" condDensity="7.8943541252457825 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="sk_chans" ionChannel="AWCon_sk" condDensity="4.736612475147469 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="leak_chans" ionChannel="AWCon_leak" condDensity="3.8648390083440307 S_per_m2" erev="-80.0mV" ion="non_specific"/>
<channelDensity id="nca_chans" ionChannel="AWCon_nca" condDensity="0.7872820202182285 S_per_m2" erev="30.0mV" ion="non_specific"/>
<channelDensity id="shal_chans" ionChannel="AWCon_shal" condDensity="41.51123379332477 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="kvs1_chans" ionChannel="AWCon_kvs1" condDensity="11.45137483953787 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="shak_chans" ionChannel="AWCon_shak" condDensity="1.4314218549422337 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="kqt3_chans" ionChannel="AWCon_kqt3" condDensity="7.872820202182285 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="egl2_chans" ionChannel="AWCon_egl2" condDensity="12.167085767008984 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="kir_chans" ionChannel="AWCon_kir" condDensity="9.304242057124519 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="unc2_chans" ionChannel="AWCon_unc2" condDensity="14.314218549422336 S_per_m2" erev="60.0mV" ion="ca"/>
<channelDensity id="egl19_chans" ionChannel="AWCon_egl19" condDensity="22.18703875160462 S_per_m2" erev="60.0mV" ion="ca"/>
<channelDensity id="cca_chans" ionChannel="AWCon_cca" condDensity="10.019952984595633 S_per_m2" erev="60.0mV" ion="ca"/>
<channelDensity id="bk_chans" ionChannel="AWCon_bk" condDensity="1.574564040436457 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="slo1_chans" ionChannel="AWCon_slo1" condDensity="1.574564040436457 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="bk2_chans" ionChannel="AWCon_bk2" condDensity="1.4314218549422337 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="slo2_chans" ionChannel="AWCon_slo2" condDensity="1.4314218549422337 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="sk_chans" ionChannel="AWCon_sk" condDensity="0.8588531129653401 S_per_m2" erev="-80.0mV" ion="k"/>
<spikeThresh value="0mV"/>
<specificCapacitance value="0.24472497788261924 F_per_m2"/>
<specificCapacitance value="0.04437407750320924 F_per_m2"/>
<initMembPotential value="-70mV"/>
</membraneProperties>
<intracellularProperties>
<species id="ca" concentrationModel="CaDynamics" ion="ca" initialConcentration="5e-5 mM" initialExtConcentration="2 mM"/>
<species id="ca" concentrationModel="CaDynamics_AWCon" ion="ca" initialConcentration="5e-5 mM" initialExtConcentration="2 mM"/>
<resistivity value="0.1 kohm_cm"/>
</intracellularProperties>
</biophysicalProperties>
Expand Down
4 changes: 3 additions & 1 deletion NeuroML2/CaDynamics.nml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

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

<concentrationModel id="CaDynamics" type="concentrationModelNicolettiEtAl" backgr2="5e-5 mM" t_ca="50 ms" fca="0.001" ion="ca" vol="5.65 um3"/>
<concentrationModel id="CaDynamics_RMD" type="concentrationModelNicolettiEtAl" backgr2="5e-5 mM" t_ca="50 ms" fca="0.001" ion="ca" vol="5.65 um3"/>

<concentrationModel id="CaDynamics_AWCon" type="concentrationModelNicolettiEtAl" backgr2="5e-5 mM" t_ca="50 ms" fca="0.001" ion="ca" vol="31.16 um3"/>

<ComponentType name="concentrationModelNicolettiEtAl" extends="concentrationModel" description="Model of internal [Ca2+] specific to Nicoletti Et Al 2019">

Expand Down
15 changes: 10 additions & 5 deletions NeuroML2/GenerateNeuroML.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from neuroml import IncludeType
import sympy
from sympy.parsing.sympy_parser import parse_expr
import math


xpps = {"RMD": parse_script("../RMD.ode"), "AWCon": parse_script("../AWC.ode")}
Expand Down Expand Up @@ -422,8 +423,11 @@ def create_cells(channels_to_include, duration=700, stim_delay=310, stim_duratio
cell = cell_doc.add(
"Cell", id=cell_id, notes="%s cell from Nicoletti et al. 2019" % cell_id
)
diam = 1.7841242 # Gives a convenient surface area of ?? um^2
length = 2.26 # Gives a convenient surface area of ?? um^2
volume_um3 = xpps[cell_id]["parameters"]["vol"]
diam = 1.7841242
end_area = math.pi * diam * diam / 4
length = volume_um3 / end_area
surface_area_curved = length * math.pi * diam
cell.add_segment(
prox=[0, 0, 0, diam],
dist=[0, length, 0, diam],
Expand All @@ -433,7 +437,7 @@ def create_cells(channels_to_include, duration=700, stim_delay=310, stim_duratio
seg_type="soma",
)

density_factor = 1000 / 12.66728074437459
density_factor = 1000 / surface_area_curved

# Leak channel
if "leak" in channels_to_include:
Expand Down Expand Up @@ -1119,7 +1123,7 @@ def create_cells(channels_to_include, duration=700, stim_delay=310, stim_duratio

cell.set_specific_capacitance(
"%s F_per_m2"
% (float(xpps[cell_id]["parameters"]["c"]) / 12.66728074437459)
% (float(xpps[cell_id]["parameters"]["c"]) / surface_area_curved)
)

cell.add_membrane_property("SpikeThresh", value="0mV")
Expand All @@ -1134,7 +1138,7 @@ def create_cells(channels_to_include, duration=700, stim_delay=310, stim_duratio
"Species",
id="ca",
ion="ca",
concentration_model="CaDynamics",
concentration_model="CaDynamics_%s" % cell_id,
initial_concentration="5e-5 mM",
initial_ext_concentration="2 mM",
)
Expand Down Expand Up @@ -1217,6 +1221,7 @@ def create_cells(channels_to_include, duration=700, stim_delay=310, stim_duratio
channels_to_include = ["leak", "kvs1"]
channels_to_include = ["leak", "kqt3"]
channels_to_include = ["leak", "egl2"]
channels_to_include = ["leak", "kir", "cca", "ca"]
channels_to_include = [
"leak",
"nca",
Expand Down
34 changes: 17 additions & 17 deletions NeuroML2/RMD.cell.nml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<morphology id="morphology">
<segment id="0" name="soma">
<proximal x="0.0" y="0.0" z="0.0" diameter="1.7841242"/>
<distal x="0.0" y="2.26" z="0.0" diameter="1.7841242"/>
<distal x="0.0" y="2.259999787576748" z="0.0" diameter="1.7841242"/>
</segment>
<segmentGroup id="soma_group" neuroLexId="GO:0043025">
<notes>Default soma segment group for the cell</notes>
Expand All @@ -33,26 +33,26 @@
</morphology>
<biophysicalProperties id="biophys">
<membraneProperties>
<channelDensity id="leak_chans" ionChannel="RMD_leak" condDensity="31.57741650098313 S_per_m2" erev="-80.0mV" ion="non_specific"/>
<channelDensity id="nca_chans" ionChannel="RMD_nca" condDensity="3.9471770626228913 S_per_m2" erev="30.0mV" ion="non_specific"/>
<channelDensity id="shal_chans" ionChannel="RMD_shal" condDensity="195.7799823060954 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="shak_chans" ionChannel="RMD_shak" condDensity="86.8378953777036 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="egl36_chans" ionChannel="RMD_egl36" condDensity="102.62660362819517 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="kir_chans" ionChannel="RMD_kir" condDensity="15.788708250491565 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="unc2_chans" ionChannel="RMD_unc2" condDensity="71.04918712721204 S_per_m2" erev="60.0mV" ion="ca"/>
<channelDensity id="egl19_chans" ionChannel="RMD_egl19" condDensity="78.15410583993324 S_per_m2" erev="60.0mV" ion="ca"/>
<channelDensity id="cca_chans" ionChannel="RMD_cca" condDensity="244.72497788261924 S_per_m2" erev="60.0mV" ion="ca"/>
<channelDensity id="bk_chans" ionChannel="RMD_bk" condDensity="23.683062375737347 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="slo1_chans" ionChannel="RMD_slo1" condDensity="23.683062375737347 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="bk2_chans" ionChannel="RMD_bk2" condDensity="23.683062375737347 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="slo2_chans" ionChannel="RMD_slo2" condDensity="23.683062375737347 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="sk_chans" ionChannel="RMD_sk" condDensity="4.736612475147469 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="leak_chans" ionChannel="RMD_leak" condDensity="31.57741946902654 S_per_m2" erev="-80.0mV" ion="non_specific"/>
<channelDensity id="nca_chans" ionChannel="RMD_nca" condDensity="3.9471774336283176 S_per_m2" erev="30.0mV" ion="non_specific"/>
<channelDensity id="shal_chans" ionChannel="RMD_shal" condDensity="195.78000070796455 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="shak_chans" ionChannel="RMD_shak" condDensity="86.83790353982299 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="egl36_chans" ionChannel="RMD_egl36" condDensity="102.62661327433626 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="kir_chans" ionChannel="RMD_kir" condDensity="15.78870973451327 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="unc2_chans" ionChannel="RMD_unc2" condDensity="71.04919380530971 S_per_m2" erev="60.0mV" ion="ca"/>
<channelDensity id="egl19_chans" ionChannel="RMD_egl19" condDensity="78.15411318584069 S_per_m2" erev="60.0mV" ion="ca"/>
<channelDensity id="cca_chans" ionChannel="RMD_cca" condDensity="244.7250008849557 S_per_m2" erev="60.0mV" ion="ca"/>
<channelDensity id="bk_chans" ionChannel="RMD_bk" condDensity="23.683064601769903 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="slo1_chans" ionChannel="RMD_slo1" condDensity="23.683064601769903 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="bk2_chans" ionChannel="RMD_bk2" condDensity="23.683064601769903 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="slo2_chans" ionChannel="RMD_slo2" condDensity="23.683064601769903 S_per_m2" erev="-80.0mV" ion="k"/>
<channelDensity id="sk_chans" ionChannel="RMD_sk" condDensity="4.736612920353981 S_per_m2" erev="-80.0mV" ion="k"/>
<spikeThresh value="0mV"/>
<specificCapacitance value="0.09473224950294937 F_per_m2"/>
<specificCapacitance value="0.09473225840707962 F_per_m2"/>
<initMembPotential value="-70mV"/>
</membraneProperties>
<intracellularProperties>
<species id="ca" concentrationModel="CaDynamics" ion="ca" initialConcentration="5e-5 mM" initialExtConcentration="2 mM"/>
<species id="ca" concentrationModel="CaDynamics_RMD" ion="ca" initialConcentration="5e-5 mM" initialExtConcentration="2 mM"/>
<resistivity value="0.1 kohm_cm"/>
</intracellularProperties>
</biophysicalProperties>
Expand Down
9 changes: 8 additions & 1 deletion NeuroML2/TestXPP.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from pprint import pprint

cell = "RMD"
cell = "AWCon"
cell = "RMD"

parsed_data = parse_script("../%s.ode" % cell.replace("on", ""))
pprint(parsed_data)
Expand Down Expand Up @@ -76,6 +76,7 @@
channels_to_include = ["leak"]
channels_to_include = ["leak", "kqt3"]
channels_to_include = ["leak", "egl2"]
channels_to_include = ["leak", "kir", "cca", "ca"]
channels_to_include = [
"leak",
"nca",
Expand Down Expand Up @@ -158,6 +159,12 @@
["kqt3", "s", "s_kqt3"],
["kqt3", "w", "w_kqt3"],
]
'''
chans = [
["kir", "m", "m_kir"],
["cca", "m", "m_cca1"],
["cca", "h", "h_cca1"],] '''


plot_separately = {mp_fig: "v", ca_fig: "ca_intra1"}

Expand Down

0 comments on commit cbd2054

Please sign in to comment.