I have a query, as follows:
Background: There is a detailed validated model in hoc with several mod files for ion channels. These ion channels access FUNCTION_TABLE (Tautables) from a hoc file. I am rebuilding this existing model from scratch in Python. However, I am stuck with a fatal error.
Issue: To figure out the error, I have made a simplified dummy model in Python with a tautable for the NaF channel in tautable.hoc file. The NaF channel is getting inserted and the gui is opening but when I initialize and/or run, the entire NEURON crashes. The validated hoc model works perfectly but the Python model doesn’t.
Additionally, I am able to print values (in Spyder IPython shell) from the hoc vectors present in ‘tautable.hoc’ indicating h.load_file has worked.
Python code for dummy model:
Code: Select all
from neuron import h, gui
h.load_file("tautable.hoc")
soma = h.Section(name='cell_soma')
#GEOMETRY
soma.insert('NaF')
soma.L = soma.diam = 12.6157
#Biophysical mechanisms
soma.Ra = 100
soma.cm = 1
h.psection()
Code: Select all
objref vecv_NaF, vecmtau_NaF, vechtau_NaF
vecv_NaF = new Vector()
vecv_NaF.indgen(-90, 30, 10)
vecmtau_NaF = new Vector()
vecmtau_NaF.append(0.02,0.023,0.03,0.037,0.043,0.067,0.107,0.053,0.05,0.04,0.027,0.02,0.02)
table_tabmtau_NaF(&vecmtau_NaF.x[0], vecv_NaF.size, &vecv_NaF.x[0])
vechtau_NaF = new Vector()
vechtau_NaF.append(0.433,0.433,0.433,0.433,0.433,0.433,0.433,0.283,0.167,0.15,0.107,0.1,0.093)
table_tabhtau_NaF(&vechtau_NaF.x[0], vecv_NaF.size, &vecv_NaF.x[0])
Code: Select all
TITLE Fast Sodium current
: Unit check passed
INDEPENDENT { t FROM 0 TO 1 WITH 1 (ms) }
UNITS {
(mV) = (millivolt)
(mA) = (milliamp)
}
NEURON {
SUFFIX NaF
USEION na READ ena WRITE ina
RANGE g, gmax, ina
GLOBAL minf, mtau, hinf, htau
POINTER mu
}
PARAMETER { : PARAMETERS ARE BY DEFAULT GLOBAL VARIABLES
gmax = 0.0195 (mho/cm2)
:gmax = 0
ena (mV)
m_vh = -23.9 (mV) : half activation
m_ve = -11.8 (mV) : slope
h_vh = -62.9 (mV) : half activation
h_ve = 10.7 (mV) : slope
}
ASSIGNED {
v (mV)
g (mho/cm2)
ina (mA/cm2)
minf (1)
mtau (ms)
hinf (1)
htau (ms)
mu (1)
}
STATE {
m h
}
BREAKPOINT {
SOLVE states METHOD cnexp
g = gmax * m*m*m*h * (1-(mu-1)*0.05)
ina = g * (v - ena)
}
INITIAL {
rates(v)
m = minf
h = hinf
}
DERIVATIVE states {
rates(v)
m' = ( minf - m ) / mtau
h' = ( hinf - h ) / htau
}
FUNCTION_TABLE tabmtau(v(mV)) (ms)
FUNCTION_TABLE tabhtau(v(mV)) (ms)
PROCEDURE rates(v(mV)) {
TABLE mtau, htau, minf, hinf DEPEND h_vh FROM -120 TO 40 WITH 160
: TABLE mtau, htau, minf, hinf DEPEND h_vh FROM -120 TO 40 WITH 320
mtau = tabmtau(v)
htau = tabhtau(v)
minf = 1/(1 + exp((v - m_vh)/m_ve))
hinf = 1/(1 + exp((v - h_vh)/h_ve))
}
Thanks in advance!