Does it make a difference if a single compartment is soma or

The basics of how to develop, test, and use models.
Post Reply
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Does it make a difference if a single compartment is soma or

Post by nianwosuh »

I know soma is used to build single compartment model. I am working through the on-line course (handson), HH axon. The instruction is to create axon with given specifications, and insert current pulse. Here is my code

Code: Select all

create axon
access axon

axon {
    nseg = 75
    diam = 100
    L = 20000
    insert hh 
}

objectvar stim

stim = new IClamp(0.5)

stim.del = 1.0
stim.dur = 1.0
stim.amp = 1.0

Tstop = 5
When I run this code there is no action potential generated (V vs t). just a horizontal line on the V vs t graph

Please what is wrong with this code?

I have second question,
In a single compartment (soma) model
I inserted two electrodes, such that the current pulse from the second electrode will be injected when the pulse from the first electrode ends. (expecting to see two pulses,one ffrom each of the electrodes)
Unfortunately there was only one pulse that corresponds to the parameters of the first pulse from the first electrode. Here is the code I wrote;
load_file("nrngui.hoc")

create soma
access soma

soma {
nseg = 1
diam = 50
L = 50
insert hh
}

objectvar stim, stim1

stim = new IClamp(0.5)
stim1 = new IClamp(0.5)

stim.del = 1
stim.dur = 1
stim.amp = 1.0

stim1.del = 3
stim.dur = 1
stim.amp = 1.0

tstop = 5.

Please what is the best way to generate multiple pulses? or insert multiple electrodes in a model?

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

Re: Does it make a difference if a single compartment is soma or

Post by ted »

nianwosuh wrote:Please what is wrong with this code?
Nothing. The stimulus is probably too small to elicit a spike. The point of that exercise was to introduce the use of the GUI tools for setting up instrumentation (graph of V vs. t and V vs. distance alnog the axon, current clamp to inject stimulus current) and simulation control. The GUI encourages exploratory simulations by making it very easy to change stimulus parameters (onset, duration, amplitude) and simulation parameters (tstop, dt). If you haven't already used the GUI tools to explore the properties of this model cell, I encourage you to do so.

I see that none of the "help" links in that exercise are working because they antedate our adoption of Drupal to manage the WWW site. Here are what they should be:

The basic tools you'll need from the NEURON Main Menu
http://www.neuron.yale.edu/neuron/stati ... ONMainMenu

Tools / Point Processes / Manager / Point Manager to specify stimulation
http://www.neuron.yale.edu/neuron/stati ... essManager

Graph / Voltage axis
http://www.neuron.yale.edu/neuron/stati ... oltageaxis
and
Graph / Shape plot
http://www.neuron.yale.edu/neuron/stati ... #Shapeplot
to create graphs of v vs t and v vs x.

Tools / RunControl to run the simulation
http://www.neuron.yale.edu/neuron/stati ... RunControl

2) Change excitability by adjusting sodium channel density.
Tool needed:
Tools / Distributed Mechanisms / Viewers / Shape Name
http://www.neuron.yale.edu/neuron/stati ... ml#Viewers

These are all very helpful and commonly used graphical tools, especially for initial exploratory work, even with models whose anatomical and biophysical properties are completely specified via hoc code. If you would like to see a demonstration of how to use these, please let me know and we'll try to arrange a live demo via the Internet.
I inserted two electrodes, such that the current pulse from the second electrode will be injected when the pulse from the first electrode ends. (expecting to see two pulses,one ffrom each of the electrodes)
Unfortunately there was only one pulse
Everything looks good up to and including this statement:

Code: Select all

stim1.del = 3
i.e. up to the point that you were about to specify the duration and amplitude of stim1, the second stimulator.

Then you did this

Code: Select all

stim.dur = 1
stim.amp = 1.0
which left stim1's dur and amp parameters equal to 0. A classical case of the eye seeing one thing but the brain perceiving something else. Happens to everybody.
Please what is the best way to generate multiple pulses? or insert multiple electrodes in a model?
This will work. If you need a very stereotyped stimulus waveform (e.g. a series of pulses at regular intervals) it may be useful to create a custom mod file like ipulse1.mod or ipulse2.mod--see http://www.neuron.yale.edu/phpBB/viewto ... ?f=8&t=137. For completely arbitrary waveforms, the Vector class's "play" method may be best
http://www.neuron.yale.edu/neuron/stati ... .html#play
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Re: Does it make a difference if a single compartment is soma or

Post by nianwosuh »

Thank you for the explainations. I'll go through every reference (links) and I'll let you know if I need more help.

Thank you
Irene
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Re: Does it make a difference if a single compartment is soma or

Post by nianwosuh »

I have played with ipulse1 you referred me to, I am able to generate the number of pulses I want. Thank you!

But this raises more questions.
I first defined the Pulse1a (the name I gave it) as a point processor ()IClamp in my hoc code (in a single compartment, soma). When I ran the code , the action potential generated was very small below 10mV with current amplitude of 1.0nA.

I used the cell builder to construct the cell with the same specifications as in my hoc.code. I had the same response. I played with the parameters, and found that there is a minmum value of ton and toff, that must be assigned even with the same amplitude to generate the required number of pulses.

My question then is; Is there a rule of thumb to guide one in choosing the values of ton and toff?

I changed the values of ton and toff in the mod file directly, rebuilt the dll, redefine my IClamp and ran the the code, I did not have any pulses as when I used the cell builder.
I don't understand why. I thought it would not matter weather I used the "ipulse in hoc code as IClamp" or as a pointer process in the GUI.

Please do you have any explaination for this descrepancy.

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

Re: Does it make a difference if a single compartment is soma or

Post by ted »

nianwosuh wrote:When I ran the code , the action potential generated was very small below 10mV with current amplitude of 1.0nA.
The chief determinant of peak depolarization during a spike is the relative number of open sodium and potassion channels. Use a brief stimulus pulse (0.1 ms or so) and adjust its amplitude to find the smallest value that elicits a spike. The spike will be small because there is plenty of time for gna to inactivate and gk to activate during the long interval between the start of the stimulus and the time when the spike finally happens. Double the stimulus amplitude and you'll get a much larger spike. In general, a stimulus that is two times threshold gives good results. Stimuli that are much larger than that just produce a bigger stimulus artifact without much improvement in spike amplitude.
there is a minmum value of ton and toff, that must be assigned even with the same amplitude to generate the required number of pulses.
During repetitive stimulation, there is cumulative gna inactivation and persistent gk activation. This reduces the excitability of the membrane. You can see this for yourself--open a new graph (NEURON Main Menu / Graph / State axis), then use the graph's "Plot what" tool to show gna_hh and gk_hh. Run a simulation, then use the graph's "View = plot" to rescale the axes. Notice what happens to the maximum gna and gk over the course of the first two or three spikes.

Code: Select all

Is there a rule of thumb to guide one in choosing the values of ton and toff?
Brief ton (0.1 ms) is best because the resulting depolarization is brief and there is less cumulative inactivation of gna and activation of gk.
I changed the values of ton and toff in the mod file directly, rebuilt the dll, redefine my IClamp and ran the the code
I don't know what you mean by "redefine my IClamp" but here's a word of advice: don't create a mod file that defines a mechanism that has the same name as that of a built in mechanism. When NEURON loads the compiled mechanism, it will issue an error message something like
The user defined name, Foo, already exists
and then it will quit.

And another bit of advice: any parameters whose names are declared in the NEURON block of a mod file will be available to hoc and accessible through the GUI. It is completely unnecessary to revise the NMODL code and recompile. Ipulse1's NEURON block is

Code: Select all

NEURON {
        POINT_PROCESS Ipulse1
        RANGE del, ton, toff, num, amp, i
        ELECTRODE_CURRENT i
}
so if you create an instance of this mechanism with the statements
objref ip
axon ip = new Ipulse1(0)
there would be an Ipulse1 object attached to the 0 end of axon, and its parameters would be adjustable with hoc statements, e.g.
ip.del = 1
ip.ton = 0.1
etc.

Or, if you use a PointProcessManager to create and attach an Ipulse1 to a model cell, the parameters of this Ipulse1 instance would appear on the PointProcessManager's "parameters" page.
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Re: Does it make a difference if a single compartment is soma or

Post by nianwosuh »

Thank you very much! I've seen where I made mistake!
Irene
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Please can you clearify 3. INITIAL EXPLORATION OF THE MODEL

Post by nianwosuh »

I am working through Model Control : Simulation Families on the on-line course, please I need some help to understand ;" SWITCHING TO PRODUCTION MODE" of that section. and to completethe code

Does the "automation of exploration " imply that the manual use of Gather values- Graph will be eliminated in the exploartion? That is;

Does it mean that as one moves the synapse using the "putsyn()", the graph of vm Vs x (synapse location)will be automatically plotted if the "myprofile.hoc" is called using the xopen("myprofile.hoc")?

With this idea mind Itried to fleshen" the skeleton code of myprofile you had on- line and this is what it looks like (without the beginning comments).:

// objects must first be declared _outside_ procedures
objref location, amplitude. x
location = new Vector() // stores locations along the dendrite
amplitude = new Vector() // stores peak amplitude at each location

objref vm
vm = new Vector() // to hold the time course of somatic Vm
// evoked by a synaptic input
/* use Vector class .record() to "attach" vm to soma.v(0.5) */

objref g
g = new Graph() // for plot of amplitude vs. location

proc profile() {
// next three statements discard prior results, if any
location = new Vector()
amplitude = new Vector()
g = new Graph()

dend for (x = 0, 1) { // loop over each node in dend
putsyn(x)

// at this point, vm should contain a record of soma.v(0.5)

vm = vec.max() /* find maximum element in vm */

vdest.record(vm, x) // save the vm max and corresponding x values

vm.append(amplitude)/* append this to amplitude vector */

x.append(location) /* append x to location vector */
}

g = vec.plot(location, amplitude) /* plot amplitude vs. location */

g.size(0, 1, 65, 50) // graph window for x and y axes
g.beginline()

g.flush()

}
I am not sure how to define x (location of synapse) as the value is entered using the keyboard and S1 was used to represent synapse location (x) in the code for the putsyn
The other parts of the code I could not test because I could not get past the "for(x = 0,1)".

I'll appreciate your help on how to define the location (x), and suggstions on the other parts of the code.

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

Re: Please can you clearify 3. INITIAL EXPLORATION OF THE MODEL

Post by ted »

Sorry about my delayed response--somehow I didn't see a "new comment" notice until today.
nianwosuh wrote:I am working through Model Control : Simulation Families on the on-line course, please I need some help to understand ;" SWITCHING TO PRODUCTION MODE" of that section. and to completethe code

Does the "automation of exploration " imply that the manual use of Gather values- Graph will be eliminated
Yes. Through just a little bit of programming, you make the computer do the repetitive task of placing the synapse at new locations, running new simulations, collecting results, and finally plotting the results.
Does it mean that as one moves the synapse using the "putsyn()", the graph of vm Vs x (synapse location)will be automatically plotted if the "myprofile.hoc" is called using the xopen("myprofile.hoc")?
Yes.

Code: Select all

objref location, amplitude. x
No period or x on this line, please.

Code: Select all

/* use Vector class .record() to "attach" vm to soma.v(0.5) */
This comment means you need to add, at this point in the code, a hoc statement that uses the Vector class's .record() method. See the Programmer's Reference for documentation of this.

Code: Select all

	dend for (x = 0, 1) {
The skeleton code contains the statement

Code: Select all

	dend for (x) {
and dend for (x) is what it should be in order to iterate over all the nodes in dend--see the documentation of "for" in the Programmer's Reference, then try this toy example for yourself:
1. start NEURON without a hoc file
2. at the oc> prompt enter this command

Code: Select all

create dend
and at the next oc> prompt enter this command

Code: Select all

dend { print nseg  for (x) print x }
hoc will print
1
0
0.5
1
The first number is the value of nseg. The other three are the locations of dend's nodes (every section has a node at 0 and 1, and a node at the center of each segment).
3. now enter the command

Code: Select all

dend nseg*=3
then repeat the command

Code: Select all

dend { print nseg  for (x) print x }
(hint: to save some typing, use the keyboard's "up" arrow to recall the command, then press the Enter key). hoc will print
3
0
0.16666667
0.5
0.83333333
1

Back to your hoc code--

Code: Select all

vm = vec.max()	/* find maximum element in vm */
If soma.v(0.5) was recorded to Vector vm, then you want vm.max(). And you want to save the result to a temporary variable--might as well call it vtemp.

Code: Select all

vdest.record(vm, x) // save the vm max and corresponding x values
This statement will generate an error message (there is no Vector called vdest), and unnecessary--a Vector record() statement should already have been executed before entering the for loop.

Code: Select all

vm.append(amplitude)/* append this to amplitude vector */
The Vector to which the peak amplitudes are to be appended is called amplitude. Following my hint from a few lines above, the variable whose value is to be appended would be called vtemp.

Code: Select all

x.append(location)	/* append x to location vector */
Please see the Programmer's Reference for documentation of the syntax for the append() method.

Code: Select all

g = vec.plot(location, amplitude) /* plot amplitude vs. location */
I would suggest using the Vector class's plot() method. The syntax would be
amplitude.plot(g, location)

Code: Select all

g.beginline()

g.flush()
No need for these statements.
nianwosuh
Posts: 39
Joined: Tue Jul 27, 2010 11:00 pm

Re: Does it make a difference if a single compartment is soma or

Post by nianwosuh »

Thank you very much! I appreciate every minute you spend to answer my questions.

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

Re: Does it make a difference if a single compartment is soma or

Post by ted »

They're good questions, and they raise issues of general interest. It seems quite likely that others will benefit by seeing the questions and answers.
Post Reply