KCa Channel with TABLE definition in PYTHON

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
ChrisR
Posts: 21
Joined: Mon Mar 17, 2008 9:08 am
Location: Munich

KCa Channel with TABLE definition in PYTHON

Post by ChrisR » Fri Aug 26, 2011 11:28 am

Hello everybody!

I am currently trying to convert a hoc NEURON model into pyNEURON. However I could not get it to produce the same output as in hoc NEURON from scratch.
The one thing preventing identical results was the mod implementation of a Calcium dependent potassium current. I could only get it to work by commenting out the use of a TABLE in the rate procedure as shown below:

Code: Select all

FUNCTION alp_c(v(mV))(/ms) { LOCAL Q10
	Q10 = Q10_channel^((celsius-30(degC))/10(degC))
	alp_c = Q10*Aalpha_c/(1+(Balpha_c*exp(v/Kalpha_c)/cai)) 
} 
 
FUNCTION bet_c(v(mV))(/ms) { LOCAL Q10
	Q10 = Q10_channel^((celsius-30(degC))/10(degC))
	bet_c = Q10*Abeta_c/(1+cai/(Bbeta_c*exp(v/Kbeta_c))) 
} 
 
PROCEDURE rate(v (mV)) {LOCAL a_c, b_c 
	:TABLE c_inf, tau_c 
	:DEPEND Aalpha_c, Balpha_c, Kalpha_c, 
	:       Abeta_c, Bbeta_c, Kbeta_c, celsius FROM -100 TO 30 WITH 13000 
	a_c = alp_c(v)  
	b_c = bet_c(v) 
	tau_c = 1/(a_c + b_c) 
	c_inf = a_c/(a_c + b_c) 
} 
Another weird thing is: I was executing both, the hoc (via load_file()) and the py implementations in the same py script after each other while not resetting NEURON between the runs: By running the hoc before the py implementation both models produce the same output with the use of TABLE. But when I run py before hoc I have to get rid of TABLE to see identical output.
So what is going on here? Seems like some kind of initialisation I am missing in my python implementation. Or is not a good idea to use TABLE with rate functions dependent on voltage and calcium concentration anyway?

Thanks!
Christian

ChrisR
Posts: 21
Joined: Mon Mar 17, 2008 9:08 am
Location: Munich

Re: KCa Channel with TABLE definition in PYTHON

Post by ChrisR » Tue Aug 30, 2011 6:29 am

Ok, I solved it!
Sorry for bothering, I just forgot to put "h.usetable_KCA = 0" as it was done in the .hoc file.
So TABLE is not used. I suppose using tables with two dimensional channels is not possbile, is it?

Christian

ted
Site Admin
Posts: 5534
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: KCa Channel with TABLE definition in PYTHON

Post by ted » Tue Aug 30, 2011 10:29 pm

ChrisR wrote:using tables with two dimensional channels is not possbile, is it?
Presumably you're asking about "using tables with two independent variables." It's possible but would it be useful? The typical table with voltage as the independent variable has about 150 entries. If cai were the second independent variable, how many different values of cai would you like to accommodate, given that cai may vary over many orders of magnitude? Change anything in the table's DEPEND clause and you have to recalculate the entire table's contents. Costly in storage, costly in time.

Post Reply