I found the wrong maximum values

Anything that doesn't fit elsewhere.
Post Reply
Franzi

I found the wrong maximum values

Post by Franzi »

Hello,

i want to meassure the current of a (complex) cell at soma(0.5) with one AlphaSynpase, which is put on dendrites frequently.

Code: Select all

vamplitude = new Vector()
for (; i<=1; i=i+lambda/L)  {// loop over each node in dends
    AlphaSynapse[0].loc(i)	// put AlphaSynapse on this node
    vm = new Vector()
    vm.record(&soma.v(0.5))
    synloc = AlphaSynapse[0].get_loc()
    run()
    maximum = vm.max()	// find maximum element in vm
    maximum -= v_init		// epsp amplitude relative to baseline
    vamplitude.append(maximum)
}
The problem is, that the graph, which is generated by the command newPlotV() before the code, shows an other signal developing as the maximum recorded by vm.record(&soma.v(0.5)), that means, the two maximum values are different.

The values i get have not a linear correlation as the theory says.
A simple program working on a simple cell gets the correct maximum values.

Now i would like to know if the code above is correct for finding the maximum current at the soma(0.5). Is there any better way?

Thank you for your help, Franzi
Raj
Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Groningen, The Netherlands
Contact:

Post by Raj »

Sounds like an access problem to me.

You should use the access statement only once.

In your case

Code: Select all

access soma 
is probably a wise choice and should be entered before you use newPlotV.

For general info about access see the help page:
http://www.neuron.yale.edu/neuron/stati ... sedSection

Alternatively, you can delete the 'v' plotted in the graph, select the variable of interest by using the 'Plot what?' and save the voltage plot into a session file for future usage.

At the risk of being overcomplete: The actions on the graph are all accesible via the right mouse button. Session files can be generated from the file and windowmanager accesible from the NEURON Main menu's Window submenu.
Franzi

Post by Franzi »

Thank you for your help.

But the problem is, that newPlotV() plots in my opinion (and from the theory) the right current values. The maximum values of this plot seem to range between -68mV and 45mV, reaching all values between them. This are according to the theory the right values.

But in the recorded vector vm appear only values from 44mV to 45mV and -68mV to -67mV. So i don't get a linear correlation between the current at the soma(0.5) and the distance from the soma.

This is the problem i have.

Greetings, Franzi.
Franzi

Post by Franzi »

Raj wrote:Sounds like an access problem to me.

You should use the access statement only once.

In your case

Code: Select all

access soma 
is probably a wise choice and should be entered before you use newPlotV.
Ok. I checked this behaviour, but accessing the soma directly before the command newPlotV() has no effect to the values printed at the graph, the access of the soma is granted some commands before the mentioned one.
Raj
Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Groningen, The Netherlands
Contact:

Post by Raj »

Hmmm, Puzzling.

So a question:
When are you inspecting vm? (During debugging you could add a vm.plot(myGraph) followed by an accept button (to pause execution before entering the next iteration) to your script, all this just after run() and then you can compare.)
ted
Site Admin
Posts: 6305
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

get_loc() needs a pop_section()

Post by ted »

Franzi wrote:I want to meassure the current of a (complex) cell at soma(0.5) with one AlphaSynpase
I will start by assuming that you simply misspoke--that you really wanted to observe
somatic v, not a current.
The problem is, that the graph, which is generated by the command newPlotV() before the code, shows an other signal developing as the maximum recorded by vm.record(&soma.v(0.5)), that means, the two maximum values are different.
As Raj noted, there is a "currently accessed section" problem. get_loc() pushes the
section of the target point process onto the section stack, so that it becomes the
currently accessed section. Before calling run(), you need to call pop_section(), which
will restore the currently accessed section to what it was before get_loc().

Code: Select all

    synloc = AlphaSynapse[0].get_loc()
    pop_section()
    run()
But the for loop itself is problematic. There is no guarantee that this
for (; i<=1; i=i+lambda/L) {// loop over each node in dends
will probe each node of a section. This is guaranteed to miss some nodes, and
oversample others. It won't work properly even if you change it to
for (0; i<=1; i=i+lambda/L) {
Do this instead
for (i) {// loop over each node in dends
Then you won't even need to call get_loc() (followed by pop_section()) in the first place.

You could make your code a bit more efficient by making a few other changes.
For example, these statements
vm = new Vector()
vm.record(&soma.v(0.5))
need only be executed once--before entering the for loop. Also, instead of subtracting
v_init inside the for loop, do it after completion of the for loop.

Code: Select all

    maximum = vm.max()	// find maximum element in vm
    vamplitude.append(maximum)
}
vamplitude.sub(v_init)
My turn to ask a couple of questions. First, does somatic v stay put at v_init if you run
a simulation with synaptic input turned off? Second, regarding this:
The values i get have not a linear correlation as the theory says.
What theory is that, and what two variables are supposed to be correlated linearly?
Raj
Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Groningen, The Netherlands
Contact:

Post by Raj »

Alas,

It would have been much better if get_loc had returned a location and a section reference. I assume the function is older than the section reference, because these unexpected (although admittedly documented) features, make programming hard.

That being said, it remains strange that the recorded vector shows the wrong result and the graph the right result "according to theory". I would have expected problems the other way round because the GUI is affected by the wrong access and not the

Code: Select all

vm.record(&soma.v(0.5)) 
statement.

So although the wrong access explains the existence of differences I am curious to hear more about the theory.
Franzi

Post by Franzi »

Thank you for your help.

I found in the programmer's reference the following fact:

.loc(x)

Description: A fixed current stimulus or voltage electrode location at position 0<=x<=1 of the currently accessed section. This is needed for the transfer impedance calculation. Note that transfer impedances obey the relation v(x)/i(loc) == v(loc)/i(x) where loc is the fixed location and x ranges over every position of every section.

Is there any possibility to change the x value in the loc-function to any value i would like to meassure?

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

Post by ted »

Franzi wrote:I found in the programmer's reference the following fact:

.loc(x)
Isn't this a bit of a non-sequitur? Up to this point, the discussion has been about point
process classes' loc() methods. Now comes a question about the Impedance class's loc()
method, which has nothing to do with any point process class. It is as if, in the middle of a
conversation about tree trunks, we start talking about elephant trunks. Both are cylindrical,
with length > diameter, but the similarities stop there.
Is there any possibility to change the x value in the loc-function to any value i would like to meassure?
Yes, as long as the argument lies in the interval [0,1]. The same applies to point process
classes' loc() method. But that doesn't mean that these two kinds of loc() methods have
identical effects.
Franzi

Post by Franzi »

ted wrote: Isn't this a bit of a non-sequitur? Up to this point, the discussion has been about point
process classes' loc() methods. Now comes a question about the Impedance class's loc()
method, which has nothing to do with any point process class.
Sorry, i meaned the .loc(x) function from the process class. Thank you for the information.


Ich would like to measure all voltages of different points, where the alphasynapse has to be touched, of all dendrites of a complex cell (e.g. Layer3 Aspiny Stellate, Sejnowsky). The measure has to be done at the soma(0.5). For that i would like to know, how can i realize touching the alphasynapse on a dendrite and let the alphasynapse walk along the dendrite, then going to the next dendrite and so on. And how can i measure the voltage at the soma each time?

Running over all dendrites is not my problem, but the measure and the putting of the alphasynapse on the dendrite.

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

Post by ted »

For that i would like to know, how can i realize touching the alphasynapse on a dendrite and let the alphasynapse walk along the dendrite, then going to the next dendrite and so on.
Create a SectionList.
Append, to that SectionList, all of the sections that you are interested in.
Use for seclist for(x) { } to iterate over all nodes of all sections in the SectionList and
carry out whatever else is necessary.

Code: Select all

objref seclist
seclist = new SectionList()  //  Comment added afterwards--
seclist.append(section1)  // oops! the syntax should be  section1 seclist.append() etc.
seclist.append(section2)
 . . . etc. . . .
objref syn
syn = new AlphaSynapse()
 . . . specify attributes of syn . . .
objref vm
vm.record(&soma.v(0.5))
for seclist for (x) {
  syn.loc(x)
  maximum = vm.max()   // find maximum element in vm
  vamplitude.append(maximum)
}
vamplitude.sub(v_init)
And how can i measure the voltage at the soma each time?
That's what the Vector class's record() method does. Read this
http://www.neuron.yale.edu/neuron/stati ... tml#record
Last edited by ted on Sat Mar 25, 2006 3:24 pm, edited 1 time in total.
Franzi

Post by Franzi »

Thank you for your information.

That's like the way i already have implemented it. To determine i used a right implementation, i also tested your posted one.
Use for seclist for(x) { } to iterate over all nodes of all sections in the SectionList and carry out whatever else is necessary.
That's the way i can't go. I need specific points on the section for setting the alphasynapse. That means i used a variable i, adopting values between 0 and 1, iterating (for simple purpose) by 0,1.
Yes, as long as the argument lies in the interval [0,1]. The same applies to point process classes' loc() method. But that doesn't mean that these two kinds of loc() methods have identical effects.
If i understood right, this would be the correct way, iterating over i and setting the alphasynapse in relation to i, using the command syn.loc(i)?

Another question. Unfortunately the problem is not solved if this above is right. Even if the for-command iterates over x, i don't get correct values (maximum voltage). I get only maximum values in two intervals: [43mV,46mV] and [-69mV,-65mV]. No maximum value lies between the to intervals. Normally the maximum value depends on the distance between the soma and the alphasynapse, the used voltage, the diameter and length (diam, L) of the dendrites at the path of the way from the alphasynapse to the soma.

In the theory the maximum value decreases, when the distance between the soma and the alphasynapse gets bigger. So there must be values between the to intervals, getting a (likely) linear correlation between L and the maximum voltage: maxV ~ 1/L (simplified). This is the problem i have: Using the complex cell with this algorithm produces values, which are only in 2 intervals and bounce from the first to the second, if L (or the i, because the sum of the distance is L*i+L(sections between soma and accessed section)=L*i + distance(0) ) gets bigger.

Running the same algorithm over a simple cell get almost correct maximum voltage values (whereas this is a problem too, getting the right values).

Let me please make something clear:

I use newPlotV() to get a immediate graph of the voltage at the soma(0.5). I use the vm.record(&soma.v(0.5)) and vm.max()-function getting the maximum value in the program.

These two (maximum) values (newPlotV() and vm.max()) are completely different! Whereas newPlotV() prints always the correct voltage values, satisfying the theory.

So i "see" on the printed graph a different, but right maximum value from the vm.max()-function.

Greetings, Franzi.
Stefan
Posts: 1
Joined: Fri Mar 24, 2006 1:27 pm

Post by Stefan »

Hello,

i'm working on this topic too. I want to give you same additional informations. At first, i've tried to use the "for seclist for (x)"-code. But i get an error if i start the procedure and i should look on a help-file which doesn't exists on the given adress. If i take a look on the help-files for SectionList i can't find a expression like ".append(any_section)".
Only ".append()" for current sections is given. Do you use another version of neuron, ted, or is this simply pseudocode?

Then, i have think about the difference between the plot from newPlotV() und the vm-vector. Could it be possible that newPlotV() shows the signal for a other position of alphasynapse? Can i get the exactly position of alphasynapse by measurement?

So long, thank you for your help
ted
Site Admin
Posts: 6305
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Franzi wrote:If i understood right, this would be the correct way, iterating over i and setting the alphasynapse in relation to i, using the command syn.loc(i)?
If 0<i<1, syn.loc(i) will place the point process at the nearest internal node (internal nodes
are located at (j+0.5)/nseg, where j = 0..nseg-1).
Franzi wrote:Even if the for-command iterates over x, i don't get correct values (maximum voltage). I get only maximum values in two intervals: [43mV,46mV] and [-69mV,-65mV]. No maximum value lies between the to intervals.
Sounds like a section access problem to me. The answer may even be something that
would seem very obvious and simple to you if you could only see it with fresh eyes. If
you can send me a minimal amount of code that reproduces the problem--preferably
using a toy model cell that has only two or three sections--maybe I can tell you how to
fix it.
ted dot carnevale at yale dot edu
ted
Site Admin
Posts: 6305
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Stefan wrote:If i take a look on the help-files for SectionList i can't find a expression like ".append(any_section)".
Only ".append()" for current sections is given. Do you use another version of neuron, ted, or is this simply pseudocode?
No and no. It is just my stupid mistake. I use the List and Vector classes' append() method
all the time, and I just write foo.append(arg) as a reflex. Of course, SectionList's append()
is different!
append the currently accessed section to the list
means I should have written

Code: Select all

section1 seclist.append()
section2 seclist.append()
etc.. Sorry about that.
the difference between the plot from newPlotV() und the vm-vector. Could it be possible that newPlotV() shows the signal for a other position of alphasynapse?
I never use newPlotV() myself. I just tried it, and it brings up a graph whose plotlist
includes v(.5). This is interpreted as "v at the middle of the currently accessed section,"
which is vulnerable to anything that affects the identity of the currently accessed
section. You can check this for yourself.

This vulnerability is one reaon why I never use newPlotV().

So from this statement
Franzi wrote:I use newPlotV() to get a immediate graph of the voltage at the soma(0.5). I use the vm.record(&soma.v(0.5)) and vm.max()-function getting the maximum value in the program.
we know that the graph may or may not actually show soma.v(0.5).
Franzi wrote:These two (maximum) values (newPlotV() and vm.max()) are completely different! Whereas newPlotV() prints always the correct voltage values, satisfying the theory.
Unlike newPlotV(), there is nothing ambiguous about the effect of
vm.record(&soma.v(0.5))
which always records membrane potential at the middle of the soma, regardless of
what the currently accessed section might be. I hope that the "theory," whatever it is,
rests on a more secure foundation than the appearance of a graph that is produced
by newPlotV().
Stefan wrote:Can i get the exactly position of alphasynapse by measurement?
loc() returns the normalized distance from the 0 end of the section to which it has been
attached. The AlphaSynapse class does not have a method that returns the identity of
the section itself (presumably the programmer knows that, because the programmer
put it there). Knowing the section, and where it is attached, it is possible to find its path
distance from any point in the cell--see distance() in the Programmer's Reference.
If the cell was specified with 3D data, the xyz coordinates of a sections nodes can
be interpolated, but I don't think you were asking about that.
Post Reply