potassium channel: k_ion mechanism not inserted

NMODL and the Channel Builder.
Post Reply
srene
Posts: 14
Joined: Thu Jun 27, 2013 3:46 pm

potassium channel: k_ion mechanism not inserted

Post by srene »

Hello,

I have following problem. I have an kalium.mod file (I use Mac OS X Lion):

Code: Select all

TITLE ich versuch mich mal...	


UNITS {
	(mA) = (milliamp)
	(mV) = (millivolt)
}


PARAMETER {
	v (mV)
	celsius (degC)
	gkbar = 0.07 (mho/cm2) 
	vhalfm = -3 (mV)
	vhalfh = -51 (mV)
	km = 10 (1)
	kh = -12 (1)
	ek
		
}
NEURON {
	SUFFIX kalium
	USEION k READ ek WRITE ik
	RANGE gkbar
	GLOBAL minf, hinf, taum, tauh 
}

STATE {
	m 
	h
}
ASSIGNED {
	ik (mA/cm2)
	minf
	hinf
	taum
	tauh
}
INITIAL {
	rates(v)
	m = minf
	h = hinf
}
BREAKPOINT {
	SOLVE states METHOD cnexp
	ik = gkbar*m*h*(v-ek)
}
DERIVATIVE states {
	rates(v)
	m' = (minf-m)/taum
	h' = (hinf-h)/tauh
}	
PROCEDURE rates(v(mV)) {
	LOCAL qt
	qt = 2.3^((celsius-22)/10)
	minf = 1/(1+exp((vhalfm-v)/km))
	hinf = 1/(1+exp((vhalfh-v)/kh))
	taum = 5+47*exp(-(-50-v)^2/(30^2))
	tauh = (360+1000*exp(-(-50-v)^2/(50^2)))
}
I drag´n drop it on mknrndll and it creates an archive like it should do. Now I want to insert the channel in three sections: soma, axon and 14 dendrites, the hoc-file is a template for one cell of a network called singing_fish_cell_passiv_test.hoc:

Code: Select all

  forsec dendrites {
    insert pas
		g_pas =0.0005
		e_pas = -45.0 
	insert kalium
	ek = -105.0
	}
 
  soma {
    insert hh
      gnabar_hh = 0.12
      gkbar_hh = 0.01
      gl_hh = 0.000013 // macht refr.pot. minimal breiter
      el_hh = -54.3
	  ek = -105.0 //null Einfluss
	  ena = 71.0 // macht refr.pot unten bisschen runder, spikes kleiner u synchron. etwas schlechter
	  eca = 140
	insert kalium
	ek = -105.0
		
  }
  axon {
    insert hh
      gnabar_hh = 0.012
      gkbar_hh = 1.96
      gl_hh = 0.0003 //0.003 verhindert spikes in refrPhase
      el_hh = -54.3  //kein Einfluss
	  ek = -105.0  // null Einfluss
	  ena = 71.0
	  eca = 140
	insert kalium
	ek = -105.0
  }
If I try to run the hoc file in which I load the template file of a cell singing_fish_cell_passiv_test.hoc, I get this error message:

Code: Select all

Additional mechanisms from files
 ihw.mod
	1 
	1 
	0 
/Applications/NEURON-7.3/nrn/x86_64/bin/nrniv: syntax error
 in singing_fish_cell_passiv_test.hoc near line 126
 	insert kalium
              ^
        xopen("singing_fish_cell_passiv_test.hoc")
      execute1("{xopen("singing_fish_cell_passiv_test.hoc")}")
    load_file("/Users/renesoylu/Dropbox/Synchronie_der_Muskelsteuerung_des_singenden_Fisches/Refractory network/Projekt Boris/Ihw_Ted/ihalfwave_test/singing_fish_cell_passiv_test.hoc")
	0 
k_ion mechanism not inserted in section soma
/Applications/NEURON-7.3/nrn/x86_64/bin/nrniv: 
 in singing_fish_cell_passiv_test.hoc near line 127
 	ek = -105.0
             ^
oc>


Can you please tell me what is wrong. Line 126 and 127 are at the first "insert kalium" and "ek=-105.0" in the template file.

Best regards,
srene
Last edited by srene on Wed Sep 18, 2013 5:31 am, edited 1 time in total.
ted
Site Admin
Posts: 5809
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: potassium channel: k_ion mechanism not inserted

Post by ted »

The clue is the second line of this excerpt from your post:

Code: Select all

Additional mechanisms from files
 ihw.mod
	1 
	1 
	0 
/Applications/NEURON-7.3/nrn/x86_64/bin/nrniv: syntax error
 in singing_fish_cell_passiv_test.hoc near line 126
 	insert kalium
              ^
So the mechanism defined by the NMODL code in kalium.mod was not present in the mechanism library file (.dll or whatever file type it is) that NEURON loaded.

Why? Probably because of the way you are compiling your mod files.
I drag´n drop it on mknrndll
If you are saying "I dropped kalium.mod on mknrndll", the result will be a mechanism library file that contains only the mechanism defined by the code in kalium.mod. What happens if a directory contains more than one mechanism library, I don't know, but it probably isn't a good idea.

What you need to do:
1. Make sure that all the .hoc, .ses, and .mod files that your project needs are in a single directory ("folder").
2. Throw out any .o, .c, and .dll files that are in that directory. If there is a .i686 or .x86_64 directory, throw that out too.
3. Drag and drop that entire directory onto mknrndll.

Now the mechanism library file should contain compiled code from all of the mod files your project needs. Furthermore, it will be in the correct location where NEURON will find it automatically when you start your simulation by dragging and dropping your main .hoc file onto the nrngui icon (or even if you run NEURON from a terminal). And when NEURON starts, it will print a message that tells you the name of each mod file whose mechanisms are contained in the mechanism library file.
Post Reply