Page 1 of 1

Some questions on plot [Ca2+]i vs. distance

Posted: Sun Oct 18, 2020 10:40 pm
by langzhou
Dear all,

I am a graduate student and have just come into contact with the field of computational neuroscience. My major is biomedical engineering, and my programming ability is very limited. In the process of using NEURON, I encountered some problems.

Recently I am learning calcium dynamics of astrocytes. Not long ago I read an article "Disentangling astroglial physiology with a realistic cell model in silico". This article systematically incorporate multi-scale, tri-dimensional astroglial architecture into a realistic multi-compartmental cell model, which constrain by empirical tests and integrate into the NEURON computational biophysical environment. One of the functions on display is of great interest to me, although it seems easy to implement. I want to get a graph of the concentration of calcium ions varying with distance during the transmission of calcium waves, as shown in the first figure. How to use the soma as the origin and draw the changes on both sides of the soma. In my own attempts, the results always show the concentration changes on the positive half axis (the second figure). I think there is a problem with my code, and I would like to ask you specifically.


The code is very simple, maybe it is easy to spot the mistake.

//The code is written by imitating similar code in some models, and my programming base was really poor. ╥﹏╥...
removeIfExists(flush_list, graphCaWaveCai)
graphCaWaveCai = new Graph()
graphCaWaveCai.size(-50, 50, 0, 0.008)
graphCaWaveCai.label(0.5, 0.09, "Distance(um)", 2, 1, 0, 0, 1)
graphCaWaveCai.label(0.1, 0.9, "[Ca2+]i(mM)", 2, 1, 0, 0, 1)
CaWaveCaiplot=new RangeVarPlot("cai")
soma CaWaveCaiplot.begin(0)
dendrite CaWaveCaiplot.end(1)
graphCaWaveCai.addobject(CaWaveCaiplot, 1, 1, 1, 1)

Thank you so much in advance for the help!

Re: Some questions on plot [Ca2+]i vs. distance

Posted: Thu Oct 22, 2020 10:58 am
by ted
Read the Programmer's Reference documentation of the RangeVarPlot class ... ngevarplot.

First, some definitions.

Parent section and child section: The statement
connect foo, bar
connects section foo to section bar. bar is the parent and foo is the child.

Root section and root node: Every model cell has one root section and one root node. The root section is the section that has no parent. The root node is the 0 end of the root section.

Next, a rule whose purpose is to keep you from becoming confused. If you violate this rule, NEURON will still work properly and generate correct results, but you are going to have a hard time managing parameters and understanding variables whose values depend on location, and your range variable plots will be very difficult to understand. The rule:
When building a model cell, always connect the 0 end of the child section to its parent section. NEVER connect the child section's 1 end to the parent. That way, when you iterate over a section with
for (x)
for (x,0)
you can always think "moving away from the root node."
Also, if you're thinking about different locations x1 and x2 along a section, you'll know that if x2 > x1, then x2 is farther away from the soma than x1 is.

Finally we get to distance in a range variable plot. Distance is positive along those parts of the path that move AWAY from the root node. It is negative along those parts of the path that move TOWARD the root node.

Consider a model with a root section called soma, and a dend section that is connected to the 1 end of soma.

connect dend(0), soma(1)

soma(0) is the root node of the model. dend(1) is the distal end of dend.

objref rvp, g
rvp = new RangeVarPlot("cai")
soma rvp.begin(0)
dend rvp.end(1)
g = new Graph()

The range variable plot will be drawn in graph g.
The path starts at the root node of the model and ends at the distal end of dend.
Distance will be >= 0 at every point along this path.

If you want an rvp to have distance < 0 over some part of its path, you must define a path that includes a part where movement is toward the soma. For example suppose the model cell has another dendrite called dend1 and that dend1 was connected to the soma like this

connect dend1(0), soma(1)
objref rvp1
rvp1 = new RangeVarPlot("cai")
dend1 rvp1.begin(1)
dend rvp.end(1)

This path starts at the distal end of dend1 and moves toward its proximal end. The movement along this branch of the rvp is toward the root node of the model (soma(0)), so distances will be < 0. After the path reaches the 0 end of dend1, it shifts to the 0 end of dend and then moves toward the 1 end of dend. Movement along this branch of the rvp is away from the root node of the model, so this part of the rvp will be plotted with positive distances.

Re: Some questions on plot [Ca2+]i vs. distance

Posted: Fri Oct 23, 2020 8:10 am
by langzhou
Thank you for your reply!

What I wanted to do before was to plot the change in the Ca of the whole astrocyte with distance (i.e. Ca concentration of all dendrites located at the same distance from the soma). I wanted to do it through "RangeVarPlot" before, I tried many times but it didn't work . Then I realized that it seemed impossible to do this (or there are other ways to achieve it?) because the number of dendrites was cluttered. Later I used “Space Plot”, I found that in fact it was the change along a line distributed on both sides of the soma. Combined with your reply, I understand where I made a mistake before. It seems that I still need to patch up knowledge about NEURON and some basic definitions.

Thank you again for your advice. It's very helpful to me.

Best regards and many thanks,