NMODL help

NMODL and the Channel Builder.
Post Reply
sfi
Posts: 2
Joined: Mon Aug 18, 2014 8:35 am

NMODL help

Post by sfi »

Hi I am trying to insert two edited channels based on the ModelDB 121060 chan_CaL13.mod.
This channel compiles properly before being edited with equations from Le Franc & Le Masson (2010) but
when inserted into the cell the error 'ca_ion mechanism not inserted in the soma' occurs. How do I rectify this? With an intracellular ca mechanism?

The following code:

Code: Select all

TITLE (L-type LVA calcium current)

INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}



NEURON {

	SUFFIX CaL13t
	
: USEION ca READ cai,cao 
        
: USEION ca WRITE ica VALENCE 2
	USEION ca READ cai, cao WRITE ica VALENCE 2
	
RANGE minf, mtau, hinf, htau, ica, pmax
	GLOBAL m_vh

}



UNITS {
	
	(mA)	= (milliamp)
	
	(mV)	= (millivolt)
	
	(mM)	= (milli/liter)
        
	FARADAY = 96489 (coul)
        
	R       = 8.314 (volt-coul/degC)

}



PARAMETER {

	v		(mV)
	
	celsius	(degC)
	: cai  	(mM)
	: cao  	(mM)
	cai  	(mM)
	cao  	(mM)
	
	pmax = 4.25e-7	(cm/s)
	m_vh = -33 (mV)

}


STATE {
	
	m 
	h

}



ASSIGNED {

	ica		(mA/cm2)
	
	mtau		(ms)
	
	minf
	hinf
	htau		(ms)

}



BREAKPOINT {
 
	SOLVE state METHOD cnexp
	
	ica = pmax*m*m*h*ghk(v,cai,cao,2)
	: ica = pmax*m*m*h*ghk(v,0.001,cao,2)
}



DERIVATIVE state {

	rates(v)
	
	m'= (minf-m) / mtau
	h'= (hinf-h) / htau
	
}



INITIAL {

	rates(v)

	m = minf
	h = hinf

}



FUNCTION ghk( v(mV), ci(mM), co(mM), z)  (millicoul/cm3) { 
	LOCAL e, w
        
	w = v * (.001) * z*FARADAY / (R*(celsius+273.16))

        if (fabs(w)>1e-4) 
          
	{ e = w / (1-exp(-w)) }

        else : denominator is small -> Taylor series
          
{ e = 1/(1-exp(-w)) }
        
ghk = - (pmax) * z*FARADAY * (co-ci*exp(-w)) * e
}



UNITSOFF

PROCEDURE rates(v(mV)) {
	LOCAL m_alpha, m_beta

	m_alpha = (0.1*(25-v))
	m_beta = (1.0029/
			(1+exp[(14.3907 - v)/3.1029])^0.5289)
	mtau = 1/(m_alpha/(exp[m_alpha]))+[4*exp(-v/18)])
	minf = -0.0012+m_beta
	htau = 1500
	hinf = 1 / (1+exp((v-14)/4.03))

}



UNITSON 
from my edited .mod file will not compile. Are there any glaring reasons why?
ted
Site Admin
Posts: 5809
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: NMODL help

Post by ted »

Have you checked your revised mod files with modlunit? At the command line
modlunit filename.mod
If you're using OS X you can drag and drop the mod file onto the modlunit icon.
Under MSWin you can double click modlunit (in the NEURON Program Group)
then use the directory browser that pops up to go to the directory that contains the mod file,
and finally select the mod file from the contents of that directory.
sfi
Posts: 2
Joined: Mon Aug 18, 2014 8:35 am

Re: NMODL help

Post by sfi »

Thank you for the advice. I have now managed to get the .mod file to compile but still there is an issue when inserting into the cell hoc file with 'ca_ion mechanism not inserted in the soma'. The soma does have cao and cai specified, so how do I correct for this? Is there another mechanism I should insert?

Additionally, to correct the .mod file I found that the syntax (0.001) was needed to convert coulombs to millicoulombs, is this a conversion syntax specific to NMODL?
ted
Site Admin
Posts: 5809
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: NMODL help

Post by ted »

sfi wrote:Thank you for the advice. I have now managed to get the .mod file to compile but still there is an issue when inserting into the cell hoc file with 'ca_ion mechanism not inserted in the soma'. The soma does have cao and cai specified, so how do I correct for this? Is there another mechanism I should insert?
If a section has a mechanism whose NMODL source code declares
USEION cai
that section should automatically have a cai_ion mechanism. Does your hoc code call something that tries to reference eca or ica _before_ the statement that inserts the mechanism that has USEION ca ?
to correct the .mod file I found that the syntax (0.001) was needed to convert coulombs to millicoulombs, is this a conversion syntax specific to NMODL?
Because of the wide diversity of programming styles across the universe of all NEURON users who write NMODL code, I will have to see the complete file before commenting on any particular conversion factor. However, the syntax (0.001) is used to tell the modlunit program that the number in the parentheses is to be treated as a conversion factor.

I should mention that the file quoted in your first post in this thread contains an error: the Taylor series expansion of 1-exp(-w) is w - (w^2)/2 + . . . so the approximation of w/(1-exp(-w)) for small w is 1(1 - w/2).
Post Reply