Page 1 of 1

recording axial current

Posted: Wed Oct 16, 2013 6:29 pm
by xiaosage
Hi,

I wonder if it is possible to record the internal axial current between two compartment/segment? For instance, I want to record all the current sources in the soma, and I can have soma.ina, soma.ik, etc to record all types of ionic current, but I do not know how to record the axial current flowing into the soma from the adjacent dendrites. Could anyone help to answer it? Many thanks!

Re: recording axial current

Posted: Wed Oct 16, 2013 7:26 pm
by ted
Record the membrane potential at the centers of the two compartments.
After the end of the simulation, calculate the axial current from Ohm's law.
Hint: the axial resistance between two adjacent compartments is given by the hoc function ri(). Example:
Suppose dend has nseg = 3, and you want to know the axial current between the middle segment and the last segment in dend. The segment centers are located at dend(0.5) and dend(5/6), so this statement
dend print ri(5/6)
will print the axial resistance between their centers. If you recorded the membrane potentials at 0.5 and 5/6 to vectors called v1 and v2, respectively, the axial current can be calculated by executing these three statements
objref iax
iax = new Vector()
dend iax.c(v1).sub(v2).div(ri(5/6))
after the end of a simulation.

Note that iax will be in nanoamperes, because membrane potential is in mV and ri is in megohms.

Be sure to read the Programmer's Reference entries about ri and the Vector class's c, sub, and div methods.

Re: recording axial current

Posted: Sat Jul 22, 2017 8:10 pm
by asb
Hi Ted,

I have a (very) simple follow-up question about this. If I am interested in axial current flowing from a dendrite (nseg=3) to the soma (nseg =1) is it just a matter of:
1) record voltage at soma(0.5) and dendrite(1/6)
2) get Ri at dendrite(1/6) -- (I understand this is calculated at the parent end of the segment...)
3) get current by Ohms law as per your post above

Thanks in advance

Re: recording axial current

Posted: Mon Jul 24, 2017 7:43 pm
by ted
asb wrote:If I am interested in axial current flowing from a dendrite (nseg=3) to the soma (nseg =1) is it just a matter of:
1) record voltage at soma(0.5) and dendrite(1/6)
2) get Ri at dendrite(1/6) -- (I understand this is calculated at the parent end of the segment...)
Yes. If you follow the usual conventions for model construction
(treat the soma as the root section of the entire cell (i.e. the section that has no parent,
connect the 0 end of any child section to its parent section)
then, given that dendrite.nseg is 3, the current between dendrite's nodes at 0 and 1/6 will indeed be the same as the current that passes between dendrite and soma.

Here's a suggestion: instead of referring to ri(1/6) and dendrite.v(1/6), take advantage of the fact that
rangevar(range)
refers to the value of rangevar at the _internal_ node closest to range. This means that
dendrite.v(1e-3)
and
ri(1e-3)
refer to the membrane potential at the first internal node of dendrite
and
the axial resistance between the first internal node of dendrite and dendrite's 0 end, as long as dendrite.nseg is < 500 (a reasonable assumption in most cases). This means your code will work as you expect it to as long as dendrite.nseg is < 500.

Re: recording axial current

Posted: Wed Jul 26, 2017 8:24 am
by asb
Thanks Ted - much appreciated

Re: recording axial current

Posted: Wed Feb 24, 2021 1:46 am
by OronKotler
ted wrote: Wed Oct 16, 2013 7:26 pm Record the membrane potential at the centers of the two compartments.
After the end of the simulation, calculate the axial current from Ohm's law.
Hint: the axial resistance between two adjacent compartments is given by the hoc function ri(). Example:
Suppose dend has nseg = 3, and you want to know the axial current between the middle segment and the last segment in dend. The segment centers are located at dend(0.5) and dend(5/6), so this statement
dend print ri(5/6)
will print the axial resistance between their centers. If you recorded the membrane potentials at 0.5 and 5/6 to vectors called v1 and v2, respectively, the axial current can be calculated by executing these three statements
objref iax
iax = new Vector()
dend iax.c(v1).sub(v2).div(ri(5/6))
after the end of a simulation.

Note that iax will be in nanoamperes, because membrane potential is in mV and ri is in megohms.

Be sure to read the Programmer's Reference entries about ri and the Vector class's c, sub, and div methods.


Hi Ted, thanks for all your help.
Is there a way to write a code for these in a mod file?
I am trying to measure the axial current between every segment in an object.
What is the best way to approach this?
Thanks again!

Re: recording axial current

Posted: Wed Feb 24, 2021 10:45 am
by ted
Is there a way to write a code for these in a mod file?
Nope. hoc or Python. The example in my old post is in hoc.
I am trying to measure the axial current between every segment in an object.
How do you plan to deal with branch points? The notion of "axial current between every segment" breaks down at branch points.