plotting taus and steady-state gs

Anything that doesn't fit elsewhere.
Post Reply
kagakusha

plotting taus and steady-state gs

Post by kagakusha » Thu Nov 03, 2005 8:45 am

How can I plot/view the underlying voltage-dependence plots of the taus of activation and inactivation as well as of the steady state conductances (ex. m-infinity, etc.) of an H-H action potential model with Neuron?

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

What is the Grapher, and how to use it?

Post by ted » Thu Nov 03, 2005 9:20 pm

Well, minf isn't a conductance, but nit-picking aside, here's how to examine the voltage-
dependence of a mechanism.

First the variable(s) you want to plot must be visible to hoc. This can be a problem if
the mechanism of interest was implemented with NMODL. STATEs are automatically
range variables, hence always visible, but there's no law that says that a mod file has
to make anything else visible to hoc. If you want to know the value of time constants or
steady-state values, they should be declared in the NEURON block as RANGE or
GLOBAL.

As far as conductances and currents are concerned, a lot of mod files don't bother
to calculate ionic conductance as such--it isn't really necessary for the simulation.
Currents must always be declared in a USEION or NONSPECIFIC_CURRENT
statement in the NEURON block, so they are visible to hoc.

Enough general stuff. Let's get down to specifics.

Here's the NEURON block of hh.mod:

Code: Select all

NEURON {
        SUFFIX hh
        USEION na READ ena WRITE ina
        USEION k READ ek WRITE ik
        NONSPECIFIC_CURRENT il
        RANGE gnabar, gkbar, gl, el, gna, gk
        GLOBAL minf, hinf, ninf, mtau, htau, ntau
}
All those RANGE and GLOBAL declarations make hh particularly useful for didactic
purposes.

One way to examine the voltage dependence *inf and *tau would be to make a single
compartment model, insert hh, then apply a depolarizing ramp to the model and plot
the values of *inf and *tau vs. v. "This is left as an exercise to the reader." (When I first
learned calculus from one of Leibnitz's former students, we used a text (Johnson and
Kiokemeister, listed at Amazon as "Used & new from $1.80" and worth every cent of
it) that used this little phrase a lot, and it always meant that an hour or more of hard
work awaited us.)

But NEURON has a tool called the Grapher that makes this much easier. Here's what
to do:
1. Start nrngui
2. NEURON Main Menu / Build / single compartment
3. Click on the hh button in the single comparment window.
4. NEURON Main Menu / Graph / Grapher

The Grapher is just a graphical tool for setting up a "while loop" in which you
iterate an independent variable over a range of values, executing a statement
and plotting results to a graph at each point. That is, when you click on its Plot
button, here's what will happen (in pseudocode):

Code: Select all

Independent Var = Indep Begin
while (Independent Var <= Indep End) {
  execute Generator statement
  plot the variables named in the graph vs. the value of the X-expr
  increment Independent Var by (Indep End - Indep Begin)/Steps
}
So here's how to make this Grapher plot the voltage dependence of the hh
mechanism's *inf. All of this is much easier to do than to describe.

1. Set the Grapher's parameters to these values:
Indep Begin -100
Indep End 50
Steps 150
2. Click on the Independent Var button. This pops up a window with an edit field.
Enter v into this edit field, then click the Accept button. The Grapher should now
display v adjacent to the Independent Var and X-expr buttons.
3. Click on the Generator button. This pops up another window with an edit field.
Enter
finitialize(v)
into this edit field, then click the Accept button. Next to the Generator button, you
should now see the string finitialize(v)

So the Grapher is going to step v from -100 mV to 50 mV in 1 mV increments, and
at each value it will initialize the model. Initializing the model to a given v makes all
mechanisms that are specified by NMODL execute the code in their INITIAL blocks.
If you read hh.mod's INITIAL block, you'll see that it calls PROCEDURE rates(),
which calculates the values of *inf and *tau--whch is exactly what we want.

An aside: if you want to use this Grapher to examine the voltage-dependence
of an ionic current or conductance, the Generator statement should be

Code: Select all

finitialize(v) fcurrent()
to ensure that all currents are consistent with
the specified voltage.

All that remains is to specify the variables we want to plot. Click on the graph's menu
square (upper left corner of the graph) and scroll down to Plot what? Near the top of
the Plot what? tool is a big edit field. Click inside this and type minf_hh, then click on
the Accept button. The Plot what? tool will disappear, and minf_hh will appear on the
graph. Repeat for hinf_hh.

Finally, click on the Plot button. You will need to resize the graph: click on the menu
square, move the mouse cursor slightly up so that the secondary graph menu
appears, and then carefully move the cursor over to View = plot.

Now, wasn't that easy?

Exercises for the reader:
1. Add ninf_hh to the grapher.
2. Use the graph's Color/Brush tool to make the color of minf_hh red, and ninf_hh blue.
When you're done, use the graph's primary menu to restore Crosshair mode, so you
don't accidentally mess up the color scheme.
3. Bring up a new Grapher and set it up to plot the time constants.
4. Bring up another Grapher and use it to plot the steady-state gna_hh and gk_hh.
5. Finally, bring up a Grapher and use it to plot the steady-state ina_hh and ik_hh.

A hint: once you have a Grapher that works, save it to a session file all by itself.
Open that session file with a text editor and look for the names of the variables
that you were plotting. Change them to something else, e.g. if you were plotting
minf_hh, hinf_hh, and ninf_hh, change these to mtau_hh, htau_hh, and ntau_hh.
Use NEURON to execute the saved session file (xopen() is best for this) and
see if your edited Grapher does what it should. Editing a session file can be a
very convenient way to make a graphical tool do something new, without having
to start from the NEURON Main Menu toolbar etc..
Last edited by ted on Thu Jan 17, 2008 1:16 pm, edited 1 time in total.

kagakusha

Post by kagakusha » Fri Nov 04, 2005 3:41 pm

Thanks very much, Ted! Yes, minf, etc. are steady-state parameters, not conductances... =)

Post Reply