diff --git a/LICENSE.lesser b/LICENSE.lesser index 341c30bd..65c5ca88 100644 --- a/LICENSE.lesser +++ b/LICENSE.lesser @@ -163,4 +163,3 @@ whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - diff --git a/README.md b/README.md index 3765c912..553adf7d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ A single package in Python unifying scripts and modules for reading, writing, si Builds on: [libNeuroML](https://github.com/NeuralEnsemble/libNeuroML) & [PyLEMS](https://github.com/LEMS/pylems) and wraps functionality from [jNeuroML](https://github.com/NeuroML/jNeuroML). -Installation +Installation ------------ ### Dependencies diff --git a/docs/source/_static/pynml_jnml.svg b/docs/source/_static/pynml_jnml.svg index 2cef3dd4..83ac4d90 100644 --- a/docs/source/_static/pynml_jnml.svg +++ b/docs/source/_static/pynml_jnml.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/docs/source/pyneuroml.analysis.rst b/docs/source/pyneuroml.analysis.rst index fb0bc350..1b80fab7 100644 --- a/docs/source/pyneuroml.analysis.rst +++ b/docs/source/pyneuroml.analysis.rst @@ -29,4 +29,3 @@ pyneuroml.analysis.ChannelHelper module :members: :undoc-members: :show-inheritance: - diff --git a/docs/source/pyneuroml.channelml.rst b/docs/source/pyneuroml.channelml.rst index eb3a7a30..3683601f 100644 --- a/docs/source/pyneuroml.channelml.rst +++ b/docs/source/pyneuroml.channelml.rst @@ -5,4 +5,3 @@ pyneuroml.channelml package :members: :undoc-members: :show-inheritance: - diff --git a/docs/source/pyneuroml.neuron.rst b/docs/source/pyneuroml.neuron.rst index 24b2808a..691b683f 100644 --- a/docs/source/pyneuroml.neuron.rst +++ b/docs/source/pyneuroml.neuron.rst @@ -13,4 +13,3 @@ pyneuroml.neuron.analysis module :members: :undoc-members: :show-inheritance: - diff --git a/docs/source/pyneuroml.povray.rst b/docs/source/pyneuroml.povray.rst index 4a78cc28..2df0c901 100644 --- a/docs/source/pyneuroml.povray.rst +++ b/docs/source/pyneuroml.povray.rst @@ -29,4 +29,3 @@ pyneuroml.povray.OverlaySimulation module :members: :undoc-members: :show-inheritance: - diff --git a/docs/source/refs.bib b/docs/source/refs.bib index 0eba5e03..d6e55e0b 100644 --- a/docs/source/refs.bib +++ b/docs/source/refs.bib @@ -20,4 +20,3 @@ @Article{Vella2014 timestamp = {2019-02-20}, year = {2014}, } - diff --git a/examples/IM.channel.nml b/examples/IM.channel.nml index 7a79e341..354adec6 100644 --- a/examples/IM.channel.nml +++ b/examples/IM.channel.nml @@ -6,25 +6,25 @@ Slow M-type K+ current for spike frequency adaptation - + Comment from original mod file: M-current, responsible for the adaptation of firing rate and the afterhyperpolarization (AHP) of cortical pyramidal cells First-order model described by hodgkin-Hyxley like equations. K+ current, activated by depolarization, noninactivating. -Model taken from Yamada, W.M., Koch, C. and Adams, P.R. Multiple channels and calcium dynamics. In: Methods in Neuronal Modeling, +Model taken from Yamada, W.M., Koch, C. and Adams, P.R. Multiple channels and calcium dynamics. In: Methods in Neuronal Modeling, edited by C. Koch and I. Segev, MIT press, 1989, p 97-134. - -See also: McCormick, D.A., Wang, Z. and Huguenard, J. Neurotransmitter control of neocortical neuronal activity and excitability. + +See also: McCormick, D.A., Wang, Z. and Huguenard, J. Neurotransmitter control of neocortical neuronal activity and excitability. Cerebral Cortex 3: 387-398, 1993. Written by Alain Destexhe, Laval University, 1995 - + - + Minimal Hodgkin-Huxley type models for different classes of cortical and thalamic neurons @@ -32,7 +32,7 @@ Written by Alain Destexhe, Laval University, 1995 - + K channels @@ -48,7 +48,7 @@ Written by Alain Destexhe, Laval University, 1995 - + diff --git a/examples/KConductance.channel.nml b/examples/KConductance.channel.nml index 008ec9da..1d7f046d 100644 --- a/examples/KConductance.channel.nml +++ b/examples/KConductance.channel.nml @@ -1,7 +1,7 @@ - Channel file containing a single channel description @@ -9,11 +9,11 @@ HH K Channel - + - + A. L. Hodgkin and A. F. Huxley, A quantitative description of membrane current and its application @@ -22,7 +22,7 @@ - + K channels @@ -38,7 +38,7 @@ - + diff --git a/examples/Kd.channel.nml b/examples/Kd.channel.nml index 426a004e..0ebfb5d0 100644 --- a/examples/Kd.channel.nml +++ b/examples/Kd.channel.nml @@ -6,7 +6,7 @@ Delayed rectifier K+ current based on Traub and Miles 1991. - + Comment from original mod file: Hippocampal HH channels Fast Na+ and K+ currents responsible for action potentials Iterative equations @@ -16,11 +16,11 @@ Equations modified by Traub, for Hippocampal Pyramidal cells, in: Traub and Mile - range variable vtraub adjust threshold - Written by Alain Destexhe, Salk Institute, Aug 1992 - Modified Oct 96 for compatibility with Windows: trap low values of arguments - + - + Minimal Hodgkin-Huxley type models for different classes of cortical and thalamic neurons @@ -28,7 +28,7 @@ Equations modified by Traub, for Hippocampal Pyramidal cells, in: Traub and Mile - + K channels @@ -44,7 +44,7 @@ Equations modified by Traub, for Hippocampal Pyramidal cells, in: Traub and Mile - + diff --git a/examples/LEMS_NML2_Ex5_DetCell.xml b/examples/LEMS_NML2_Ex5_DetCell.xml index 2a6b681b..504f123d 100644 --- a/examples/LEMS_NML2_Ex5_DetCell.xml +++ b/examples/LEMS_NML2_Ex5_DetCell.xml @@ -3,8 +3,8 @@ @@ -23,7 +23,7 @@ - + @@ -42,20 +42,20 @@ - - + + - - - + + + - - - - - - + + + + + + - \ No newline at end of file + diff --git a/examples/LEMS_NML2_Ex9_FN.xml b/examples/LEMS_NML2_Ex9_FN.xml index 2ca5f070..65dc3802 100644 --- a/examples/LEMS_NML2_Ex9_FN.xml +++ b/examples/LEMS_NML2_Ex9_FN.xml @@ -2,15 +2,15 @@ - @@ -41,13 +41,13 @@ - + - - - + + + - \ No newline at end of file + diff --git a/examples/LeakConductance.channel.nml b/examples/LeakConductance.channel.nml index 08a45def..aad5c5a6 100644 --- a/examples/LeakConductance.channel.nml +++ b/examples/LeakConductance.channel.nml @@ -1,7 +1,7 @@ - Channel file containing a single Channel description diff --git a/examples/LeakConductance.mod b/examples/LeakConductance.mod index b2eb98ce..fe34375b 100644 --- a/examples/LeakConductance.mod +++ b/examples/LeakConductance.mod @@ -13,7 +13,7 @@ NEURON { SUFFIX LeakConductance NONSPECIFIC_CURRENT i RANGE e - + RANGE gion RANGE i__LeakConductance : a copy of the variable for current which makes it easier to access from outside the mod file RANGE gmax : Will be changed when ion channel mechanism placed on cell! @@ -22,11 +22,11 @@ NEURON { RANGE fopen : exposure RANGE conductanceScale : derived variable RANGE fopen0 : derived variable - + } UNITS { - + (nA) = (nanoamp) (uA) = (microamp) (mA) = (milliamp) @@ -42,18 +42,18 @@ UNITS { (umol) = (micromole) (pC) = (picocoulomb) (S) = (siemens) - + } PARAMETER { - + gmax = 0 (S/cm2) : Will be changed when ion channel mechanism placed on cell! - + conductance = 1.0E-5 (uS) : was: 1.0E-11 (conductance) } ASSIGNED { - + gion (S/cm2) : Transient conductance density of the channel? Standard Assigned variables with ionChannel v (mV) celsius (degC) @@ -61,52 +61,51 @@ ASSIGNED { e (mV) i (mA/cm2) i__LeakConductance (mA/cm2) - + conductanceScale : derived variable fopen0 : derived variable fopen : derived variable g (uS) : derived variable - + } STATE { - + } INITIAL { temperature = celsius + 273.15 - + rates() rates() ? To ensure correct initialisation. - + } BREAKPOINT { - + rates() ? DerivedVariable is based on path: conductanceScaling[*]/factor, on: Component(id=LeakConductance type=ionChannelHH), from conductanceScaling; null ? Path not present in component, using factor: 1 - - conductanceScale = 1 - + + conductanceScale = 1 + ? DerivedVariable is based on path: gates[*]/fcond, on: Component(id=LeakConductance type=ionChannelHH), from gates; null ? Path not present in component, using factor: 1 - - fopen0 = 1 - + + fopen0 = 1 + fopen = conductanceScale * fopen0 ? evaluable g = conductance * fopen ? evaluable - gion = gmax * fopen - + gion = gmax * fopen + i = gion * (v - e) i__LeakConductance = -1 * i : set this variable to the current also - note -1 as channel current convention for LEMS used! - + } PROCEDURE rates() { - - - - -} + + + +} diff --git a/examples/NML2_SingleCompHHCell.nml b/examples/NML2_SingleCompHHCell.nml index e25e859d..225aa8ab 100644 --- a/examples/NML2_SingleCompHHCell.nml +++ b/examples/NML2_SingleCompHHCell.nml @@ -1,19 +1,19 @@ - - - - - + + + + - - + + @@ -33,7 +33,7 @@ - + @@ -61,4 +61,3 @@ - diff --git a/examples/NaConductance.channel.nml b/examples/NaConductance.channel.nml index adbac6cd..42d24501 100644 --- a/examples/NaConductance.channel.nml +++ b/examples/NaConductance.channel.nml @@ -1,7 +1,7 @@ - Channel file containing a single Channel description @@ -9,20 +9,20 @@ HH Na Channel - + - + - A. L. Hodgkin and A. F. Huxley, A quantitative description of membrane current and + A. L. Hodgkin and A. F. Huxley, A quantitative description of membrane current and its application to conduction and excitation in nerve, J. Physiol., vol. 117, pp. 500-544, 1952. - + Na channels @@ -43,7 +43,7 @@ - + diff --git a/examples/NaConductance2.mod b/examples/NaConductance2.mod index 85a08e59..7343424f 100644 --- a/examples/NaConductance2.mod +++ b/examples/NaConductance2.mod @@ -1,7 +1,7 @@ COMMENT ************************************************** - File generated by: neuroConstruct v1.2.3 + File generated by: neuroConstruct v1.2.3 ************************************************** @@ -34,165 +34,165 @@ UNITS { } - + NEURON { - + SUFFIX NaConductance2 USEION na READ ena WRITE ina VALENCE 1 ? reversal potential of ion is read, outgoing current is written - - + + RANGE gmax, gion - + RANGE minf, mtau - + RANGE hinf, htau - + } -PARAMETER { - +PARAMETER { + gmax = 0.12 (S/cm2) ? default value, should be overwritten when conductance placed on cell - + } ASSIGNED { - + v (mV) - + celsius (degC) - + ? Reversal potential of na ena (mV) ? The outward flow of ion: na calculated by rate equations... ina (mA/cm2) - - + + gion (S/cm2) minf mtau (ms) hinf htau (ms) - + } -BREAKPOINT { - +BREAKPOINT { + SOLVE states METHOD cnexp - - gion = gmax*((m)^3)*((h)^1) + + gion = gmax*((m)^3)*((h)^1) ina = gion*(v - ena) - + } INITIAL { - + ena = 50 - + rates(v) m = minf - + h = hinf - - - + + + } - + STATE { m h - + } DERIVATIVE states { rates(v) m' = (minf - m)/mtau h' = (hinf - h)/htau - + } -PROCEDURE rates(v(mV)) { - +PROCEDURE rates(v(mV)) { + ? Note: not all of these may be used, depending on the form of rate equations LOCAL alpha, beta, tau, inf, gamma, zeta, temp_adj_m, A_alpha_m, B_alpha_m, Vhalf_alpha_m, A_beta_m, B_beta_m, Vhalf_beta_m, temp_adj_h, A_alpha_h, B_alpha_h, Vhalf_alpha_h, A_beta_h, B_beta_h, Vhalf_beta_h - + TABLE minf, mtau,hinf, htau DEPEND celsius FROM -100 TO 100 WITH 400 - - + + UNITSOFF temp_adj_m = 1 temp_adj_h = 1 - - - - - + + + + + ? *** Adding rate equations for gate: m *** - + ? Found a parameterised form of rate equation for alpha, using expression: A*((v-Vhalf)/B) / (1 - exp(-((v-Vhalf)/B))) A_alpha_m = 1 B_alpha_m = 10 - Vhalf_alpha_m = -40 + Vhalf_alpha_m = -40 alpha = A_alpha_m * vtrap((v - Vhalf_alpha_m), B_alpha_m) - - + + ? Found a parameterised form of rate equation for beta, using expression: A*exp((v-Vhalf)/B) A_beta_m = 4 B_beta_m = -18 - Vhalf_beta_m = -65 + Vhalf_beta_m = -65 beta = A_beta_m * exp((v - Vhalf_beta_m) / B_beta_m) - + mtau = 1/(temp_adj_m*(alpha + beta)) minf = alpha/(alpha + beta) - - - + + + ? *** Finished rate equations for gate: m *** - - - - - - + + + + + + ? *** Adding rate equations for gate: h *** - + ? Found a parameterised form of rate equation for alpha, using expression: A*exp((v-Vhalf)/B) A_alpha_h = 0.07 B_alpha_h = -20 - Vhalf_alpha_h = -65 + Vhalf_alpha_h = -65 alpha = A_alpha_h * exp((v - Vhalf_alpha_h) / B_alpha_h) - - + + ? Found a parameterised form of rate equation for beta, using expression: A / (1 + exp((v-Vhalf)/B)) A_beta_h = 1 B_beta_h = -10 - Vhalf_beta_h = -35 + Vhalf_beta_h = -35 beta = A_beta_h / (exp((v - Vhalf_beta_h) / B_beta_h) + 1) - + htau = 1/(temp_adj_h*(alpha + beta)) hinf = alpha/(alpha + beta) - - - + + + ? *** Finished rate equations for gate: h *** - - + + } @@ -208,5 +208,3 @@ FUNCTION vtrap(VminV0, B) { } UNITSON - - diff --git a/examples/analyseNaMod.sh b/examples/analyseNaMod.sh index c862fcb5..12428dcf 100755 --- a/examples/analyseNaMod.sh +++ b/examples/analyseNaMod.sh @@ -1,5 +1,5 @@ pynml-modchananalysis -stepV 5 NaConductance2 -dt 0.01 -temperature 22 # Uses https://github.com/NeuralEnsemble/neuroConstruct/blob/master/nCplot.sh -ncpl -b NaConductance2.m.tau.dat NaConductance2.h.tau.dat test/mtau_NaConductance.dat test/htau_NaConductance.dat & +ncpl -b NaConductance2.m.tau.dat NaConductance2.h.tau.dat test/mtau_NaConductance.dat test/htau_NaConductance.dat & ncpl -b NaConductance2.m.inf.dat NaConductance2.h.inf.dat test/minf_NaConductance.dat test/hinf_NaConductance.dat & diff --git a/examples/test.hoc b/examples/test.hoc index 97b1ef87..60d6b280 100644 --- a/examples/test.hoc +++ b/examples/test.hoc @@ -37,5 +37,3 @@ mainDendSec { forall insert pas forall psection() - - diff --git a/examples/test_data/Ca_pyr.channel.nml b/examples/test_data/Ca_pyr.channel.nml index abc098e6..e732923e 100644 --- a/examples/test_data/Ca_pyr.channel.nml +++ b/examples/test_data/Ca_pyr.channel.nml @@ -6,11 +6,11 @@ NeuroML file containing a single Calcium Channel description, from the Hippocampal CA3 neuron model presented in Traub et al., 1991. - + - + 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. @@ -18,7 +18,7 @@ - + Ca channels @@ -39,7 +39,7 @@ - + diff --git a/examples/test_data/EGL-36.channel.nml b/examples/test_data/EGL-36.channel.nml index 06684229..e3c07937 100644 --- a/examples/test_data/EGL-36.channel.nml +++ b/examples/test_data/EGL-36.channel.nml @@ -1,6 +1,6 @@ - + @@ -12,7 +12,7 @@ - diff --git a/examples/test_data/HHCellNetwork.net.nml b/examples/test_data/HHCellNetwork.net.nml index 94ac0a9e..604054a1 100644 --- a/examples/test_data/HHCellNetwork.net.nml +++ b/examples/test_data/HHCellNetwork.net.nml @@ -2,11 +2,11 @@ Network of 1 cell with Hodgkin Huxley cell and 2 input currents - + @@ -18,4 +18,3 @@ - diff --git a/examples/test_data/Kahp_pyr.channel.nml b/examples/test_data/Kahp_pyr.channel.nml index 5b214c90..8cabba46 100644 --- a/examples/test_data/Kahp_pyr.channel.nml +++ b/examples/test_data/Kahp_pyr.channel.nml @@ -6,11 +6,11 @@ NeuroML file containing a single Calcium-dependent Potassium Channel description, from the Hippocampal CA3 neuron model presented in Traub et al., 1991. - + - + 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. @@ -18,7 +18,7 @@ - + K channels @@ -34,7 +34,7 @@ - + diff --git a/examples/test_data/Kdr_bask.channel.nml b/examples/test_data/Kdr_bask.channel.nml index dcee4730..557ab64c 100644 --- a/examples/test_data/Kdr_bask.channel.nml +++ b/examples/test_data/Kdr_bask.channel.nml @@ -6,11 +6,11 @@ NeuroML file containing a single Potassium Channel description, from the book Neuronal Networks of the Hippocampus, Traub and Miles 1991 - + - + Traub, R. D., & Miles, R. (1991). Neuronal Networks of the Hippocampus. Cambridge University Press. @@ -18,7 +18,7 @@ - + K channels @@ -34,7 +34,7 @@ - + diff --git a/examples/test_data/Kdr_pyr.channel.nml b/examples/test_data/Kdr_pyr.channel.nml index f89ac54c..2d8d1be9 100644 --- a/examples/test_data/Kdr_pyr.channel.nml +++ b/examples/test_data/Kdr_pyr.channel.nml @@ -6,11 +6,11 @@ NeuroML file containing a single Potassium Channel description, from the Hippocampal CA3 neuron model presented in Traub et al., 1991. - + - + 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. @@ -18,7 +18,7 @@ - + K channels @@ -34,7 +34,7 @@ - + diff --git a/examples/test_data/LEMS_HH_Simulation.xml b/examples/test_data/LEMS_HH_Simulation.xml index 75ca8718..3ffb943c 100644 --- a/examples/test_data/LEMS_HH_Simulation.xml +++ b/examples/test_data/LEMS_HH_Simulation.xml @@ -3,8 +3,8 @@ @@ -23,19 +23,19 @@ - + - + - - - - + + + + - \ No newline at end of file + diff --git a/examples/test_data/LeakConductance_bask.channel.nml b/examples/test_data/LeakConductance_bask.channel.nml index b5d5b563..c3560079 100644 --- a/examples/test_data/LeakConductance_bask.channel.nml +++ b/examples/test_data/LeakConductance_bask.channel.nml @@ -6,7 +6,7 @@ Passive conductance for basket cell - + diff --git a/examples/test_data/LeakConductance_pyr.channel.nml b/examples/test_data/LeakConductance_pyr.channel.nml index 843dcca8..4d36edd3 100644 --- a/examples/test_data/LeakConductance_pyr.channel.nml +++ b/examples/test_data/LeakConductance_pyr.channel.nml @@ -6,7 +6,7 @@ Passive conductance for pyramidal cell - + diff --git a/examples/test_data/NML2_FullCell.nml b/examples/test_data/NML2_FullCell.nml index fffc74f5..4ab6a84c 100644 --- a/examples/test_data/NML2_FullCell.nml +++ b/examples/test_data/NML2_FullCell.nml @@ -5,19 +5,19 @@ xmlns:xi="http://www.w3.org/2001/XInclude" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 ../Schemas/NeuroML2/NeuroML_v2beta4.xsd" id="NML2_FullCell"> - + - + - + - + A Simple Spiking cell for testing purposes @@ -54,7 +54,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/examples/test_data/NML2_SimpleIonChannel.nml b/examples/test_data/NML2_SimpleIonChannel.nml index 83864f42..a7cfcaa0 100644 --- a/examples/test_data/NML2_SimpleIonChannel.nml +++ b/examples/test_data/NML2_SimpleIonChannel.nml @@ -3,10 +3,10 @@ + id="NML2_SimpleIonChannel"> - + diff --git a/examples/test_data/Na_bask.channel.nml b/examples/test_data/Na_bask.channel.nml index 932d4155..11ab3a65 100644 --- a/examples/test_data/Na_bask.channel.nml +++ b/examples/test_data/Na_bask.channel.nml @@ -6,11 +6,11 @@ NeuroML file containing a single Sodium Channel description, from the book Neuronal Networks of the Hippocampus, Traub and Miles 1991 - + - + Traub, R. D., & Miles, R. (1991). Neuronal Networks of the Hippocampus. Cambridge University Press. @@ -18,7 +18,7 @@ - + Na channels @@ -39,7 +39,7 @@ - + diff --git a/examples/test_data/Na_pyr.channel.nml b/examples/test_data/Na_pyr.channel.nml index 7702bed8..5e1d251c 100644 --- a/examples/test_data/Na_pyr.channel.nml +++ b/examples/test_data/Na_pyr.channel.nml @@ -6,11 +6,11 @@ NeuroML file containing a single Sodium Channel description, from the Hippocampal CA3 neuron model presented in Traub et al., 1991. - + - + 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. @@ -18,7 +18,7 @@ - + Na channels @@ -39,7 +39,7 @@ - + diff --git a/examples/test_data/Purk2M9s.nml b/examples/test_data/Purk2M9s.nml index 511ab43e..ecf4d680 100644 --- a/examples/test_data/Purk2M9s.nml +++ b/examples/test_data/Purk2M9s.nml @@ -20825,10 +20825,10 @@ - + - + diff --git a/examples/test_data/TwoCell.net.nml b/examples/test_data/TwoCell.net.nml index 5b597dfc..695ef328 100644 --- a/examples/test_data/TwoCell.net.nml +++ b/examples/test_data/TwoCell.net.nml @@ -48,7 +48,7 @@ Cell Group: baskets contains 1 cells - + diff --git a/examples/test_data/bask.cell.nml b/examples/test_data/bask.cell.nml index b82ab581..74d0f895 100644 --- a/examples/test_data/bask.cell.nml +++ b/examples/test_data/bask.cell.nml @@ -26,7 +26,7 @@ @@ -34,7 +34,7 @@ @@ -55,7 +55,7 @@ - + @@ -63,13 +63,13 @@ - + - + - + - + @@ -88,5 +88,5 @@ - + diff --git a/examples/test_data/ca1/LEMS_SimTestOLMChannels.xml b/examples/test_data/ca1/LEMS_SimTestOLMChannels.xml index 83b6f6a4..94206351 100644 --- a/examples/test_data/ca1/LEMS_SimTestOLMChannels.xml +++ b/examples/test_data/ca1/LEMS_SimTestOLMChannels.xml @@ -1,11 +1,11 @@ - - - + @@ -13,7 +13,7 @@ - + @@ -21,9 +21,9 @@ - + - + @@ -58,7 +58,7 @@ - + @@ -69,146 +69,146 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/examples/test_data/ca1/channels/HCNolm.channel.nml b/examples/test_data/ca1/channels/HCNolm.channel.nml index 8e6ccbc6..e197dd6e 100755 --- a/examples/test_data/ca1/channels/HCNolm.channel.nml +++ b/examples/test_data/ca1/channels/HCNolm.channel.nml @@ -4,21 +4,21 @@ NeuroML file containing a single ion channel - + Hyperpolarization-activated, CN-gated h channel description (from Saraga 2003, Lawrence 2006 and Cutsuridis 2010) - + - + - - + + - + diff --git a/examples/test_data/ca1/channels/Kdrfast.channel.nml b/examples/test_data/ca1/channels/Kdrfast.channel.nml index ac0133b8..57d73176 100755 --- a/examples/test_data/ca1/channels/Kdrfast.channel.nml +++ b/examples/test_data/ca1/channels/Kdrfast.channel.nml @@ -4,30 +4,30 @@ NeuroML file containing a single ion channel - + Fast delayed rectifier K+ channel description (from Yuen and Durand 1991, modeled by Aradi and Holmes 1999, modified by Marianne Bezaire) - + - + - - + + - + - + - - + + - + - + diff --git a/examples/test_data/ca1/channels/KvAolm.channel.nml b/examples/test_data/ca1/channels/KvAolm.channel.nml index b8d00ad5..530dad0b 100755 --- a/examples/test_data/ca1/channels/KvAolm.channel.nml +++ b/examples/test_data/ca1/channels/KvAolm.channel.nml @@ -1,35 +1,35 @@ - + NeuroML file containing a single ion channel - + A-type K+ channel description (from Zhang and McBain 1995, Martina 1998, Warman 1994 - modeled by Saraga 2003, Cutsuridis 2010) - + - + - + - - + + - + - + @@ -38,5 +38,5 @@ - + diff --git a/examples/test_data/ca1/channels/Nav.channel.nml b/examples/test_data/ca1/channels/Nav.channel.nml index 227eb3b7..22c3c65e 100755 --- a/examples/test_data/ca1/channels/Nav.channel.nml +++ b/examples/test_data/ca1/channels/Nav.channel.nml @@ -4,37 +4,37 @@ NeuroML file containing a single ion channel - + Na+ channel description (modeled by Yuen and Durand 1991, modified by Aradi and Holmes 1999) - + - - + + - + - - + + - + - - + + - + - + - - - + + + - + - + diff --git a/examples/test_data/ca1/channels/leak_chan.channel.nml b/examples/test_data/ca1/channels/leak_chan.channel.nml index f831bbed..a8bd6748 100755 --- a/examples/test_data/ca1/channels/leak_chan.channel.nml +++ b/examples/test_data/ca1/channels/leak_chan.channel.nml @@ -4,5 +4,5 @@ NeuroML file containing a single passive Channel description - + diff --git a/examples/test_data/hhcell.cell.nml b/examples/test_data/hhcell.cell.nml index 2d5930ea..d39424ef 100644 --- a/examples/test_data/hhcell.cell.nml +++ b/examples/test_data/hhcell.cell.nml @@ -2,7 +2,7 @@ @@ -28,7 +28,7 @@ - + @@ -49,4 +49,3 @@ - diff --git a/examples/test_data/kChan.channel.nml b/examples/test_data/kChan.channel.nml index 5c81c9e5..976791e7 100644 --- a/examples/test_data/kChan.channel.nml +++ b/examples/test_data/kChan.channel.nml @@ -2,21 +2,20 @@ - + Single ion channel in NeuroML2 format: standard Potassium channel from the Hodgkin Huxley model - + - diff --git a/examples/test_data/naChan.channel.nml b/examples/test_data/naChan.channel.nml index 15713a92..3e1dfac2 100644 --- a/examples/test_data/naChan.channel.nml +++ b/examples/test_data/naChan.channel.nml @@ -2,12 +2,12 @@ - + - + Single ion channel in NeuroML2 format: standard Sodium channel from the Hodgkin Huxley model @@ -24,4 +24,3 @@ - diff --git a/examples/test_data/passiveChan.channel.nml b/examples/test_data/passiveChan.channel.nml index b203d59c..07a21ad8 100644 --- a/examples/test_data/passiveChan.channel.nml +++ b/examples/test_data/passiveChan.channel.nml @@ -5,12 +5,11 @@ xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.githubusercontent.com/NeuroML/NeuroML2/master/Schemas/NeuroML2/NeuroML_v2beta3.xsd" id="passiveChan"> - + - + Single ion channel in NeuroML2 format: passive channel providing a leak conductance - + - diff --git a/examples/test_data/pyr_4_sym.cell.nml b/examples/test_data/pyr_4_sym.cell.nml index dda62784..381e1d92 100644 --- a/examples/test_data/pyr_4_sym.cell.nml +++ b/examples/test_data/pyr_4_sym.cell.nml @@ -74,7 +74,7 @@ @@ -82,7 +82,7 @@ @@ -90,7 +90,7 @@ @@ -98,7 +98,7 @@ @@ -106,7 +106,7 @@ @@ -114,7 +114,7 @@ @@ -122,7 +122,7 @@ @@ -130,7 +130,7 @@ @@ -138,7 +138,7 @@ @@ -203,7 +203,7 @@ - + @@ -211,17 +211,17 @@ - + - + - + - + - + - + @@ -242,5 +242,5 @@ - + diff --git a/examples/test_data/xppaut/fhn.ode b/examples/test_data/xppaut/fhn.ode index ea89bb51..0407a203 100755 --- a/examples/test_data/xppaut/fhn.ode +++ b/examples/test_data/xppaut/fhn.ode @@ -1,4 +1,4 @@ -# Forced Fitzhugh-Nagumo fhn.ode +# Forced Fitzhugh-Nagumo fhn.ode dv/dt = f(v)-w+s(t)+I_0 dw/dt = eps*(v-gamma*w) f(v)=v*(1-v)*(v-a) diff --git a/examples/test_data/xppaut/nca.ode b/examples/test_data/xppaut/nca.ode index f43e003f..1fbe8cb9 100644 --- a/examples/test_data/xppaut/nca.ode +++ b/examples/test_data/xppaut/nca.ode @@ -8,7 +8,7 @@ number thetam=-30.0,sigmam=9.5,sigmah=-7.0,sigman=10.0,sigmaz=5.0 number VCa=120 number thetar=-20.0,sigmar=10.0,thetac=-30,sigmac=7 number pwrc=1,pwrq=4 -# +# p gNa=35.0,gKdr=6.0,gL=0.05,Iapp=1.0 p gA=1.4,gNaP=0.2,gZ=1.0 p thetaz=-39.0,tauZs=75.0 @@ -44,7 +44,7 @@ IA=gA*Ainfs^3*bbs*(VVs-VK) Iz=gZ*zzs*(VVs-VK) ICa=gCa*rrs^2*(VVs-VCa) IKC=gKCa*mKCa*ccs*(VVs-VK) -IAHP=gKAHP*qqs*(VVs-VK) +IAHP=gKAHP*qqs*(VVs-VK) # VVs(0)=-71.962 hhs(0)=0.979199 diff --git a/examples/test_execute_command.py b/examples/test_execute_command.py index 0f029e1e..253b8937 100644 --- a/examples/test_execute_command.py +++ b/examples/test_execute_command.py @@ -8,10 +8,10 @@ print("\n====================\n") - returncode, output = pynml.execute_command_in_dir(command, run_dir, prefix="Output [%s] > "%command, verbose=True) + returncode, output = pynml.execute_command_in_dir(command, run_dir, prefix="Output [%s] > "%command, verbose=True) print(' ---- Return code from execute_command_in_dir: %s; output: \n%s\n--------------------------'%(returncode, output)) - success = pynml.execute_command_in_dir_with_realtime_output(command, run_dir, prefix="Output [%s]: "%command, verbose=False) + success = pynml.execute_command_in_dir_with_realtime_output(command, run_dir, prefix="Output [%s]: "%command, verbose=False) - print(' ---- Success of execute_command_in_dir_with_realtime_output: %s'%success) \ No newline at end of file + print(' ---- Success of execute_command_in_dir_with_realtime_output: %s'%success) diff --git a/examples/tune/Ca_pyr.channel.nml b/examples/tune/Ca_pyr.channel.nml index 141db360..acf2b34f 100644 --- a/examples/tune/Ca_pyr.channel.nml +++ b/examples/tune/Ca_pyr.channel.nml @@ -6,11 +6,11 @@ - + - + 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. @@ -18,7 +18,7 @@ - + Ca channels @@ -39,7 +39,7 @@ - + diff --git a/examples/tune/Kahp_pyr.channel.nml b/examples/tune/Kahp_pyr.channel.nml index 9f05401e..40f952be 100644 --- a/examples/tune/Kahp_pyr.channel.nml +++ b/examples/tune/Kahp_pyr.channel.nml @@ -6,11 +6,11 @@ - + - + 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. @@ -18,7 +18,7 @@ - + K channels @@ -34,7 +34,7 @@ - + diff --git a/examples/tune/Kdr_pyr.channel.nml b/examples/tune/Kdr_pyr.channel.nml index 5b8b95be..e13fbdd2 100644 --- a/examples/tune/Kdr_pyr.channel.nml +++ b/examples/tune/Kdr_pyr.channel.nml @@ -6,11 +6,11 @@ - + - + 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. @@ -18,7 +18,7 @@ - + K channels @@ -34,7 +34,7 @@ - + diff --git a/examples/tune/LEMS_OnePyr.xml b/examples/tune/LEMS_OnePyr.xml index 096e3375..3abf118f 100644 --- a/examples/tune/LEMS_OnePyr.xml +++ b/examples/tune/LEMS_OnePyr.xml @@ -8,7 +8,7 @@ - + @@ -24,74 +24,74 @@ - - - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + diff --git a/examples/tune/LeakConductance_pyr.channel.nml b/examples/tune/LeakConductance_pyr.channel.nml index 2b8f6db2..1908990f 100644 --- a/examples/tune/LeakConductance_pyr.channel.nml +++ b/examples/tune/LeakConductance_pyr.channel.nml @@ -7,7 +7,7 @@ Simple example of a leak/passive conductance. Note: for GENESIS cells with a single leak conductance, it is better to use the Rm and Em variables for a passive current. - + diff --git a/examples/tune/Na_pyr.channel.nml b/examples/tune/Na_pyr.channel.nml index 584b6d16..c1259258 100644 --- a/examples/tune/Na_pyr.channel.nml +++ b/examples/tune/Na_pyr.channel.nml @@ -6,11 +6,11 @@ - + - + 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. @@ -18,7 +18,7 @@ - + Na channels @@ -39,7 +39,7 @@ - + diff --git a/examples/tune/OnePyr.net.nml b/examples/tune/OnePyr.net.nml index fbedeb7b..aa610c63 100644 --- a/examples/tune/OnePyr.net.nml +++ b/examples/tune/OnePyr.net.nml @@ -24,10 +24,10 @@ Cell Group: baskets contains 1 cells - + - + diff --git a/examples/tune/README.md b/examples/tune/README.md index 4324626b..c1cf4a77 100644 --- a/examples/tune/README.md +++ b/examples/tune/README.md @@ -7,15 +7,13 @@ To run the single cell example, install NEURON: jnml LEMS_OnePyr.xml -neuron nrnivmodl nrngui LEMS_OnePyr_nrn.py - + or: python tunePyr.py - + To (re)tune the cell: python tunePyr.py -tune - -![pic](https://raw.githubusercontent.com/NeuroML/pyNeuroML/master/examples/tune/Selection_817.jpg) - +![pic](https://raw.githubusercontent.com/NeuroML/pyNeuroML/master/examples/tune/Selection_817.jpg) diff --git a/examples/tune/pyr_4_sym.cell.nml b/examples/tune/pyr_4_sym.cell.nml index dda62784..381e1d92 100644 --- a/examples/tune/pyr_4_sym.cell.nml +++ b/examples/tune/pyr_4_sym.cell.nml @@ -74,7 +74,7 @@ @@ -82,7 +82,7 @@ @@ -90,7 +90,7 @@ @@ -98,7 +98,7 @@ @@ -106,7 +106,7 @@ @@ -114,7 +114,7 @@ @@ -122,7 +122,7 @@ @@ -130,7 +130,7 @@ @@ -138,7 +138,7 @@ @@ -203,7 +203,7 @@ - + @@ -211,17 +211,17 @@ - + - + - + - + - + - + @@ -242,5 +242,5 @@ - + diff --git a/install_local_java.sh b/install_local_java.sh index 534563a4..a3e9ab22 100755 --- a/install_local_java.sh +++ b/install_local_java.sh @@ -1,7 +1,7 @@ -if [ ! -d "jdk1.8.0_112" ] ; +if [ ! -d "jdk1.8.0_112" ] ; -then +then wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.tar.gz tar xvzf jdk-8u112-linux-x64.tar.gz @@ -13,4 +13,3 @@ export JAVA_HOME="`pwd`/jdk1.8.0_112" echo "Set JAVA_HOME to $JAVA_HOME" export PATH=$JAVA_HOME/bin:$PATH echo "Set PATH to $PATH" - diff --git a/pyneuroml/analysis/ChannelHelper.py b/pyneuroml/analysis/ChannelHelper.py index 0e086c2b..cac9d9d2 100644 --- a/pyneuroml/analysis/ChannelHelper.py +++ b/pyneuroml/analysis/ChannelHelper.py @@ -1,7 +1,7 @@ -from math import exp -from pyneuroml.pynml import get_value_in_si import logging +from math import exp +from pyneuroml.pynml import get_value_in_si logger = logging.getLogger(__name__) diff --git a/pyneuroml/analysis/ChannelInfo_TEMPLATE.html b/pyneuroml/analysis/ChannelInfo_TEMPLATE.html index c9e133e6..355af955 100644 --- a/pyneuroml/analysis/ChannelInfo_TEMPLATE.html +++ b/pyneuroml/analysis/ChannelInfo_TEMPLATE.html @@ -1,6 +1,6 @@ Channel information - +

${info}

@@ -20,7 +20,7 @@ ${channel.id} time course -#end## +#end##
diff --git a/pyneuroml/analysis/LEMS_Test_TEMPLATE.xml b/pyneuroml/analysis/LEMS_Test_TEMPLATE.xml index 5609ec96..14299f99 100644 --- a/pyneuroml/analysis/LEMS_Test_TEMPLATE.xml +++ b/pyneuroml/analysis/LEMS_Test_TEMPLATE.xml @@ -12,16 +12,16 @@ #foreach ($inc in $includes)## #end - + - - + + - + @@ -45,23 +45,23 @@ - - + + - + - + - + @@ -77,14 +77,14 @@ - + #foreach ($tv in $target_voltages)## -#end## - +#end## + #set( $duration_2 = 2 * $duration ) #set( $max_target_voltage_2 = 2 * $max_target_voltage - $min_target_voltage) @@ -92,13 +92,13 @@ - + - + #foreach ($tv in $target_voltages)## -#end## - +#end## + @@ -109,54 +109,54 @@ #set( $dt = 0.000025 * $duration * $scale_dt ) - + #foreach ($tv in $target_voltages)## -#end## +#end## #foreach ($tv in $target_voltages)## -#end## +#end## - + #foreach ($tv in $target_voltages)## -#end## +#end## #foreach ($g in $gates)## - + -#end## +#end## #foreach ($g in $gates)## - + - + -#end## +#end## #if ($iv_curve)## #foreach ($tv in $target_voltages)## - + -#end## -#end## +#end## +#end## - + diff --git a/pyneuroml/analysis/__init__.py b/pyneuroml/analysis/__init__.py index 880a8308..4b968694 100644 --- a/pyneuroml/analysis/__init__.py +++ b/pyneuroml/analysis/__init__.py @@ -1,25 +1,23 @@ +import logging import math import os -import logging import typing +from typing import Optional + +import neuroml as nml import numpy as np from pyneuroml import pynml -from pyneuroml.lems.LEMSSimulation import LEMSSimulation from pyneuroml.lems import generate_lems_file_for_neuroml -from pyneuroml.utils.plot import get_next_hex_color +from pyneuroml.lems.LEMSSimulation import LEMSSimulation from pyneuroml.plot import generate_plot -import neuroml as nml - -from typing import Optional - +from pyneuroml.utils.plot import get_next_hex_color logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) try: - from pyelectro.analysis import max_min - from pyelectro.analysis import mean_spike_frequency + from pyelectro.analysis import max_min, mean_spike_frequency except ImportError: logger.warning("Please install optional dependencies to use analysis features:") logger.warning("pip install pyneuroml[analysis]") @@ -516,8 +514,8 @@ def analyse_spiketime_vs_dt( save_figure_to=None, num_of_last_spikes=None, ): - from pyelectro.analysis import max_min import numpy as np + from pyelectro.analysis import max_min all_results = {} diff --git a/pyneuroml/channelml/ChannelML2NeuroML2beta.xsl b/pyneuroml/channelml/ChannelML2NeuroML2beta.xsl index b8124ed2..ab38ec9a 100644 --- a/pyneuroml/channelml/ChannelML2NeuroML2beta.xsl +++ b/pyneuroml/channelml/ChannelML2NeuroML2beta.xsl @@ -4,17 +4,17 @@ This file is used to convert post v1.7.3 ChannelML files to the latest NeuroML 2 format. - Funding for this work has been received from the Medical Research Council and the + Funding for this work has been received from the Medical Research Council and the Wellcome Trust. This file was initially developed as part of the neuroConstruct project - + Author: Padraig Gleeson Copyright 2012 University College London - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -909,7 +909,7 @@ - + @@ -922,7 +922,7 @@ \n", segGrpsForSections, nseg) sprint(segGrpsForSections, "%s
\n", segGrpsForSections) - + } for i = 1, n3d() - 1 { @@ -294,7 +294,7 @@ proc xmlwrite() { local proximalid, pointcount, segmentcount, sectioncount, i, j pointcount += 1 segmentcount += 1 } - + sprint(segGrpsForSections, "%s
\n\n", segGrpsForSections) } @@ -406,7 +406,7 @@ proc xmlwrite() { local proximalid, pointcount, segmentcount, sectioncount, i, j // biophysics element for THIS cell. Only include if level > 1 if (nml2_level > 1) { // i.e. "Level 2" of NeuroML or greater - + xmlwrite_biophysics(file_out) } @@ -421,7 +421,7 @@ proc xmlwrite() { local proximalid, pointcount, segmentcount, sectioncount, i, j cellnml2file.close() } - + cellindex = cellindex +1 } @@ -429,20 +429,20 @@ proc xmlwrite() { local proximalid, pointcount, segmentcount, sectioncount, i, j sprint(network, "%s\n \n", network) mainnml2file.printf("%s \n", network) - assoc_cell_number(0, mainnml2file) + assoc_cell_number(0, mainnml2file) artcell(mainnml2file) } -// Takes arguments: +// Takes arguments: // $o1 file_out File object to write to // proc xmlwrite_biophysics() { file_out = $o1 - + cellnml2file.printf("\n \n\n \n") cellnml2file.printf("\n \n\n") @@ -474,11 +474,11 @@ proc xmlwrite_biophysics() { for dparm.parmiter(dpelm) { for l=0, dpelm.parms.count - 1 { print " - l ", l, " dparm ", dparm.name, " dpelm ", dpelm, ", value ", dpelm.parms.object(l).value - - + + if (hoc_sf_.substr(dmech.name, "_ion") > 0) { - strdef paramNameToUse + strdef paramNameToUse paramNameToUse = dparm.name strdef groupName sprint(groupName, "%s", dpelm.parms.object(l).location) @@ -501,18 +501,18 @@ proc xmlwrite_biophysics() { print "Assuming the one and only value for ek is: ", erev_K, "mV" } } else { - - strdef paramNameToUse + + strdef paramNameToUse paramNameToUse = dparm.name value = dpelm.parms.object(l).value if (hoc_sf_.substr(paramNameToUse, "_")>=0) { hoc_sf_.left(paramNameToUse, hoc_sf_.substr(paramNameToUse, "_")) } - + print " Initial parameter name: [", paramNameToUse, "], value: ", value - + if (strcmp(paramNameToUse, "e") == 0) { - + {p.set_erev_for_mechanism(dmech.name, value)} {print p.get_erev_for_mechanism(dmech.name)} } @@ -521,9 +521,9 @@ proc xmlwrite_biophysics() { } } - + } - + for i=0, cellref.secanal.dmlist.count - 1 { dmech = cellref.secanal.dmlist.object(i) @@ -535,12 +535,12 @@ proc xmlwrite_biophysics() { if (strcmp(dmech.name,"capacitance") != 0 && strcmp(dmech.name,"Ra") != 0 && hoc_sf_.substr(dmech.name, "_ion") == -1) { - - found_erev = 0 + + found_erev = 0 print "---------------------------------------------" print "Handling mechanism: ", dmech.name - strdef passiveAttr + strdef passiveAttr passiveAttr = "" // If mech name is built in passive conductance in NEURON if (strcmp(dmech.name,"pas") == 0) { @@ -552,7 +552,7 @@ proc xmlwrite_biophysics() { // Not used in nml2 /////passiveAttr = " passive_conductance=\"true\"" } - + for j=0, dmech.location.subset.size()-1 { secref = cellref.secanal.all.object(dmech.location.subset.x(j)) // printsec(cellnml2file, secref) @@ -561,15 +561,15 @@ proc xmlwrite_biophysics() { //print dparm for dparm.parmiter(dpelm) { //print dpelm - - + + for l=0, dpelm.parms.count - 1 { - strdef paramNameToUse + strdef paramNameToUse paramNameToUse = dparm.name print " Initial parameter name: ", paramNameToUse - strdef comment + strdef comment comment = "" // strip suffix @@ -590,7 +590,7 @@ proc xmlwrite_biophysics() { sprint(comment, "", paramNameToUse) } else if (hoc_sf_.substr(paramNameToUse, "g")==0 && hoc_sf_.substr(paramNameToUse, "bar")>=1) { sprint(comment, "", paramNameToUse) - paramNameToUse = "condDensity" + paramNameToUse = "condDensity" } else if (strcmp(paramNameToUse,"gl") == 0) { paramNameToUse = "condDensity" sprint(comment, "", paramNameToUse) @@ -608,7 +608,7 @@ proc xmlwrite_biophysics() { } else if (hoc_sf_.substr(paramNameToUse, "g")==0) { sprint(comment, "", paramNameToUse) paramNameToUse = "condDensity" - } + } print " Checking param: ",paramNameToUse, " in ", dmech.name if (strcmp(paramNameToUse,"e") == 0) { found_erev = 1 @@ -619,7 +619,7 @@ proc xmlwrite_biophysics() { factor = 1 - strdef units + strdef units units = "???" if (hoc_sf_.substr(paramNameToUse,"condDensity") >= 0) { @@ -629,14 +629,14 @@ proc xmlwrite_biophysics() { if (strcmp(paramNameToUse,"e") == 0) { paramNameToUse = "erev" units = "mV" - } - + } + if (strcmp(paramNameToUse, "condDensity")==0) { - + cellnml2file.printf(" =0) { cellnml2file.printf(" erev=\"%fmV\" ", erev_Na) } else if (hoc_sf_.substr(dmech.name,"K")>=0) { @@ -645,10 +645,10 @@ proc xmlwrite_biophysics() { value = p.get_erev_for_mechanism(dmech.name) cellnml2file.printf(" erev=\"%fmV\" ", value) } - + cellnml2file.printf("/>\n\n") - - + + } else if (strcmp(paramNameToUse, "e")==0) { print "Rev pot handled elsewhere..." } else if (strcmp(paramNameToUse, "erev")==0) { @@ -658,11 +658,11 @@ proc xmlwrite_biophysics() { //quit() } } - - + + } } - + } } @@ -679,7 +679,7 @@ proc xmlwrite_biophysics() { print "---------------------------------------------" print "Handling mechanism: ", dmech.name - strdef units + strdef units units = "uF_per_cm2" cellnml2file.printf(" \n\n") - } + } } cellnml2file.printf(" \n\n \n\n") @@ -705,7 +705,7 @@ proc xmlwrite_biophysics() { print "---------------------------------------------" print "Handling mechanism: ", dmech.name - strdef units + strdef units units = "kohm_cm" cellnml2file.printf(" \n\n") - } + } } //////////// ion_xmlwrite(cellnml2file) - cellnml2file.printf(" \n\n \n\n") + cellnml2file.printf(" \n\n \n\n") print "---------------------------------------------" @@ -732,7 +732,7 @@ proc xmlwrite_biophysics() { proc artcell() {local i,j,l file_out = $o1 for i=0, mview.acview.alist.count-1 { - dmech = mview.acview.alist.object(i) + dmech = mview.acview.alist.object(i) file_out.printf(" \n", dmech.name) @@ -770,7 +770,7 @@ proc printparmval() { comment1 = $s6 ref = $s7 units = $s8 - + print " -- Generating parameter, type: ", param_obj.type(), " param: ", param, ", val: ", param_obj.value, ", scale: ", scale_factor, ", comm: [", comment1, "], ref: ", ref, ", units: ", units // 1 is ModelViewParmVal, 2 is ModelViewParmVec if (param_obj.type() == 1) { @@ -783,10 +783,10 @@ proc printparmval() { if (hoc_sf_.len(param)>0) { // only incl if param is set => condDensity etc. not cap - strdef newParamName + strdef newParamName newParamName = param - file_out.printf(" %s = \"%g %s\"", newParamName, param_obj.value * scale_factor, units) + file_out.printf(" %s = \"%g %s\"", newParamName, param_obj.value * scale_factor, units) } else { file_out.printf(" value=\"%g %s\" %s", param_obj.value * scale_factor, units, comment1) // specCapacitance, etc. @@ -806,7 +806,7 @@ proc printparmval() { if (hoc_sf_.substr(groupName,"[")>=0 && hoc_sf_.substr(groupName,"]")>=0) { hoc_sf_.left(groupName, hoc_sf_.substr(groupName,"]")) - strdef index + strdef index index = groupName hoc_sf_.left(groupName, hoc_sf_.substr(groupName,"[")) hoc_sf_.right(index, hoc_sf_.substr(index,"[")+1) @@ -835,7 +835,7 @@ proc printparmval() { if (hoc_sf_.substr(groupName,"[")>=0 && hoc_sf_.substr(groupName,"]")>=0) { hoc_sf_.left(groupName, hoc_sf_.substr(groupName,"]")) - strdef index + strdef index index = groupName hoc_sf_.left(groupName, hoc_sf_.substr(groupName,"[")) hoc_sf_.right(index, hoc_sf_.substr(index,"[")+1) @@ -894,8 +894,8 @@ objref temp_secref proc printsec() { file_out = $o1 temp_secref = $o2 - - temp_secref.sec { + + temp_secref.sec { file_out.printf("
\n", secname()) } } @@ -905,7 +905,7 @@ objref temp_param_obj proc printvecvals() {local i file_out = $o1 temp_param_obj = $o2 - + temp_param_obj.location.realcell.all.object(temp_param_obj.location.isec).sec { file_out.printf(" \n", secname()) ///file_out.printf("
\n", secname()) @@ -920,7 +920,7 @@ proc printvecvals() {local i proc ion_xmlwrite() { file_out = $o1 - + for mview.dparm.mechs(tobj) { if (hoc_sf_.head(tobj.name, "_ion", tstr) != -1) { file_out.printf(" \n", tstr, ion_charge(tobj.name)) diff --git a/pyneuroml/neuron/utils.hoc b/pyneuroml/neuron/utils.hoc index 8a94eec4..6d87b19c 100755 --- a/pyneuroml/neuron/utils.hoc +++ b/pyneuroml/neuron/utils.hoc @@ -541,4 +541,3 @@ proc createTestReport() { print "------------------------------------------------------------------------------" } - diff --git a/pyneuroml/pynml.py b/pyneuroml/pynml.py index 65f26583..11c0e5d0 100644 --- a/pyneuroml/pynml.py +++ b/pyneuroml/pynml.py @@ -567,7 +567,7 @@ def _evaluate_arguments(args): # Deal with the SBML validation option which doesn't call run_jneuroml if args.validate_sbml or args.validate_sbml_units: - file_types = ["sbml","xml"] + file_types = ["sbml", "xml"] try: from pyneuroml.sbml import validate_sbml_files except Exception: @@ -672,13 +672,13 @@ def _evaluate_arguments(args): # TODO: handle these better if args.sbml_import or args.sbml_import_units or args.vhdl: if args.sbml_import: - file_types = ["sbml","xml"] + file_types = ["sbml", "xml"] pre_args = "-sbml-import" f = args.sbml_import[0] post_args = " ".join(args.sbml_import[1:]) confirm_file_type(f, file_types, sys_error=True) elif args.sbml_import_units: - file_types = ["sbml","xml"] + file_types = ["sbml", "xml"] pre_args = "-smbl-import-units" f = args.sbml_import_units[0] post_args = " ".join(args.sbml_import_units[1:]) @@ -874,13 +874,13 @@ def _evaluate_arguments(args): exit(0) elif args.validate: - file_types = ["nml","xml"] + file_types = ["nml", "xml"] pre_args = "-validate" exit_on_fail = True run_multi = True elif args.validatev1: - file_types = ["nml","xml"] + file_types = ["nml", "xml"] pre_args = "-validatev1" exit_on_fail = True run_multi = True diff --git a/pyneuroml/runners.py b/pyneuroml/runners.py index a56a37a3..bfdcf894 100644 --- a/pyneuroml/runners.py +++ b/pyneuroml/runners.py @@ -902,7 +902,7 @@ def execute_command_in_dir_with_realtime_output( ) with p.stdout: for line in iter(p.stdout.readline, ""): - print(" %s %s" % (prefix,line.strip())) + print(" %s %s" % (prefix, line.strip())) p.wait() # wait for the subprocess to exit print("####################################################################") @@ -993,9 +993,7 @@ def execute_command_in_dir( logger.critical("*** Problem running last command: %s" % e) print("####################################################################") - print( - "%s%s" % (prefix, e.output.decode().replace("\n", "\n" + prefix)) - ) + print("%s%s" % (prefix, e.output.decode().replace("\n", "\n" + prefix))) print("####################################################################") return (e.returncode, e.output.decode()) except Exception as e: diff --git a/pyneuroml/sbml/__init__.py b/pyneuroml/sbml/__init__.py index d4dad9f5..29188efe 100644 --- a/pyneuroml/sbml/__init__.py +++ b/pyneuroml/sbml/__init__.py @@ -3,12 +3,10 @@ based on https://github.com/combine-org/combine-notebooks/blob/main/src/combine_notebooks/validation/validation_sbml.py """ -import os import errno -from typing import List - - import logging +import os +from typing import List logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) diff --git a/pyneuroml/sedml/__init__.py b/pyneuroml/sedml/__init__.py index d1061280..c351f671 100644 --- a/pyneuroml/sedml/__init__.py +++ b/pyneuroml/sedml/__init__.py @@ -3,11 +3,12 @@ based on example here https://github.com/SED-ML/libSEDML/blob/master/examples/python/echo_sedml.py """ -import os import errno -import libsedml +import os from typing import List +import libsedml + def check_file(file_name): """ diff --git a/pyneuroml/tune/NeuroMLController.py b/pyneuroml/tune/NeuroMLController.py index 19c60c8a..c94c2532 100644 --- a/pyneuroml/tune/NeuroMLController.py +++ b/pyneuroml/tune/NeuroMLController.py @@ -5,21 +5,20 @@ more information on controllers in Neurotune. """ -import os.path +import logging import os +import os.path +import pprint +import shutil import sys import time -import shutil -import logging -import pprint - +from collections import OrderedDict from io import StringIO -from collections import OrderedDict -import pyneuroml.pynml -from pyneuroml import print_v import neuroml +import pyneuroml.pynml +from pyneuroml import print_v logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) diff --git a/pyneuroml/tune/NeuroMLSimulation.py b/pyneuroml/tune/NeuroMLSimulation.py index c99f7184..27adfdff 100644 --- a/pyneuroml/tune/NeuroMLSimulation.py +++ b/pyneuroml/tune/NeuroMLSimulation.py @@ -1,11 +1,10 @@ +import logging import sys import time -import logging -from pyneuroml import pynml, print_v +from pyneuroml import print_v, pynml from pyneuroml.lems import generate_lems_file_for_neuroml - logger = logging.getLogger(__name__) diff --git a/pyneuroml/utils/cli.py b/pyneuroml/utils/cli.py index d853e9c7..88b64224 100644 --- a/pyneuroml/utils/cli.py +++ b/pyneuroml/utils/cli.py @@ -7,8 +7,8 @@ Copyright 2023 NeuroML contributors """ - import argparse + from . import convert_case diff --git a/pyneuroml/utils/misc.py b/pyneuroml/utils/misc.py index 98d22bb3..507fdcdd 100644 --- a/pyneuroml/utils/misc.py +++ b/pyneuroml/utils/misc.py @@ -7,7 +7,6 @@ Copyright 2024 NeuroML contributors """ - import os from pyneuroml import JNEUROML_VERSION diff --git a/pyneuroml/utils/units.py b/pyneuroml/utils/units.py index e894efc8..926202ea 100644 --- a/pyneuroml/utils/units.py +++ b/pyneuroml/utils/units.py @@ -7,13 +7,13 @@ Copyright 2024 NeuroML contributors """ - import logging import typing import zipfile import lems.model.model as lems_model from lems.parser.LEMS import LEMSFileParser + import pyneuroml.utils.misc as pymisc logger = logging.getLogger(__name__) diff --git a/pyneuroml/utils/xml.py b/pyneuroml/utils/xml.py index 805b4e9c..03df629b 100644 --- a/pyneuroml/utils/xml.py +++ b/pyneuroml/utils/xml.py @@ -8,6 +8,7 @@ """ import typing + from lxml import etree diff --git a/pyneuroml/validators.py b/pyneuroml/validators.py index a1a83f66..e7325020 100644 --- a/pyneuroml/validators.py +++ b/pyneuroml/validators.py @@ -7,7 +7,6 @@ Copyright 2024 NeuroML contributors """ - import logging import typing import warnings diff --git a/pyneuroml/xppaut/__init__.py b/pyneuroml/xppaut/__init__.py index 688a40a0..55331c73 100644 --- a/pyneuroml/xppaut/__init__.py +++ b/pyneuroml/xppaut/__init__.py @@ -251,8 +251,9 @@ def to_xpp(data, new_xpp_filename): xpp_ode = "" from pyneuroml import __version__ - xpp_ode += "\n## XPP export from pyNeuroML v%s\n"%__version__ - + + xpp_ode += "\n## XPP export from pyNeuroML v%s\n" % __version__ + xpp_ode += "\n# Parameters\n" for k, v in data["parameters"].items(): if k not in INBUILT.keys(): diff --git a/scripts/generate_test_data.py b/scripts/generate_test_data.py index f3aa24c5..b67c1966 100644 --- a/scripts/generate_test_data.py +++ b/scripts/generate_test_data.py @@ -1,5 +1,5 @@ -from random import random import math +from random import random t_max = 1 diff --git a/setup.cfg b/setup.cfg index d3e395a5..6b9664bb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pyNeuroML -version = 1.3.16 +version = 1.3.17 author = Padraig Gleeson author_email = p.gleeson@gmail.com url = https://github.com/NeuroML/pyNeuroML @@ -22,10 +22,10 @@ classifiers= [options] install_requires = - pylems>=0.6.4 + pylems>=0.6.8 airspeed>=0.5.5 - neuromllite>=0.5.7 - libNeuroML>=0.5.5 + neuromllite>=0.6.0 + libNeuroML>=0.6.5 matplotlib matplotlib-scalebar progressbar2 diff --git a/tests/__init__.py b/tests/__init__.py index 66b260ec..7a4a47fe 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,12 +1,11 @@ #!/usr/bin/env python3 -import unittest import pathlib as pl +import unittest class BaseTestCase(unittest.TestCase): - """Base test case class to implement extra assertions""" def assertIsFile(self, path): diff --git a/tests/analysis/test_cell_analysis.py b/tests/analysis/test_cell_analysis.py index f2f1c58a..a183f2be 100644 --- a/tests/analysis/test_cell_analysis.py +++ b/tests/analysis/test_cell_analysis.py @@ -7,17 +7,15 @@ Copyright 2023 NeuroML contributors """ - -import unittest import pathlib - +import unittest import neuroml + from pyneuroml.analysis import generate_current_vs_frequency_curve class TestCellAnalysis(unittest.TestCase): - """Test cell analysis module""" def test_cell_analysis(self): diff --git a/tests/channelml/CaPool.xml b/tests/channelml/CaPool.xml index c091b34c..890ce373 100644 --- a/tests/channelml/CaPool.xml +++ b/tests/channelml/CaPool.xml @@ -1,19 +1,19 @@ - - A channel from Maex, R and De Schutter, E. Synchronization of Golgi and Granule Cell Firing in a + A channel from Maex, R and De Schutter, E. Synchronization of Golgi and Granule Cell Firing in a Detailed Network Model of the Cerebellar Granule Cell Layer - - + + Signifies that the ion is involved in a process which alters its concentration - + - + This ChannelML file has been updated to reflect the preferred form of elements/attributes which will be required from v2.0. See info on Version 2 Requirements. @@ -21,7 +21,7 @@ Padraig Gleeson - + An expontially decaying pool of calcium @@ -30,15 +30,15 @@ cerebellar Granule Cell Layer. J Neurophysiol, Nov 1998; 80: 2521 - 2537 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=9819260&dopt=Abstract - + - + - + - + - - + + diff --git a/tests/channelml/DoubExpSyn.xml b/tests/channelml/DoubExpSyn.xml index 64ab3e81..30eecb77 100644 --- a/tests/channelml/DoubExpSyn.xml +++ b/tests/channelml/DoubExpSyn.xml @@ -1,32 +1,32 @@ - - + ChannelML file describing a single synaptic mechanism - - + + - + Padraig Gleeson - - Simple example of a synaptic mechanism, which consists of a postsynaptic conductance which changes as + + Simple example of a synaptic mechanism, which consists of a postsynaptic conductance which changes as double exponential function of time. Mappings exist for NEURON and GENESIS. - + Receptor properties http://senselab.med.yale.edu/senselab/NeuronDB/receptors2.asp - + - + - - - \ No newline at end of file + + + diff --git a/tests/channelml/NMDA.xml b/tests/channelml/NMDA.xml index 6c647f08..e51ab401 100644 --- a/tests/channelml/NMDA.xml +++ b/tests/channelml/NMDA.xml @@ -4,31 +4,31 @@ xmlns:meta="http://morphml.org/metadata/schema" xsi:schemaLocation="http://morphml.org/channelml/schema http://www.neuroml.org/NeuroMLValidator/NeuroMLFiles/Schemata/v1.8.1/Level2/ChannelML_v1.8.1.xsd" units="Physiological Units"> - + ChannelML file describing a synaptic mechanism - - + + - + Padraig Gleeson - - + + Example of an NMDA receptor synaptic mechanism, based on Maex DeSchutter 1998, Gabbiani et al, 1994 - + - + Gabbiani F, Midtgaard J, Knopfel T. Synaptic integration in a model of cerebellar granule cells. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=AbstractPlus&list_uids=7527078 - + - Maex, R and De Schutter, E. - Synchronization of Golgi and Granule Cell Firing in a Detailed Network Model of the + Maex, R and De Schutter, E. + Synchronization of Golgi and Granule Cell Firing in a Detailed Network Model of the cerebellar Granule Cell Layer. J Neurophysiol, Nov 1998; 80: 2521 - 2537 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=9819260&dopt=Abstract @@ -37,13 +37,13 @@ Receptor properties http://senselab.med.yale.edu/senselab/NeuronDB/receptors2.asp - + - + - - - - \ No newline at end of file + + + + diff --git a/tests/channelml/NaChannel_HH.xml b/tests/channelml/NaChannel_HH.xml index b1cfb0a8..73c0357b 100644 --- a/tests/channelml/NaChannel_HH.xml +++ b/tests/channelml/NaChannel_HH.xml @@ -9,7 +9,7 @@ ChannelML file containing a single Channel description - + Equations adapted from HH paper for modern convention of external potential being zero @@ -18,17 +18,17 @@ Simple example of Na conductance in squid giant axon. Based on channel from Hodgkin and Huxley 1952 - + Padraig Gleeson - UCL + UCL p.gleeson - at - ucl.ac.uk - A. L. Hodgkin and A. F. Huxley, A quantitative description of membrane current and + A. L. Hodgkin and A. F. Huxley, A quantitative description of membrane current and its application to conduction and excitation in nerve, J. Physiol., vol. 117, pp. 500-544, 1952. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=12991237 @@ -37,31 +37,31 @@ Na channels http://senselab.med.yale.edu/senselab/NeuronDB/channelGene2.htm#table2 - - - + + + - - + + - + - - + + - + - - + + diff --git a/tests/channelml/SingleExpSyn.xml b/tests/channelml/SingleExpSyn.xml index c926e820..18a28312 100644 --- a/tests/channelml/SingleExpSyn.xml +++ b/tests/channelml/SingleExpSyn.xml @@ -1,32 +1,32 @@ - - + ChannelML file describing a single synaptic mechanism - - + + - + Padraig Gleeson - - Simple example of a synaptic mechanism, which consists of a postsynaptic conductance which changes as + + Simple example of a synaptic mechanism, which consists of a postsynaptic conductance which changes as single exponential function of time. Mappings exist for NEURON and GENESIS. - + Receptor properties http://senselab.med.yale.edu/senselab/NeuronDB/receptors2.asp - + - + - - - \ No newline at end of file + + + diff --git a/tests/channelml/test_channelml.py b/tests/channelml/test_channelml.py index 33a882c2..02c2b497 100644 --- a/tests/channelml/test_channelml.py +++ b/tests/channelml/test_channelml.py @@ -7,12 +7,13 @@ Copyright 2023 NeuroML contributors """ -import unittest import logging import pathlib as pl +import unittest from pyneuroml.channelml import channelml2nml from pyneuroml.pynml import validate_neuroml2 + from .. import BaseTestCase logger = logging.getLogger(__name__) @@ -20,7 +21,6 @@ class TestChannelML(BaseTestCase): - """Test ChannelML module""" def test_channelml2nml(self): diff --git a/tests/izhikevich_test_file.nml b/tests/izhikevich_test_file.nml index f9df37b2..db9b2333 100644 --- a/tests/izhikevich_test_file.nml +++ b/tests/izhikevich_test_file.nml @@ -6,4 +6,3 @@ - diff --git a/tests/lems/test_lemssimulation.py b/tests/lems/test_lemssimulation.py index f479f0e9..cc5c7c94 100644 --- a/tests/lems/test_lemssimulation.py +++ b/tests/lems/test_lemssimulation.py @@ -13,6 +13,7 @@ import unittest import pytest + from pyneuroml.lems import LEMSSimulation logger = logging.getLogger(__name__) @@ -20,7 +21,6 @@ class TestLEMSSimulation(unittest.TestCase): - """Test the LEMSSimulation class""" def test_lemssimulation_meta(self): diff --git a/tests/neuron/__init__.py b/tests/neuron/__init__.py index 38215fd2..e9c956ea 100644 --- a/tests/neuron/__init__.py +++ b/tests/neuron/__init__.py @@ -7,11 +7,9 @@ Copyright 2023 NeuroML contributors """ - import pathlib import subprocess - from pyneuroml.neuron import load_hoc_or_python_file diff --git a/tests/neuron/test_data/mods/HCNolm.mod b/tests/neuron/test_data/mods/HCNolm.mod index 7df68b52..5c2f5833 100644 --- a/tests/neuron/test_data/mods/HCNolm.mod +++ b/tests/neuron/test_data/mods/HCNolm.mod @@ -12,41 +12,41 @@ ENDCOMMENT NEURON { SUFFIX HCNolm USEION h WRITE ih VALENCE 1 ? Assuming valence = 1; TODO check this!! - - RANGE gion + + RANGE gion RANGE gmax : Will be changed when ion channel mechanism placed on cell! RANGE conductance : parameter - + RANGE g : exposure - + RANGE fopen : exposure RANGE r_instances : parameter - + RANGE r_tau : exposure - + RANGE r_inf : exposure - + RANGE r_rateScale : exposure - + RANGE r_fcond : exposure RANGE r_timeCourse_TIME_SCALE : parameter RANGE r_timeCourse_VOLT_SCALE : parameter - + RANGE r_timeCourse_t : exposure RANGE r_steadyState_rate : parameter RANGE r_steadyState_midpoint : parameter RANGE r_steadyState_scale : parameter - + RANGE r_steadyState_x : exposure RANGE r_timeCourse_V : derived variable RANGE r_tauUnscaled : derived variable RANGE conductanceScale : derived variable RANGE fopen0 : derived variable - + } UNITS { - + (nA) = (nanoamp) (uA) = (microamp) (mA) = (milliamp) @@ -60,130 +60,129 @@ UNITS { (um) = (micrometer) (umol) = (micromole) (S) = (siemens) - + } PARAMETER { - + gmax = 0 (S/cm2) : Will be changed when ion channel mechanism placed on cell! - + conductance = 1.0E-6 (uS) - r_instances = 1 + r_instances = 1 r_timeCourse_TIME_SCALE = 1 (ms) r_timeCourse_VOLT_SCALE = 1 (mV) - r_steadyState_rate = 1 + r_steadyState_rate = 1 r_steadyState_midpoint = -84.1 (mV) r_steadyState_scale = -10.2 (mV) } ASSIGNED { - + gion (S/cm2) : Transient conductance density of the channel? Standard Assigned variables with ionChannel v (mV) celsius (degC) temperature (K) eh (mV) ih (mA/cm2) - - + + r_timeCourse_V : derived variable - + r_timeCourse_t (ms) : derived variable - + r_steadyState_x : derived variable - + r_rateScale : derived variable - + r_fcond : derived variable - + r_inf : derived variable - + r_tauUnscaled (ms) : derived variable - + r_tau (ms) : derived variable - + conductanceScale : derived variable - + fopen0 : derived variable - + fopen : derived variable - + g (uS) : derived variable rate_r_q (/ms) - + } STATE { - r_q - + r_q + } INITIAL { eh = -32.9 - + temperature = celsius + 273.15 - + rates() rates() ? To ensure correct initialisation. - + r_q = r_inf - + } BREAKPOINT { - + SOLVE states METHOD cnexp - + ? DerivedVariable is based on path: conductanceScaling[*]/factor, on: Component(id=HCNolm type=ionChannelHH), from conductanceScaling; null ? Path not present in component, using factor: 1 - - conductanceScale = 1 - + + conductanceScale = 1 + ? DerivedVariable is based on path: gates[*]/fcond, on: Component(id=HCNolm type=ionChannelHH), from gates; Component(id=r type=gateHHtauInf) ? multiply applied to all instances of fcond in: ([Component(id=r type=gateHHtauInf)])) - fopen0 = r_fcond ? path based, prefix = - + fopen0 = r_fcond ? path based, prefix = + fopen = conductanceScale * fopen0 ? evaluable g = conductance * fopen ? evaluable - gion = gmax * fopen - + gion = gmax * fopen + ih = gion * (v - eh) - + } DERIVATIVE states { rates() - r_q' = rate_r_q - + r_q' = rate_r_q + } PROCEDURE rates() { - + r_timeCourse_V = v / r_timeCourse_VOLT_SCALE ? evaluable r_timeCourse_t = ( 100 + (1 / (exp(-17.9 - 0.116* r_timeCourse_V ) + exp(-1.84 + 0.09* r_timeCourse_V ))) ) * r_timeCourse_TIME_SCALE ? evaluable r_steadyState_x = r_steadyState_rate / (1 + exp(0 - (v - r_steadyState_midpoint )/ r_steadyState_scale )) ? evaluable ? DerivedVariable is based on path: q10Settings[*]/q10, on: Component(id=r type=gateHHtauInf), from q10Settings; null ? Path not present in component, using factor: 1 - - r_rateScale = 1 - + + r_rateScale = 1 + r_fcond = r_q ^ r_instances ? evaluable ? DerivedVariable is based on path: steadyState/x, on: Component(id=r type=gateHHtauInf), from steadyState; Component(id=null type=HHSigmoidVariable) r_inf = r_steadyState_x ? path based, prefix = r_ - + ? DerivedVariable is based on path: timeCourse/t, on: Component(id=r type=gateHHtauInf), from timeCourse; Component(id=null type=Bezaire_HCNolm_tau) r_tauUnscaled = r_timeCourse_t ? path based, prefix = r_ - + r_tau = r_tauUnscaled / r_rateScale ? evaluable - - + + rate_r_q = ( r_inf - r_q ) / r_tau ? Note units of all quantities used here need to be consistent! - - - - - - - -} + + + + + + +} diff --git a/tests/neuron/test_data/mods/Kdrfast.mod b/tests/neuron/test_data/mods/Kdrfast.mod index 479ff8ca..b8c261bf 100644 --- a/tests/neuron/test_data/mods/Kdrfast.mod +++ b/tests/neuron/test_data/mods/Kdrfast.mod @@ -12,50 +12,50 @@ ENDCOMMENT NEURON { SUFFIX Kdrfast USEION k WRITE ik VALENCE 1 ? Assuming valence = 1; TODO check this!! - - RANGE gion + + RANGE gion RANGE gmax : Will be changed when ion channel mechanism placed on cell! RANGE conductance : parameter - + RANGE g : exposure - + RANGE fopen : exposure RANGE n_instances : parameter - + RANGE n_alpha : exposure - + RANGE n_beta : exposure - + RANGE n_tau : exposure - + RANGE n_inf : exposure - + RANGE n_rateScale : exposure - + RANGE n_fcond : exposure RANGE n_forwardRate_rate : parameter RANGE n_forwardRate_midpoint : parameter RANGE n_forwardRate_scale : parameter - + RANGE n_forwardRate_r : exposure RANGE n_reverseRate_TIME_SCALE : parameter RANGE n_reverseRate_VOLT_SCALE : parameter - + RANGE n_reverseRate_r : exposure RANGE n_q10Settings_q10Factor : parameter RANGE n_q10Settings_experimentalTemp : parameter RANGE n_q10Settings_TENDEGREES : parameter - + RANGE n_q10Settings_q10 : exposure RANGE n_forwardRate_x : derived variable RANGE n_reverseRate_V : derived variable RANGE conductanceScale : derived variable RANGE fopen0 : derived variable - + } UNITS { - + (nA) = (nanoamp) (uA) = (microamp) (mA) = (milliamp) @@ -69,148 +69,147 @@ UNITS { (um) = (micrometer) (umol) = (micromole) (S) = (siemens) - + } PARAMETER { - + gmax = 0 (S/cm2) : Will be changed when ion channel mechanism placed on cell! - + conductance = 1.0E-6 (uS) - n_instances = 4 + n_instances = 4 n_forwardRate_rate = 0.42000002 (kHz) n_forwardRate_midpoint = -18 (mV) n_forwardRate_scale = 6 (mV) n_reverseRate_TIME_SCALE = 1 (ms) n_reverseRate_VOLT_SCALE = 1 (mV) - n_q10Settings_q10Factor = 3 + n_q10Settings_q10Factor = 3 n_q10Settings_experimentalTemp = 307.15 (K) n_q10Settings_TENDEGREES = 10 (K) } ASSIGNED { - + gion (S/cm2) : Transient conductance density of the channel? Standard Assigned variables with ionChannel v (mV) celsius (degC) temperature (K) ek (mV) ik (mA/cm2) - - + + n_forwardRate_x : derived variable - + n_forwardRate_r (kHz) : conditional derived var... - + n_reverseRate_V : derived variable - + n_reverseRate_r (kHz) : derived variable - + n_q10Settings_q10 : derived variable - + n_rateScale : derived variable - + n_alpha (kHz) : derived variable - + n_beta (kHz) : derived variable - + n_fcond : derived variable - + n_inf : derived variable - + n_tau (ms) : derived variable - + conductanceScale : derived variable - + fopen0 : derived variable - + fopen : derived variable - + g (uS) : derived variable rate_n_q (/ms) - + } STATE { - n_q - + n_q + } INITIAL { ek = -77.0 - + temperature = celsius + 273.15 - + rates() rates() ? To ensure correct initialisation. - + n_q = n_inf - + } BREAKPOINT { - + SOLVE states METHOD cnexp - + ? DerivedVariable is based on path: conductanceScaling[*]/factor, on: Component(id=Kdrfast type=ionChannelHH), from conductanceScaling; null ? Path not present in component, using factor: 1 - - conductanceScale = 1 - + + conductanceScale = 1 + ? DerivedVariable is based on path: gates[*]/fcond, on: Component(id=Kdrfast type=ionChannelHH), from gates; Component(id=n type=gateHHrates) ? multiply applied to all instances of fcond in: ([Component(id=n type=gateHHrates)])) - fopen0 = n_fcond ? path based, prefix = - + fopen0 = n_fcond ? path based, prefix = + fopen = conductanceScale * fopen0 ? evaluable g = conductance * fopen ? evaluable - gion = gmax * fopen - + gion = gmax * fopen + ik = gion * (v - ek) - + } DERIVATIVE states { rates() - n_q' = rate_n_q - + n_q' = rate_n_q + } PROCEDURE rates() { - + n_forwardRate_x = (v - n_forwardRate_midpoint ) / n_forwardRate_scale ? evaluable - if (n_forwardRate_x != 0) { + if (n_forwardRate_x != 0) { n_forwardRate_r = n_forwardRate_rate * n_forwardRate_x / (1 - exp(0 - n_forwardRate_x )) ? evaluable cdv - } else if (n_forwardRate_x == 0) { + } else if (n_forwardRate_x == 0) { n_forwardRate_r = n_forwardRate_rate ? evaluable cdv } - + n_reverseRate_V = v / n_reverseRate_VOLT_SCALE ? evaluable n_reverseRate_r = ((0.264) / (exp(( n_reverseRate_V +43)/40))) / n_reverseRate_TIME_SCALE ? evaluable n_q10Settings_q10 = n_q10Settings_q10Factor ^((temperature - n_q10Settings_experimentalTemp )/ n_q10Settings_TENDEGREES ) ? evaluable ? DerivedVariable is based on path: q10Settings[*]/q10, on: Component(id=n type=gateHHrates), from q10Settings; Component(id=null type=q10ExpTemp) ? multiply applied to all instances of q10 in: ([Component(id=null type=q10ExpTemp)])) n_rateScale = n_q10Settings_q10 ? path based, prefix = n_ - + ? DerivedVariable is based on path: forwardRate/r, on: Component(id=n type=gateHHrates), from forwardRate; Component(id=null type=HHExpLinearRate) n_alpha = n_forwardRate_r ? path based, prefix = n_ - + ? DerivedVariable is based on path: reverseRate/r, on: Component(id=n type=gateHHrates), from reverseRate; Component(id=null type=Bezaire_Kdrfast_betaq) n_beta = n_reverseRate_r ? path based, prefix = n_ - + n_fcond = n_q ^ n_instances ? evaluable n_inf = n_alpha /( n_alpha + n_beta ) ? evaluable n_tau = 1/(( n_alpha + n_beta ) * n_rateScale ) ? evaluable - - + + rate_n_q = ( n_inf - n_q ) / n_tau ? Note units of all quantities used here need to be consistent! - - - - - - - - - -} + + + + + + + + +} diff --git a/tests/neuron/test_data/mods/KvAolm.mod b/tests/neuron/test_data/mods/KvAolm.mod index c26b66ac..d5863be7 100644 --- a/tests/neuron/test_data/mods/KvAolm.mod +++ b/tests/neuron/test_data/mods/KvAolm.mod @@ -12,48 +12,48 @@ ENDCOMMENT NEURON { SUFFIX KvAolm USEION k WRITE ik VALENCE 1 ? Assuming valence = 1; TODO check this!! - - RANGE gion + + RANGE gion RANGE gmax : Will be changed when ion channel mechanism placed on cell! RANGE conductance : parameter - + RANGE g : exposure - + RANGE fopen : exposure RANGE a_instances : parameter - + RANGE a_tau : exposure - + RANGE a_inf : exposure - + RANGE a_rateScale : exposure - + RANGE a_fcond : exposure RANGE a_timeCourse_tau : parameter - + RANGE a_timeCourse_t : exposure RANGE a_steadyState_rate : parameter RANGE a_steadyState_midpoint : parameter RANGE a_steadyState_scale : parameter - + RANGE a_steadyState_x : exposure RANGE b_instances : parameter - + RANGE b_tau : exposure - + RANGE b_inf : exposure - + RANGE b_rateScale : exposure - + RANGE b_fcond : exposure RANGE b_timeCourse_TIME_SCALE : parameter RANGE b_timeCourse_VOLT_SCALE : parameter - + RANGE b_timeCourse_t : exposure RANGE b_steadyState_rate : parameter RANGE b_steadyState_midpoint : parameter RANGE b_steadyState_scale : parameter - + RANGE b_steadyState_x : exposure RANGE a_tauUnscaled : derived variable RANGE b_timeCourse_V : derived variable @@ -62,11 +62,11 @@ NEURON { RANGE b_tauUnscaled : derived variable RANGE conductanceScale : derived variable RANGE fopen0 : derived variable - + } UNITS { - + (nA) = (nanoamp) (uA) = (microamp) (mA) = (milliamp) @@ -80,147 +80,147 @@ UNITS { (um) = (micrometer) (umol) = (micromole) (S) = (siemens) - + } PARAMETER { - + gmax = 0 (S/cm2) : Will be changed when ion channel mechanism placed on cell! - + conductance = 1.0E-6 (uS) - a_instances = 1 + a_instances = 1 a_timeCourse_tau = 5 (ms) - a_steadyState_rate = 1 + a_steadyState_rate = 1 a_steadyState_midpoint = -14 (mV) a_steadyState_scale = 16.6 (mV) - b_instances = 1 + b_instances = 1 b_timeCourse_TIME_SCALE = 1 (ms) b_timeCourse_VOLT_SCALE = 1 (mV) - b_steadyState_rate = 1 + b_steadyState_rate = 1 b_steadyState_midpoint = -71 (mV) b_steadyState_scale = -7.3 (mV) } ASSIGNED { - + gion (S/cm2) : Transient conductance density of the channel? Standard Assigned variables with ionChannel v (mV) celsius (degC) temperature (K) ek (mV) ik (mA/cm2) - - + + a_timeCourse_t (ms) : derived variable - + a_steadyState_x : derived variable - + a_rateScale : derived variable - + a_fcond : derived variable - + a_inf : derived variable - + a_tauUnscaled (ms) : derived variable - + a_tau (ms) : derived variable - + b_timeCourse_V : derived variable - + b_timeCourse_alpha : derived variable - + b_timeCourse_beta : derived variable - + b_timeCourse_t (ms) : derived variable - + b_steadyState_x : derived variable - + b_rateScale : derived variable - + b_fcond : derived variable - + b_inf : derived variable - + b_tauUnscaled (ms) : derived variable - + b_tau (ms) : derived variable - + conductanceScale : derived variable - + fopen0 : derived variable - + fopen : derived variable - + g (uS) : derived variable rate_a_q (/ms) rate_b_q (/ms) - + } STATE { - a_q - b_q - + a_q + b_q + } INITIAL { ek = -77.0 - + temperature = celsius + 273.15 - + rates() rates() ? To ensure correct initialisation. - + a_q = a_inf - + b_q = b_inf - + } BREAKPOINT { - + SOLVE states METHOD cnexp - + ? DerivedVariable is based on path: conductanceScaling[*]/factor, on: Component(id=KvAolm type=ionChannelHH), from conductanceScaling; null ? Path not present in component, using factor: 1 - - conductanceScale = 1 - + + conductanceScale = 1 + ? DerivedVariable is based on path: gates[*]/fcond, on: Component(id=KvAolm type=ionChannelHH), from gates; Component(id=a type=gateHHtauInf) ? multiply applied to all instances of fcond in: ([Component(id=a type=gateHHtauInf), Component(id=b type=gateHHtauInf)])) - fopen0 = a_fcond * b_fcond ? path based, prefix = - + fopen0 = a_fcond * b_fcond ? path based, prefix = + fopen = conductanceScale * fopen0 ? evaluable g = conductance * fopen ? evaluable - gion = gmax * fopen - + gion = gmax * fopen + ik = gion * (v - ek) - + } DERIVATIVE states { rates() - a_q' = rate_a_q - b_q' = rate_b_q - + a_q' = rate_a_q + b_q' = rate_b_q + } PROCEDURE rates() { - + a_timeCourse_t = a_timeCourse_tau ? evaluable a_steadyState_x = a_steadyState_rate / (1 + exp(0 - (v - a_steadyState_midpoint )/ a_steadyState_scale )) ? evaluable ? DerivedVariable is based on path: q10Settings[*]/q10, on: Component(id=a type=gateHHtauInf), from q10Settings; null ? Path not present in component, using factor: 1 - - a_rateScale = 1 - + + a_rateScale = 1 + a_fcond = a_q ^ a_instances ? evaluable ? DerivedVariable is based on path: steadyState/x, on: Component(id=a type=gateHHtauInf), from steadyState; Component(id=null type=HHSigmoidVariable) a_inf = a_steadyState_x ? path based, prefix = a_ - + ? DerivedVariable is based on path: timeCourse/t, on: Component(id=a type=gateHHtauInf), from timeCourse; Component(id=null type=fixedTimeCourse) a_tauUnscaled = a_timeCourse_t ? path based, prefix = a_ - + a_tau = a_tauUnscaled / a_rateScale ? evaluable b_timeCourse_V = v / b_timeCourse_VOLT_SCALE ? evaluable b_timeCourse_alpha = 0.000009 / exp(( b_timeCourse_V -26)/18.5) ? evaluable @@ -229,33 +229,32 @@ PROCEDURE rates() { b_steadyState_x = b_steadyState_rate / (1 + exp(0 - (v - b_steadyState_midpoint )/ b_steadyState_scale )) ? evaluable ? DerivedVariable is based on path: q10Settings[*]/q10, on: Component(id=b type=gateHHtauInf), from q10Settings; null ? Path not present in component, using factor: 1 - - b_rateScale = 1 - + + b_rateScale = 1 + b_fcond = b_q ^ b_instances ? evaluable ? DerivedVariable is based on path: steadyState/x, on: Component(id=b type=gateHHtauInf), from steadyState; Component(id=null type=HHSigmoidVariable) b_inf = b_steadyState_x ? path based, prefix = b_ - + ? DerivedVariable is based on path: timeCourse/t, on: Component(id=b type=gateHHtauInf), from timeCourse; Component(id=null type=Bezaire_KvAolm_taub) b_tauUnscaled = b_timeCourse_t ? path based, prefix = b_ - + b_tau = b_tauUnscaled / b_rateScale ? evaluable - - + + rate_a_q = ( a_inf - a_q ) / a_tau ? Note units of all quantities used here need to be consistent! - - - - - - + + + + + + rate_b_q = ( b_inf - b_q ) / b_tau ? Note units of all quantities used here need to be consistent! - - - - - - - -} + + + + + + +} diff --git a/tests/neuron/test_data/mods/Nav.mod b/tests/neuron/test_data/mods/Nav.mod index 7c1e06c5..56d88898 100644 --- a/tests/neuron/test_data/mods/Nav.mod +++ b/tests/neuron/test_data/mods/Nav.mod @@ -12,79 +12,79 @@ ENDCOMMENT NEURON { SUFFIX Nav USEION na WRITE ina VALENCE 1 ? Assuming valence = 1; TODO check this!! - - RANGE gion + + RANGE gion RANGE gmax : Will be changed when ion channel mechanism placed on cell! RANGE conductance : parameter - + RANGE g : exposure - + RANGE fopen : exposure RANGE m_instances : parameter - + RANGE m_alpha : exposure - + RANGE m_beta : exposure - + RANGE m_tau : exposure - + RANGE m_inf : exposure - + RANGE m_rateScale : exposure - + RANGE m_fcond : exposure RANGE m_forwardRate_rate : parameter RANGE m_forwardRate_midpoint : parameter RANGE m_forwardRate_scale : parameter - + RANGE m_forwardRate_r : exposure RANGE m_reverseRate_rate : parameter RANGE m_reverseRate_midpoint : parameter RANGE m_reverseRate_scale : parameter - + RANGE m_reverseRate_r : exposure RANGE m_q10Settings_q10Factor : parameter RANGE m_q10Settings_experimentalTemp : parameter RANGE m_q10Settings_TENDEGREES : parameter - + RANGE m_q10Settings_q10 : exposure RANGE h_instances : parameter - + RANGE h_alpha : exposure - + RANGE h_beta : exposure - + RANGE h_tau : exposure - + RANGE h_inf : exposure - + RANGE h_rateScale : exposure - + RANGE h_fcond : exposure RANGE h_forwardRate_TIME_SCALE : parameter RANGE h_forwardRate_VOLT_SCALE : parameter - + RANGE h_forwardRate_r : exposure RANGE h_reverseRate_rate : parameter RANGE h_reverseRate_midpoint : parameter RANGE h_reverseRate_scale : parameter - + RANGE h_reverseRate_r : exposure RANGE h_q10Settings_q10Factor : parameter RANGE h_q10Settings_experimentalTemp : parameter RANGE h_q10Settings_TENDEGREES : parameter - + RANGE h_q10Settings_q10 : exposure RANGE m_forwardRate_x : derived variable RANGE m_reverseRate_x : derived variable RANGE h_forwardRate_V : derived variable RANGE conductanceScale : derived variable RANGE fopen0 : derived variable - + } UNITS { - + (nA) = (nanoamp) (uA) = (microamp) (mA) = (milliamp) @@ -98,174 +98,174 @@ UNITS { (um) = (micrometer) (umol) = (micromole) (S) = (siemens) - + } PARAMETER { - + gmax = 0 (S/cm2) : Will be changed when ion channel mechanism placed on cell! - + conductance = 1.0E-6 (uS) - m_instances = 3 + m_instances = 3 m_forwardRate_rate = 1.5000001 (kHz) m_forwardRate_midpoint = -43 (mV) m_forwardRate_scale = 5 (mV) m_reverseRate_rate = 1.5000001 (kHz) m_reverseRate_midpoint = -15 (mV) m_reverseRate_scale = -5 (mV) - m_q10Settings_q10Factor = 3 + m_q10Settings_q10Factor = 3 m_q10Settings_experimentalTemp = 307.15 (K) m_q10Settings_TENDEGREES = 10 (K) - h_instances = 1 + h_instances = 1 h_forwardRate_TIME_SCALE = 1 (ms) h_forwardRate_VOLT_SCALE = 1 (mV) h_reverseRate_rate = 3.3300002 (kHz) h_reverseRate_midpoint = -12.5 (mV) h_reverseRate_scale = 10 (mV) - h_q10Settings_q10Factor = 3 + h_q10Settings_q10Factor = 3 h_q10Settings_experimentalTemp = 307.15 (K) h_q10Settings_TENDEGREES = 10 (K) } ASSIGNED { - + gion (S/cm2) : Transient conductance density of the channel? Standard Assigned variables with ionChannel v (mV) celsius (degC) temperature (K) ena (mV) ina (mA/cm2) - - + + m_forwardRate_x : derived variable - + m_forwardRate_r (kHz) : conditional derived var... - + m_reverseRate_x : derived variable - + m_reverseRate_r (kHz) : conditional derived var... - + m_q10Settings_q10 : derived variable - + m_rateScale : derived variable - + m_alpha (kHz) : derived variable - + m_beta (kHz) : derived variable - + m_fcond : derived variable - + m_inf : derived variable - + m_tau (ms) : derived variable - + h_forwardRate_V : derived variable - + h_forwardRate_r (kHz) : derived variable - + h_reverseRate_r (kHz) : derived variable - + h_q10Settings_q10 : derived variable - + h_rateScale : derived variable - + h_alpha (kHz) : derived variable - + h_beta (kHz) : derived variable - + h_fcond : derived variable - + h_inf : derived variable - + h_tau (ms) : derived variable - + conductanceScale : derived variable - + fopen0 : derived variable - + fopen : derived variable - + g (uS) : derived variable rate_m_q (/ms) rate_h_q (/ms) - + } STATE { - m_q - h_q - + m_q + h_q + } INITIAL { ena = 50.0 - + temperature = celsius + 273.15 - + rates() rates() ? To ensure correct initialisation. - + m_q = m_inf - + h_q = h_inf - + } BREAKPOINT { - + SOLVE states METHOD cnexp - + ? DerivedVariable is based on path: conductanceScaling[*]/factor, on: Component(id=Nav type=ionChannelHH), from conductanceScaling; null ? Path not present in component, using factor: 1 - - conductanceScale = 1 - + + conductanceScale = 1 + ? DerivedVariable is based on path: gates[*]/fcond, on: Component(id=Nav type=ionChannelHH), from gates; Component(id=m type=gateHHrates) ? multiply applied to all instances of fcond in: ([Component(id=m type=gateHHrates), Component(id=h type=gateHHrates)])) - fopen0 = m_fcond * h_fcond ? path based, prefix = - + fopen0 = m_fcond * h_fcond ? path based, prefix = + fopen = conductanceScale * fopen0 ? evaluable g = conductance * fopen ? evaluable - gion = gmax * fopen - + gion = gmax * fopen + ina = gion * (v - ena) - + } DERIVATIVE states { rates() - m_q' = rate_m_q - h_q' = rate_h_q - + m_q' = rate_m_q + h_q' = rate_h_q + } PROCEDURE rates() { - + m_forwardRate_x = (v - m_forwardRate_midpoint ) / m_forwardRate_scale ? evaluable - if (m_forwardRate_x != 0) { + if (m_forwardRate_x != 0) { m_forwardRate_r = m_forwardRate_rate * m_forwardRate_x / (1 - exp(0 - m_forwardRate_x )) ? evaluable cdv - } else if (m_forwardRate_x == 0) { + } else if (m_forwardRate_x == 0) { m_forwardRate_r = m_forwardRate_rate ? evaluable cdv } - + m_reverseRate_x = (v - m_reverseRate_midpoint ) / m_reverseRate_scale ? evaluable - if (m_reverseRate_x != 0) { + if (m_reverseRate_x != 0) { m_reverseRate_r = m_reverseRate_rate * m_reverseRate_x / (1 - exp(0 - m_reverseRate_x )) ? evaluable cdv - } else if (m_reverseRate_x == 0) { + } else if (m_reverseRate_x == 0) { m_reverseRate_r = m_reverseRate_rate ? evaluable cdv } - + m_q10Settings_q10 = m_q10Settings_q10Factor ^((temperature - m_q10Settings_experimentalTemp )/ m_q10Settings_TENDEGREES ) ? evaluable ? DerivedVariable is based on path: q10Settings[*]/q10, on: Component(id=m type=gateHHrates), from q10Settings; Component(id=null type=q10ExpTemp) ? multiply applied to all instances of q10 in: ([Component(id=null type=q10ExpTemp)])) m_rateScale = m_q10Settings_q10 ? path based, prefix = m_ - + ? DerivedVariable is based on path: forwardRate/r, on: Component(id=m type=gateHHrates), from forwardRate; Component(id=null type=HHExpLinearRate) m_alpha = m_forwardRate_r ? path based, prefix = m_ - + ? DerivedVariable is based on path: reverseRate/r, on: Component(id=m type=gateHHrates), from reverseRate; Component(id=null type=HHExpLinearRate) m_beta = m_reverseRate_r ? path based, prefix = m_ - + m_fcond = m_q ^ m_instances ? evaluable m_inf = m_alpha /( m_alpha + m_beta ) ? evaluable m_tau = 1/(( m_alpha + m_beta ) * m_rateScale ) ? evaluable @@ -276,36 +276,35 @@ PROCEDURE rates() { ? DerivedVariable is based on path: q10Settings[*]/q10, on: Component(id=h type=gateHHrates), from q10Settings; Component(id=null type=q10ExpTemp) ? multiply applied to all instances of q10 in: ([Component(id=null type=q10ExpTemp)])) h_rateScale = h_q10Settings_q10 ? path based, prefix = h_ - + ? DerivedVariable is based on path: forwardRate/r, on: Component(id=h type=gateHHrates), from forwardRate; Component(id=null type=Bezaire_Nav_alphah) h_alpha = h_forwardRate_r ? path based, prefix = h_ - + ? DerivedVariable is based on path: reverseRate/r, on: Component(id=h type=gateHHrates), from reverseRate; Component(id=null type=HHSigmoidRate) h_beta = h_reverseRate_r ? path based, prefix = h_ - + h_fcond = h_q ^ h_instances ? evaluable h_inf = h_alpha /( h_alpha + h_beta ) ? evaluable h_tau = 1/(( h_alpha + h_beta ) * h_rateScale ) ? evaluable - - + + rate_m_q = ( m_inf - m_q ) / m_tau ? Note units of all quantities used here need to be consistent! - - - - - - - - + + + + + + + + rate_h_q = ( h_inf - h_q ) / h_tau ? Note units of all quantities used here need to be consistent! - - - - - - - - - -} + + + + + + + + +} diff --git a/tests/neuron/test_data/mods/leak_chan.mod b/tests/neuron/test_data/mods/leak_chan.mod index 5217ea7b..ce4218c7 100644 --- a/tests/neuron/test_data/mods/leak_chan.mod +++ b/tests/neuron/test_data/mods/leak_chan.mod @@ -13,19 +13,19 @@ NEURON { SUFFIX leak_chan NONSPECIFIC_CURRENT i RANGE e - - RANGE gion + + RANGE gion RANGE gmax : Will be changed when ion channel mechanism placed on cell! RANGE conductance : parameter - + RANGE g : exposure - + RANGE fopen : exposure - + } UNITS { - + (nA) = (nanoamp) (uA) = (microamp) (mA) = (milliamp) @@ -39,59 +39,58 @@ UNITS { (um) = (micrometer) (umol) = (micromole) (S) = (siemens) - + } PARAMETER { - + gmax = 0 (S/cm2) : Will be changed when ion channel mechanism placed on cell! - + conductance = 1.0E-6 (uS) } ASSIGNED { - + gion (S/cm2) : Transient conductance density of the channel? Standard Assigned variables with ionChannel v (mV) celsius (degC) temperature (K) e (mV) i (mA/cm2) - - + + fopen : derived variable - + g (uS) : derived variable - + } STATE { - + } INITIAL { temperature = celsius + 273.15 - + rates() rates() ? To ensure correct initialisation. - + } BREAKPOINT { - + rates() fopen = 1 ? evaluable g = conductance ? evaluable - gion = gmax * fopen - + gion = gmax * fopen + i = gion * (v - e) - + } PROCEDURE rates() { - - - - -} + + + +} diff --git a/tests/neuron/test_data/olm.hoc b/tests/neuron/test_data/olm.hoc index 1564d307..a281536e 100644 --- a/tests/neuron/test_data/olm.hoc +++ b/tests/neuron/test_data/olm.hoc @@ -347,5 +347,3 @@ proc position() { local i endtemplate olm - - diff --git a/tests/neuron/test_neuron_utils.py b/tests/neuron/test_neuron_utils.py index 8afb10b6..4552d5cb 100644 --- a/tests/neuron/test_neuron_utils.py +++ b/tests/neuron/test_neuron_utils.py @@ -7,31 +7,28 @@ Copyright 2023 NeuroML contributors """ - -import unittest import logging -import tempfile -import pytest import pathlib +import tempfile +import unittest +import pytest from pyneuroml.neuron import ( - load_hoc_or_python_file, - morphinfo, + export_mod_to_neuroml2, get_utils_hoc, getinfo, - export_mod_to_neuroml2, + load_hoc_or_python_file, + morphinfo, ) from . import load_olm_cell - logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) class TestNeuronUtils(unittest.TestCase): - """Test Neuron Utils""" def test_hoc_loader(self): diff --git a/tests/plot/CaDynamics.nml b/tests/plot/CaDynamics.nml index 56f4242a..64f34820 100644 --- a/tests/plot/CaDynamics.nml +++ b/tests/plot/CaDynamics.nml @@ -1,15 +1,15 @@ - NeuroML 2 implementation of the Ca Pool mechanism - + - + - + @@ -37,7 +37,7 @@ - + @@ -53,7 +53,7 @@ - + diff --git a/tests/plot/CaDynamics_all.nml b/tests/plot/CaDynamics_all.nml index dd338295..207b2788 100644 --- a/tests/plot/CaDynamics_all.nml +++ b/tests/plot/CaDynamics_all.nml @@ -20,4 +20,4 @@ - \ No newline at end of file + diff --git a/tests/plot/Ca_HVA.channel.nml b/tests/plot/Ca_HVA.channel.nml index acacf383..394ce1dd 100644 --- a/tests/plot/Ca_HVA.channel.nml +++ b/tests/plot/Ca_HVA.channel.nml @@ -5,17 +5,17 @@ - High voltage activated Ca2+ current. + High voltage activated Ca2+ current. NOTE: Most Allen Institute channel models from Hay et al. 2011 use Q10 scaling. This one doesn't... See https://github.com/OpenSourceBrain/AllenInstituteNeuroML/issues/2 - -Comment from original mod file: + +Comment from original mod file: Reuveni, Friedman, Amitai, and Gutnick, J.Neurosci. 1993 - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -24,7 +24,7 @@ Reuveni, Friedman, Amitai, and Gutnick, J.Neurosci. 1993 - + Calcium channels @@ -45,7 +45,7 @@ Reuveni, Friedman, Amitai, and Gutnick, J.Neurosci. 1993 - + diff --git a/tests/plot/Ca_LVA.channel.nml b/tests/plot/Ca_LVA.channel.nml index db2ee055..eb67be8d 100644 --- a/tests/plot/Ca_LVA.channel.nml +++ b/tests/plot/Ca_LVA.channel.nml @@ -7,18 +7,18 @@ Low voltage activated Ca2+ current Modified slightly for Allen Institute cell models from Hay et al. 2011 version: - - Added Q10 scaling to rate variables - -Comment from original mod file: + - Added Q10 scaling to rate variables + +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 - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -27,7 +27,7 @@ Note: mtau is an approximation from the plots - + Ca channels @@ -50,7 +50,7 @@ Note: mtau is an approximation from the plots - + diff --git a/tests/plot/Cell_497232312.cell.nml b/tests/plot/Cell_497232312.cell.nml index 5cd3cbad..2669cb40 100644 --- a/tests/plot/Cell_497232312.cell.nml +++ b/tests/plot/Cell_497232312.cell.nml @@ -14137,8 +14137,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -14451,8 +14451,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -14564,8 +14564,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -14700,8 +14700,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -14759,8 +14759,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -14887,8 +14887,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -15017,8 +15017,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -15094,8 +15094,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -15140,8 +15140,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -15242,8 +15242,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -15318,8 +15318,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -15428,8 +15428,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -15606,8 +15606,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -15706,8 +15706,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -15782,8 +15782,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -15851,8 +15851,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -15990,8 +15990,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16110,8 +16110,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16222,8 +16222,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16302,8 +16302,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16342,8 +16342,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16415,8 +16415,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16473,8 +16473,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16550,8 +16550,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16624,8 +16624,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16692,8 +16692,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16753,8 +16753,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16800,8 +16800,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16867,8 +16867,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -16957,8 +16957,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17009,8 +17009,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17087,8 +17087,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17155,8 +17155,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17236,8 +17236,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17281,8 +17281,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17353,8 +17353,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17472,8 +17472,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17538,8 +17538,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17629,8 +17629,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17772,8 +17772,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17836,8 +17836,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17887,8 +17887,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -17958,8 +17958,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -18056,8 +18056,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + @@ -18163,8 +18163,8 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections. - - + + diff --git a/tests/plot/Ih.channel.nml b/tests/plot/Ih.channel.nml index 5b980df2..4f47efff 100644 --- a/tests/plot/Ih.channel.nml +++ b/tests/plot/Ih.channel.nml @@ -6,14 +6,14 @@ Non-specific cation current - -Comment from original mod file: + +Comment from original mod file: Reference : : Kole,Hallermann,and Stuart, J. Neurosci. 2006 - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -30,7 +30,7 @@ Reference : : Kole,Hallermann,and Stuart, J. Neurosci. 2006 - + diff --git a/tests/plot/Im.channel.nml b/tests/plot/Im.channel.nml index 1a4a9d1d..6ba1a676 100644 --- a/tests/plot/Im.channel.nml +++ b/tests/plot/Im.channel.nml @@ -7,16 +7,16 @@ Muscarinic K+ current Modified slightly for Allen Institute cell models from Hay et al. 2011 version: - - Added Q10 scaling to rate variables - -Comment from original mod file: + - Added Q10 scaling to rate variables + +Comment from original mod file: :Reference : : Adams et al. 1982 - M-currents and other potassium currents in bullfrog sympathetic neurones :Comment: corrected rates using q10 = 2.3, target temperature 34, orginal 21 - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -25,7 +25,7 @@ Comment from original mod file: - + K channels @@ -42,7 +42,7 @@ Comment from original mod file: - + diff --git a/tests/plot/Im_v2.channel.nml b/tests/plot/Im_v2.channel.nml index 14bcf88f..265982a6 100644 --- a/tests/plot/Im_v2.channel.nml +++ b/tests/plot/Im_v2.channel.nml @@ -6,14 +6,14 @@ Im current - -Comment from original mod file: + +Comment from original mod file: Based on Im model of Vervaeke et al. (2006) - + Kv7/KCNQ/M-channels in rat glutamatergic hippocampal axons and their role in regulation of excitability and transmitter release, @@ -22,7 +22,7 @@ Based on Im model of Vervaeke et al. (2006) - + K channels @@ -33,18 +33,18 @@ Based on Im model of Vervaeke et al. (2006) - - + + - + - - + + diff --git a/tests/plot/Izh2007Cells.net.nml b/tests/plot/Izh2007Cells.net.nml index 87cb8f17..bdb4f248 100644 --- a/tests/plot/Izh2007Cells.net.nml +++ b/tests/plot/Izh2007Cells.net.nml @@ -7,29 +7,29 @@ Regular spiking cell - Weakly adapting cell - + Strongly adapting cell Low threshold spiking cell @@ -55,7 +55,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -79,19 +79,19 @@ - + - + - + - + - + - \ No newline at end of file + diff --git a/tests/plot/K_P.channel.nml b/tests/plot/K_P.channel.nml index 45415ab1..adb0ef7e 100644 --- a/tests/plot/K_P.channel.nml +++ b/tests/plot/K_P.channel.nml @@ -1,7 +1,7 @@ - NeuroML file containing a single Channel description @@ -10,19 +10,19 @@ Slow inactivating K+ current Modified slightly for Allen Institute cell models from Hay et al. 2011 version: - - Added Q10 scaling to rate variables + - Added Q10 scaling to rate variables - Equations for tau/inf updated to match mod - -Comment from original mod file: + +Comment from original mod file: :Comment : The persistent component of the K current :Reference : : Voltage-gated K+ channels in layer 5 neocortical pyramidal neurones from young rats:subtypes and gradients,Korngreen and Sakmann, J. Physiology, 2000 :Comment : shifted -10 mv to correct for junction potential :Comment: corrected rates using q10 = 2.3, target temperature 34, orginal 21 - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -31,7 +31,7 @@ Comment from original mod file: - + K channels @@ -54,7 +54,7 @@ Comment from original mod file: - + diff --git a/tests/plot/K_T.channel.nml b/tests/plot/K_T.channel.nml index 24c3c24d..54a6018f 100644 --- a/tests/plot/K_T.channel.nml +++ b/tests/plot/K_T.channel.nml @@ -1,7 +1,7 @@ - NeuroML file containing a single Channel description @@ -10,19 +10,19 @@ Fast inactivating K+ current Modified slightly for Allen Institute cell models from Hay et al. 2011 version: - - Added Q10 scaling to rate variables + - Added Q10 scaling to rate variables - Equations for tau/inf updated to match mod - -Comment from original mod file: + +Comment from original mod file: :Comment : The transient component of the K current :Reference : : Voltage-gated K+ channels in layer 5 neocortical pyramidal neurones from young rats:subtypes and gradients,Korngreen and Sakmann, J. Physiology, 2000 :Comment : shifted -10 mv to correct for junction potential :Comment: corrected rates using q10 = 2.3, target temperature 34, orginal 21 - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -31,7 +31,7 @@ Comment from original mod file: - + K channels @@ -54,7 +54,7 @@ Comment from original mod file: - + diff --git a/tests/plot/Kd.channel.nml b/tests/plot/Kd.channel.nml index f8801aa2..1ee6dff2 100644 --- a/tests/plot/Kd.channel.nml +++ b/tests/plot/Kd.channel.nml @@ -6,14 +6,14 @@ Kd current - -Comment from original mod file: + +Comment from original mod file: Based on Kd model of Foust et al. (2011) - + Somatic membrane potential and Kv1 channels control spike repolarization in cortical axon collaterals and presynaptic boutons @@ -22,7 +22,7 @@ Based on Kd model of Foust et al. (2011) - + K channels @@ -33,7 +33,7 @@ Based on Kd model of Foust et al. (2011) - + @@ -47,7 +47,7 @@ Based on Kd model of Foust et al. (2011) - + diff --git a/tests/plot/Kv2like.channel.nml b/tests/plot/Kv2like.channel.nml index 6e6a4c8a..aa704474 100644 --- a/tests/plot/Kv2like.channel.nml +++ b/tests/plot/Kv2like.channel.nml @@ -6,16 +6,16 @@ Kv2-like channel - -Comment from original mod file: + +Comment from original mod file: : Kv2-like channel : Adapted from model implemented in Keren et al. 2005 : Adjusted parameters to be similar to guangxitoxin-sensitive current in mouse CA1 pyramids from Liu and Bean 2014 - + - + Constraining compartmental models using multiple voltage recordings and genetic algorithms. @@ -25,14 +25,14 @@ Comment from original mod file: - Kv2 channel regulation of action potential repolarization and firing patterns + Kv2 channel regulation of action potential repolarization and firing patterns in superior cervical ganglion neurons and hippocampal CA1 pyramidal neurons. Liu PW, Bean BP. J Neurosci. 2014 Apr 2;34(14):4991-5002. - + K channels @@ -52,7 +52,7 @@ Comment from original mod file: - + @@ -64,9 +64,9 @@ Comment from original mod file: - + - + diff --git a/tests/plot/Kv3_1.channel.nml b/tests/plot/Kv3_1.channel.nml index c32df899..0127f49a 100644 --- a/tests/plot/Kv3_1.channel.nml +++ b/tests/plot/Kv3_1.channel.nml @@ -6,14 +6,14 @@ Fast, non inactivating K+ current (Kv3-like) - -Comment from original mod file: + +Comment from original mod file: :Reference : : Characterization of a Shaw-related potassium channel family in rat brain, The EMBO Journal, vol.11, no.7,2473-2486 (1992) - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -22,7 +22,7 @@ Comment from original mod file: - + K channels @@ -38,7 +38,7 @@ Comment from original mod file: - + diff --git a/tests/plot/L23-example/TestNetwork.net.nml b/tests/plot/L23-example/TestNetwork.net.nml index 9648271e..8a68e562 100644 --- a/tests/plot/L23-example/TestNetwork.net.nml +++ b/tests/plot/L23-example/TestNetwork.net.nml @@ -2,7 +2,7 @@ Generated by NeuroMLlite v0.5.3 Generated network: TestNetwork Generation seed: 1234 - NeuroMLlite parameters: + NeuroMLlite parameters: average_rate = 100 Hz num_HL23PV = 1 num_HL23PYR = 1 diff --git a/tests/plot/L23-example/channels/Ca_HVA.channel.nml b/tests/plot/L23-example/channels/Ca_HVA.channel.nml index 4219413d..055c1e43 100644 --- a/tests/plot/L23-example/channels/Ca_HVA.channel.nml +++ b/tests/plot/L23-example/channels/Ca_HVA.channel.nml @@ -5,15 +5,15 @@ - High voltage activated Ca2+ current. - -Comment from original mod file: + High voltage activated Ca2+ current. + +Comment from original mod file: Reuveni, Friedman, Amitai, and Gutnick, J.Neurosci. 1993 - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -22,7 +22,7 @@ Reuveni, Friedman, Amitai, and Gutnick, J.Neurosci. 1993 - + Calcium channels @@ -43,7 +43,7 @@ Reuveni, Friedman, Amitai, and Gutnick, J.Neurosci. 1993 - + diff --git a/tests/plot/L23-example/channels/Ih.channel.nml b/tests/plot/L23-example/channels/Ih.channel.nml index 5b980df2..4f47efff 100644 --- a/tests/plot/L23-example/channels/Ih.channel.nml +++ b/tests/plot/L23-example/channels/Ih.channel.nml @@ -6,14 +6,14 @@ Non-specific cation current - -Comment from original mod file: + +Comment from original mod file: Reference : : Kole,Hallermann,and Stuart, J. Neurosci. 2006 - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -30,7 +30,7 @@ Reference : : Kole,Hallermann,and Stuart, J. Neurosci. 2006 - + diff --git a/tests/plot/L23-example/channels/Im.channel.nml b/tests/plot/L23-example/channels/Im.channel.nml index 0dd18fec..3c5a1a9e 100644 --- a/tests/plot/L23-example/channels/Im.channel.nml +++ b/tests/plot/L23-example/channels/Im.channel.nml @@ -6,15 +6,15 @@ Muscarinic K+ current - -Comment from original mod file: + +Comment from original mod file: :Reference : : Adams et al. 1982 - M-currents and other potassium currents in bullfrog sympathetic neurones :Comment: corrected rates using q10 = 2.3, target temperature 34, orginal 21 - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -23,7 +23,7 @@ Comment from original mod file: - + K channels @@ -40,7 +40,7 @@ Comment from original mod file: - + diff --git a/tests/plot/L23-example/channels/pas.channel.nml b/tests/plot/L23-example/channels/pas.channel.nml index 02de1f44..41308e61 100644 --- a/tests/plot/L23-example/channels/pas.channel.nml +++ b/tests/plot/L23-example/channels/pas.channel.nml @@ -7,7 +7,7 @@ Simple example of a leak/passive conductance. Note: for GENESIS cells with a single leak conductance, it is better to use the Rm and Em variables for a passive current. - + diff --git a/tests/plot/NaTa.channel.nml b/tests/plot/NaTa.channel.nml index 9c85eda1..225dab40 100644 --- a/tests/plot/NaTa.channel.nml +++ b/tests/plot/NaTa.channel.nml @@ -1,7 +1,7 @@ - NeuroML file containing a single Channel description @@ -10,16 +10,16 @@ Fast inactivating Na+ current Modified slightly for Allen Institute cell models from Hay et al. 2011 version: - - Added Q10 scaling to rate variables - - Values for midpoint changed to match mod - -Comment from original mod file: + - Added Q10 scaling to rate variables + - Values for midpoint changed to match mod + +Comment from original mod file: :Reference :Colbert and Pan 2002 - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -28,7 +28,7 @@ Comment from original mod file: - + Na channels @@ -51,7 +51,7 @@ Comment from original mod file: - + diff --git a/tests/plot/NaTs.channel.nml b/tests/plot/NaTs.channel.nml index 5db143cb..6212a61a 100644 --- a/tests/plot/NaTs.channel.nml +++ b/tests/plot/NaTs.channel.nml @@ -1,25 +1,25 @@ - - + NeuroML file containing a single Channel description - Fast inactivating Na+ current. + Fast inactivating Na+ current. Modified slightly for Allen Institute cell models from Hay et al. 2011 version: - - Added Q10 scaling to rate variables - - Values for midpoint changed to match mod - + - Added Q10 scaling to rate variables + - Values for midpoint changed to match mod + Comment from mod file (NaTs2_t.mod): took the NaTa and shifted both activation/inactivation by 6 mv - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -28,7 +28,7 @@ Comment from mod file (NaTs2_t.mod): took the NaTa and shifted both activation/i - + Na channels @@ -51,7 +51,7 @@ Comment from mod file (NaTs2_t.mod): took the NaTa and shifted both activation/i - + diff --git a/tests/plot/NaV.channel.nml b/tests/plot/NaV.channel.nml index 09780202..b9d05063 100644 --- a/tests/plot/NaV.channel.nml +++ b/tests/plot/NaV.channel.nml @@ -1,7 +1,7 @@ - @@ -10,11 +10,11 @@ Mouse sodium current : Kinetics of Carter et al. (2012) : Based on 37 degC recordings from mouse hippocampal CA1 pyramids - + - + Na channels @@ -26,160 +26,160 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - - + + - - - - - - - + + + + + + + - + - + @@ -188,16 +188,16 @@ - + - - - - - + + + + + - + @@ -206,6 +206,6 @@ - + diff --git a/tests/plot/Nap.channel.nml b/tests/plot/Nap.channel.nml index 5b22b261..63570a0c 100644 --- a/tests/plot/Nap.channel.nml +++ b/tests/plot/Nap.channel.nml @@ -8,18 +8,18 @@ Persistent Na+ current Modified for Allen Institute cell models from Hay et al. 2011 version: - Form of conductance expression changed from: g = gbar * m^3 * h to: g = gbar * minf * h (comment in mod: assuming instantaneous activation as modeled by Magistretti and Alonso) -- Added Q10 scaling to rate variables +- Added Q10 scaling to rate variables -Comment from original mod file: +Comment from original mod file: :Comment : mtau deduced from text (said to be 6 times faster than for NaTa) :Comment : so I used the equations from NaT and multiplied by 6 :Reference : Modeled according to kinetics derived from Magistretti and Alonso 1999 :Comment: corrected rates using q10 = 2.3, target temperature 34, orginal 21 - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -28,7 +28,7 @@ Comment from original mod file: - + Na channels @@ -50,7 +50,7 @@ Comment from original mod file: - + diff --git a/tests/plot/SK.channel.nml b/tests/plot/SK.channel.nml index 5d940d61..2c87db61 100644 --- a/tests/plot/SK.channel.nml +++ b/tests/plot/SK.channel.nml @@ -6,15 +6,15 @@ Small-conductance, Ca2+ activated K+ current - -Comment from original mod file: + +Comment from original mod file: : SK-type calcium-activated potassium current : Reference : Kohler et al. 1996 - + - + Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of Dendritic and Perisomatic Active Properties, @@ -23,7 +23,7 @@ Comment from original mod file: - + K channels @@ -39,7 +39,7 @@ Comment from original mod file: - + diff --git a/tests/plot/olm-example/HCNolm.channel.nml b/tests/plot/olm-example/HCNolm.channel.nml index 084aa197..895c6e3d 100755 --- a/tests/plot/olm-example/HCNolm.channel.nml +++ b/tests/plot/olm-example/HCNolm.channel.nml @@ -4,21 +4,21 @@ NeuroML file containing a single ion channel - + Hyperpolarization-activated, CN-gated h channel description (from Lawrence 2006) - + - + - - + + - + @@ -29,4 +29,4 @@ - \ No newline at end of file + diff --git a/tests/plot/olm-example/Kdrfast.channel.nml b/tests/plot/olm-example/Kdrfast.channel.nml index ba2eeecb..819f6b8e 100755 --- a/tests/plot/olm-example/Kdrfast.channel.nml +++ b/tests/plot/olm-example/Kdrfast.channel.nml @@ -4,30 +4,30 @@ NeuroML file containing a single ion channel - + Fast delayed rectifier K+ channel description (from Yuen and Durand 1991, modeled by Marianne Bezaire) - + - + - - + + - + - + - - + + - + - - \ No newline at end of file + + diff --git a/tests/plot/olm-example/KvAolm.channel.nml b/tests/plot/olm-example/KvAolm.channel.nml index 416972bb..cbd0fa3f 100755 --- a/tests/plot/olm-example/KvAolm.channel.nml +++ b/tests/plot/olm-example/KvAolm.channel.nml @@ -1,35 +1,35 @@ - + NeuroML file containing a single ion channel - + A-type K+ channel description (from Zhang and McBain 1995, Martina 1998, Warman 1994 - modeled by Marianne Bezaire) - + - + - + - - + + - + - + @@ -38,5 +38,5 @@ - + diff --git a/tests/plot/olm-example/Nav.channel.nml b/tests/plot/olm-example/Nav.channel.nml index c4e056b4..b28b6349 100755 --- a/tests/plot/olm-example/Nav.channel.nml +++ b/tests/plot/olm-example/Nav.channel.nml @@ -4,37 +4,37 @@ NeuroML file containing a single ion channel - + Na+ channel description (modeled by Marianne Bezaire) - + - - + + - + - - + + - + - - + + - + - + - - - + + + - + - - \ No newline at end of file + + diff --git a/tests/plot/olm-example/leak_chan.channel.nml b/tests/plot/olm-example/leak_chan.channel.nml index 5a430360..9db16996 100755 --- a/tests/plot/olm-example/leak_chan.channel.nml +++ b/tests/plot/olm-example/leak_chan.channel.nml @@ -4,5 +4,5 @@ NeuroML file containing a single passive Channel description - + diff --git a/tests/plot/pas.channel.nml b/tests/plot/pas.channel.nml index 881a1cca..cb837f5b 100644 --- a/tests/plot/pas.channel.nml +++ b/tests/plot/pas.channel.nml @@ -6,7 +6,7 @@ Simple example of a leak/passive conductance. - + diff --git a/tests/plot/test_plot.py b/tests/plot/test_plot.py index fe1083fb..f2ccb9ab 100644 --- a/tests/plot/test_plot.py +++ b/tests/plot/test_plot.py @@ -7,13 +7,15 @@ Copyright 2023 NeuroML contributors """ -import random -import pytest -import unittest import logging import pathlib as pl +import random +import unittest + +import pytest + +from pyneuroml.plot import generate_interactive_plot, generate_plot -from pyneuroml.plot import generate_plot, generate_interactive_plot from .. import BaseTestCase logger = logging.getLogger(__name__) diff --git a/tests/plot/test_plot_time_series.py b/tests/plot/test_plot_time_series.py index d7ffd097..9308e958 100644 --- a/tests/plot/test_plot_time_series.py +++ b/tests/plot/test_plot_time_series.py @@ -7,14 +7,14 @@ Copyright 2024 NeuroML contributors """ - +import logging import os +import tempfile import unittest import numpy -import logging + import pyneuroml.plot.PlotTimeSeries as pyplts -import tempfile from .. import BaseTestCase diff --git a/tests/tellurium/do_test_tellurium.py b/tests/tellurium/do_test_tellurium.py index 2cc020b6..da129ff6 100644 --- a/tests/tellurium/do_test_tellurium.py +++ b/tests/tellurium/do_test_tellurium.py @@ -8,11 +8,10 @@ as pytest is segfaulting """ +import os from pyneuroml import tellurium -import os - def test_run_tellurium_on_valid_file(): "ensure it runs a basic sedml file without error" diff --git a/tests/test_nsgr.py b/tests/test_nsgr.py index 22cdec81..0437be8b 100644 --- a/tests/test_nsgr.py +++ b/tests/test_nsgr.py @@ -7,7 +7,6 @@ Copyright 2024 NeuroML contributors """ - import logging import pathlib as pl diff --git a/tests/test_pynml.py b/tests/test_pynml.py index 72b32008..3435f9a4 100644 --- a/tests/test_pynml.py +++ b/tests/test_pynml.py @@ -28,7 +28,6 @@ class TestJarUtils(unittest.TestCase): - """Test jNeuroML jar related functions""" def test_lems_def_files_extraction(self): @@ -53,7 +52,6 @@ def test_lems_def_files_extraction(self): class TestHelperUtils(unittest.TestCase): - """Test helper utilities.""" def test_exposure_listing(self):