NMODL mechanism using two USEION statements

NMODL and the Channel Builder.
Post Reply
joe1234
Posts: 8
Joined: Fri Sep 28, 2007 6:46 am
Location: England

NMODL mechanism using two USEION statements

Post by joe1234 »

I'm translating a GENESIS model into NEURON and the 10 NMODL mechanisms all work the same in my nrn model as in the genesis one, with one exception. The trouble-maker is an Sk channel, a calcium-dependent potassium channel, reading calcium concentration from a 200 nM shell below the cell membrane. The calcium concentration mechanism works fine. Can anyone see something wrong in the following code, for example with the double USEION statements in the NEURON block? Or with the TABLE lower down? Thanks a lot! /Joe

NEURON {
SUFFIX Sk
USEION ca READ cai VALENCE 2
USEION k READ ek WRITE ik
RANGE gbar, z, ik
}

UNITS {
(mA) = (milliamp)
(mV) = (millivolt)
(molar) = (1/liter)
(mM) = (millimolar)
}

PARAMETER {
gbar = 1e-5 (siemens/cm2) :default value, change in hoc
}

ASSIGNED {
v (mV)
ek (mV) : set ek to -90 (mV) from hoc
ik (mA/cm2)
cai (mM)
zinf
tauz (ms)
}

STATE {
z :calcium-dependent activation variable
}

INITIAL {
rate(cai)
z = zinf
}

BREAKPOINT {
SOLVE states METHOD cnexp
ik = gbar * z * (v - ek)
}

DERIVATIVE states {
rate(cai)
z' = (zinf - z) / tauz
}

PROCEDURE rate(cai(mM)) {
TABLE zinf, tauz FROM 0 TO 0.01 WITH 300
UNITSOFF
zinf = cai*cai*cai*cai / (cai*cai*cai*cai + 8.1e-15)

if (cai < 0.005) {
tauz = 1 - (186.67 * cai)
} else {
tauz = 0.0667
}
UNITSON
}
Raj
Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Groningen, The Netherlands
Contact:

Post by Raj »

Does it compile?
If not what are the error messages?
joe1234
Posts: 8
Joined: Fri Sep 28, 2007 6:46 am
Location: England

Post by joe1234 »

Thanks for your reply Raj. I've finally, after two weeks of bug hunting, found the fault elsewhere in the model. Now it works beautifully!
So nothing's wrong with the code I gave, it seems.
Thanks again,

Joe
Post Reply