I was trying to translate this code given here:
https://www.math.fsu.edu/~bertram/softw ... JTB_04.ode
for pancreatic beta-cells, published by Wierschem and Bertram, J. Theor. Biol., 228:513-521, 2004. Here is the nmodl code I made:
Code: Select all
TITLE weirshem and Bertram 2004
UNITS {
(molar) = (1/liter)
(mM) = (millimolar)
(S) = (siemens)
(mA) = (milliamp)
(mV) = (millivolt)
(um) = (micron)
: (ms) = (millisecond) already known unit
}
NEURON {
SUFFIX camech
USEION k READ ek WRITE ik
USEION ca READ eca WRITE ica, cai VALENCE 2
: USEION atp READ atpi VALENCE 1
: USEION adp READ adpi VALENCE 1
USEION atp READ atpi WRITE atpi VALENCE 1
USEION adp READ adpi WRITE adpi VALENCE 1
RANGE gca, ica
RANGE gk, gkca, gatp, ik, ikchan, ikca, ikatp
RANGE nu, eta, tauc, f
}
PARAMETER {
f = 0.0013 (1) : unitless
alpha = 2.25e3 (mM/mA-ms) :2.25e-6 uM/fA-ms
:2.25e-6 (uM/fA-ms) = 2.25e-6*1e9 (mM/mA-ms)
kc = 0.1 (1) : unitless
vca=25 (mV) : mV also declared in hoc
: eca=25 (mV) eca changes with cai. hence, fixed. : mV also declared in hoc
ek=-75 (mV) : mV also declared in hoc
: Channel Parameters
sm=12 (mV) :mV
sn=5.6 (mV) :mV
vm=-20 (mV) :mV
vn=-16 (mV) :mV
kd=0.3e-3 (mM) :0.3 uM
taun=16 (ms) :ms
: initialized in hoc
: gca=(1200e-4)/area : pS. pS/area to 1e-4 S/cm2 -> 1e-4 :units
: gk= (3000e-4)/area : pS. pS/area to 1e-4 S/cm2 -> 1e-4 :units
: gatp=(357e-4)/area : pS. pS/area --> 1e-4 S/cm2
: gkca=(300e-4)/area : pS
: # substrate (ATP) influx rate
nu=10 (1): 10. See Fig 2 text: nu and eta are dimensionless parameter
: # product (ADP) removal rate
eta=188 (1): 188. See Fig 2 text: nu and eta are dimensionless parameter
: # ratio k_2/k_(-2)
k=20 (1):(Unit Assumed) 20.
: # time scale parameter (in sec)
tauc=1200e3 (ms): 1200 sec
}
STATE{
n (1)
cai(mM)
atpi(mM)
adpi(mM)
}
ASSIGNED {
: atpi (mM) : uM also declared in hoc
: adpi (mM) : uM also declared in hoc
v (mV)
ik (mA/cm2)
ikchan (mA/cm2)
ikca (mA/cm2)
ikatp (mA/cm2)
ica (mA/cm2)
minf (1)
ninf (1)
omega (1)
gca (S/cm2)
gk (S/cm2)
gatp (S/cm2)
gkatp (S/cm2-mM)
gkca (S/cm2)
area (um2)
}
BREAKPOINT {
minf =1/(1+exp((vm-v)/sm))
ninf =1/(1+exp((vn-v)/sn))
SOLVE states METHOD derivimplicit :cnexp
:Used derivimplicit as mentioned here https://www.neuron.yale.edu/phpBB/viewtopic.php?f=28&t=592
omega = 1/(1+(kd/cai))
gkatp = gatp/atpi : CHECK
: # Ionic currents
ica = gca*minf*(v-vca) : (v-eca)
ikchan = gk*n*(v-ek)
ikca = gkca*omega*(v-ek)
ikatp = gkatp*(v-ek)
ik = ikchan+ikca+ikatp
}
INITIAL {
minf =1/(1+exp((vm-v)/sm))
ninf =1/(1+exp((vn-v)/sn))
omega = 1/(1+(kd/cai))
: atpi = 2.4e-3 (mM) : uM also declared in hoc
: adpi = 0.05e-3 (mM) : uM also declared in hoc
cai = 0.17e-3 (mM) : uM also declared in hoc
}
DERIVATIVE states {
n'=(ninf-n)/taun
cai' = -f*(alpha*ica + kc*cai)
:fun(ADP,ATP)=ATP*(1+k*ADP)^2. Used within the expression
atpi' = (nu - atpi*(1+k*adpi)^2)/tauc
adpi' = (atpi*(1+k*adpi)^2 - eta*adpi)/tauc
}
Code: Select all
warning: return type defaults to 'int' [-Wimplicit-int]
modl_reg()[
nocmodl camech
Translating camech.mod into camech.c
Assertion failed.
Code: Select all
***[/cygdrive/c/nrn/lib/mknrndll.mak.23: camech.c] Error 3
Questions:
1. On commenting the last 2 lines in DERIVATIVE (adpi' and atpi' expressions) and STATE block adpi and atpi terms along with changes in their respective USEION statements, I was able to compile the code. But not with those expressions present. What would be the error in code?
2. [Not related to error] Since, the XPP code in the link has units for terms in pS, fA etc., and not in per unit area as used for Distributed mechanisms, what is the best approach to covert such code to NEURON nmodl or rxd and to make it work? I am using 'area' in mod file and area(0.5) in hoc for area conversions.
3. [a silly question] I am not able to copy mknrndll output from command prompt (cmd.exe) to clipboard. Same is true for neuron.exe interpreter text. For Linux based systems this is not an issue. Any solutions/workarounds recommended for this?
Thanks,
Darshan