Temperature dependence with the Channel Builder

NMODL and the Channel Builder.
Post Reply
joao
Posts: 6
Joined: Thu Jan 15, 2009 11:20 am

Temperature dependence with the Channel Builder

Post by joao » Thu Jan 15, 2009 12:10 pm

I am building a model of a network of axons with stochastic sodium and potassium channels, and the best way to do so seemed to be using the channel builder.

Having built the model of an axon with point processes for the ionic channels (like Chow and White, 1996) and having it working for 6.3 celsius I want to increase the temperature of the model to simulate mammalian cells (by adding a Q10 dependency), however the way I am familiar with would be multiplying an exponential term that is temperature dependent by the state derivatives (m dot - like Rattay and Aberham suggested in 1993), however I do not know how to do that using the channel builder.

Is there any easy way to increase the temperature using the channel builder?

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

Re: Temperature dependence with the Channel Builder

Post by ted » Fri Jan 16, 2009 12:34 pm

Each transition is governed by a pair of voltage-dependent rate variables. These rate variables are generally of the form A*f(v), where f is some function of local membrane potential. Temperature effects can be implemented by using A values that are governed by temperature: A = A0 * f(celsius), where f(celsius) = q10^((celsius - temp0)/10) and A0 is the value of A when celsius = temp0.

The Channel Builder can provide "aliases" that allow access to internal parameters. You can activate this feature by selecting
Properties / Provide transition aliases
in the Channel Builder's main menu, then save the Channel Builder to a ses file.

The remaining tasks are (1) to discover the names of the aliases, and (2) to set up a convenient way to calculate and use the A values.

1. How to discover the names of the aliases.

This is most easily done with the Graph class's "Plot what?" tool.
It would be helpful for you to follow a specific example.

Code: Select all

(this stuff isn't program code--I just need to preserve indentation)
Start neurondemo, then select "Stochastic Single Channels: HH".
Then bring up a Channel Builder configured as a point process with
  NEURON Main Menu / Build / Channel Builder / Point
Next 
  Properties / Channel Name
    and change its name to Mykhh0.
  Properties / Copy gates from / khh0
  Properties / Provide transition aliases
Now we're ready to discover its aliases.

The bottom field of the ChannelBuilder contains
n4: 5 state, 4 transitions
Click on this, and you'll see the gate constructor tool that shows a diagram of this
mechanism's states and the transitions between them:

Code: Select all

    v      v      v      v
n0 <-> n1 <-> n2 <-> n3 <-> n4
Beneath this diagram is a graph that shows the voltage dependence of an0n1 and bn0n1. These are the forward ("alpha") and reverse ("beta") reaction rates for the transition between states n0 and n1. In the right hand panel note that these rates are governed by equations of the form rate = A*f(v). For each reaction rate, you have to change the numeric value of A so that it reflects the effect of temperature. To do that, you must first discover the hoc name of each A.

Code: Select all

Bring up a current axis graph
  NEURON Main Menu / Graph / Current axis (this does not require a default section)
  Click on the Graph's menu box / Plot what?
  Plot what? / Show / Objects
Scroll down list in first column to ChannelBuild_
Double click on ChannelBuild_ -->
  ChannelBuild_ appears in text edit field at top of Plot what?,
  and 0. appears in Plot what?'s middle column,
Double click on 0. in middle column -->
  edit field changes to ChannelBuild[0].
  and middle column shows a list of names
Double click on aliases. in middle column -->
  edit field changes to ChannelBuild[0].aliases.
  and right column shows the name of each reaction rate
The first reaction rate in the right column is called an0n1.
Double click on it.
  edit field changes to ChannelBuild[0].aliases.an0n1.
  and right column shows three entries: A, d, and k
So guess what the hoc names of all the As are?
ChannelBuild[0].aliases.aninj.A
where i runs from 0 to 3, and j = i+1

2. How to set up a convenient way to calculate and apply the scale factors.

Create a procedure that calculates the value of each A from its A0, temp0, and q10, and the current value of celsius, then assigns this value to the appropriate Cell Builder alias. A handy trick for dealing with a bunch of names that differ only by an integer value is to use sprint with integer arguments to construct the desired command string, then use execute to execute the command string (see the Programmer's Reference for details of sprint and execute).

joao
Posts: 6
Joined: Thu Jan 15, 2009 11:20 am

Re: Temperature dependence with the Channel Builder

Post by joao » Tue Jan 20, 2009 1:46 pm

Thank you very much for the quick reply. I now have control over the temperature and it appears to be working rather well.
Kind regards, Joao.

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

Re: Temperature dependence with the Channel Builder

Post by ted » Tue Jan 20, 2009 2:00 pm

Excellent! Thank you for using NEURON in your research.

RBJ
Posts: 33
Joined: Sun Aug 02, 2015 4:28 am

Re: Temperature dependence with the Channel Builder

Post by RBJ » Tue Sep 06, 2016 1:04 pm

Hello there,
This discussion went cold 11 years ago after a successful solution, but may I ask a follow up question.
Within the HOC I can easily read temperature, calculate appropriate rate constants and write these to:

Code: Select all

ChannelBuild[3].aliases.aCO.A=rate
That works nicely when I followed those exact steps above. Is it it possible to implement that within a MOD file however, and get interactive control within the GUI?
when I write this in a MOD :

Code: Select all

execute("ChannelBuild[3].aliases.aCO.A=0.75")
It throws no errors, but it does not set the rate, as it does when you set it in the HOC. Is there a way to do this. To change the rates within a mechanism so you can change rates on the fly, i.e., whilst you have the GUI open and change Celsius.
At the moment I am recalculating rate constants from Q10 in a short Matlab script and copying this new rates into the states dialog. Which seems inelegant.
Regards
Richard

RBJ
Posts: 33
Joined: Sun Aug 02, 2015 4:28 am

Re: Temperature dependence with the Channel Builder

Post by RBJ » Wed Sep 07, 2016 6:07 am

OK, got this one now I think. With slightly more careful reading of the documentation I see:
These functions either execute code contained in an arbitrary, possibly generated-at-runtime string or load code from a file potentially chosen at runtime
Therefore I have created a text file with the code for calculating my new rate constant, with the punchline(s):

Code: Select all

kf=1e3 * exp(-((dH)-(T*dS))/(R*T))
execute("ChannelBuild[3].aliases.aCO.A=kf")
Then when I change the temperature of my simulation, I simply type:

Code: Select all

load_file(1,"newtemp.txt")
at the "oc" command prompt.
For my future reference or anyone else; the first argument "1" means you can keep re-loading the same script and as you change your temperature.
...and of course the interpreter (?) allows an up arrow key to re-load the previous line, so you only need type it in full once.
Does this all sound a sensible approach? . . . or have I missed a simpler semi-automatic way?
Thanks

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

Re: Temperature dependence with the Channel Builder

Post by ted » Fri Sep 09, 2016 12:32 am

RBJ wrote:Is it it possible to implement that within a MOD file however, and get interactive control within the GUI?
when I write this in a MOD :

Code: Select all

execute("ChannelBuild[3].aliases.aCO.A=0.75")
It throws no errors
Don't do it even if it doesn't generate an error message. It's not going to work. A procedure written in hoc or Python is the way to go. If entering a procedure call at the oc> or Python prompt, with a numeric argument that specifies the new temperature, is not sufficiently interactive, then use an xpanel with widgets. Read about this in the Programmer's Reference
https://www.neuron.yale.edu/neuron/stat ... dgets.html
and if you need to see specific examples, save a RunControl panel to a .ses file and then read the contents of .ses file to see how RunControl's widgets were set up and made to do what they do.
Celsius
In hoc it's lower case: celsius. The default value of celsius is 6.3 deg C.
At the moment I am recalculating rate constants from Q10 in a short Matlab script and copying this new rates into the states dialog. Which seems inelegant.
Seems painful.

RBJ
Posts: 33
Joined: Sun Aug 02, 2015 4:28 am

Re: Temperature dependence with the Channel Builder

Post by RBJ » Wed Sep 14, 2016 12:15 pm

That works beautifully (modifying an existing xpanel with reference to ...the manual). It is superinteractive now.
Thank you very much

Post Reply