## Isolate a section from a neuron

The basics of how to develop, test, and use models.
subhasishg
Posts: 7
Joined: Tue Jun 25, 2013 10:22 pm

### Isolate a section from a neuron

Hi,

I have a simple cell modeled with some sections and segments in each. I have HH Mechanism inserted.

1. First, I use a IClamp in section X and plot the voltage at section X & Y.

2. Next, I want to isolate section Y (i.e remove all other sections) and apply a suitable IClamp and generate voltage plot at Y only.

Both the plots in step 1 & 2 for Y should match.

How should I do this, what all things I need to consider.

I had applied KCL=0 and tried to reverse calculate IClamp at section Y. That did not work.
ted
Posts: 5786
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

### Re: Isolate a section from a neuron

subhasishg wrote:I had applied KCL=0 and tried to reverse calculate IClamp at section Y. That did not work.
Why would you expect it to?
I have a simple cell modeled with some sections and segments in each. I have HH Mechanism inserted.
It is no longer simple--it is a system that is distributed in space and has complex membrane properties.
1. First, I use a IClamp in section X and plot the voltage at section X & Y.
2. Next, I want to isolate section Y (i.e remove all other sections) and apply a suitable IClamp and generate voltage plot at Y only.
Both the plots in step 1 & 2 for Y should match.
How should I do this, what all things I need to consider.
Three steps are required.

The first step is to record the time course of v from Y under condition 1.

The second step is to use that waveform as the command for a voltage clamp under condition 2. The voltage clamp's series resistance should be very low, and it should be attached to Y at exactly the same point from which the voltage waveform was initially recorded. You should record the current delilvered by the voltage clamp.

The third step is to use a current clamp to inject exactly that current waveform into Y, again at the same point from which the voltage waveform was initially recorded. In theory this should produce the same voltage waveform in Y as step 2 did, but, if Y contains voltage gated currents, in practice you are likely to be in for a surprise (unlike steps 1 and 2 which should produce no unexpected result). If you are doing this as a homework assignment, expect to have an interesting discussion with your instructor about what happens.

Implementation suggestions:
Use an SEClamp, not a VClamp. See the explanation in the Forum's "Hot tips" area.
Set the SEClamp's series resistance to 1e-3 megohm or even smaller.
Use the Vector class's record() method to capture the time course of the waveforms that you will need into a pair of Vectors (one vector to capture the recorded variable, the other to capture time).
In step 2, use the Vector class's play() method to drive the time course of the SEClamp's amp1 parameter (make sure to set dur1 to a very large value, e.g. 1e9).
In step 3, use the Vector class's play() method to drive the time course of the IClamp's amp parameter (make sure to set del to 0 and dur to a very large value, e.g. 1e9).

You will want to read the Programmer's Reference entries on SEClamp, IClamp, and the Vector class--especially the latter's record() and play() methods.

The entire task will be more easily achieved if you structure it as a sequence of three separate stages, one stage for each of the three steps described above, where the code that accomplishes each stage is contained in its own hoc file (with load_file statements as appropriate for whatever ses files you may find helpful). This implies that stages 1 and 2 will involve writing results to output files, and stages 2 and 3 will involve reading the results that were saved from the previous stage. You will want to read the Programmer's Reference entries about the File class and its methods for saving and retrieving data from files.
subhasishg
Posts: 7
Joined: Tue Jun 25, 2013 10:22 pm

### Re: Isolate a section from a neuron

Sorry for labeling the code as simple, it's definitely not. But, the simulator makes it appear so easy.
Is there any documentation describing the simulator internals. What files should I look into to understand how Neuron goes about doing this calculation.
What all are the parameters to consider.
ted
Posts: 5786
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

### Re: Isolate a section from a neuron

subhasishg wrote:Sorry for labeling the code as simple, it's definitely not.
Actually, the model specification code itself is quite simple. It is the system of equations that govern the behavior of the model that is not simple to understand in all its implications.
Is there any documentation describing the simulator internals.
Chapter 4 of The NEURON Book presents a description of the underlying principles, and chapter 8 discusses the standard run system and simulation execution sequence in some detail. Some of the articles about NEURON present much of this material, e.g.
Hines, M.L. and Carnevale, N.T.
The NEURON simulation environment.
Neural Computation 9:1179-1209, 1997

I'm not sure how much understanding can be gleaned from examining source code, but perhaps Michael Hines can point you to some key files.
What all are the parameters to consider.
To me this is an ill-posed question. "Consider" in what context--NEURON's internal operations, the somewhat vaguely described model cell posited in your original question, or what exactly?
subhasishg
Posts: 7
Joined: Tue Jun 25, 2013 10:22 pm

### Re: Isolate a section from a neuron

Let me just first go through these chapters, I'll come back if required.
Thanks again for your time and help.
hines
Posts: 1600
Joined: Wed May 18, 2005 3:32 pm

### Re: Isolate a section from a neuron

It is unlikely in the extreme that looking at NEURON's c code will help you do your computational experiment. However, the sequence of solution phases for the fixed time step is
implemented in nrn/src/nrnoc/fadvance.c in the function
void nrn_fixed_step() {
beginning on line 293. There is also a very long comment in nrn/src/nrnoc/treeset.c that discusses the structure of the matrix equation representation of the branched cable equation.

However, more relevant to what I understand is your computational experiment. The function you can use to disconnect section Y from its parent is
Y { disconnect() }
i.e. make Y the currently accessed section and disconnect it. (it is not clear if you have any sections connected as children to Y or whether or not you wish to disconnect those as well).
I'll assume you only disconnect Y. Before disconnecting, as Ted advised, record the voltage at Y(0). This can be done with the fragment

Code: Select all

``````objref vy0_vec, t_vec
vy0_vec = new Vector()
t_vec = new Vector()
Y { vy0_vec.record(&v(0)) }
Y { t_vec.record(&t) }
``````
Then, when you do an Init&Run you will have the voltage trajectory information for Y(0) in the vectors.
To prevent future Init&Run from destroying the info in vy0_vec you can either copy with

Code: Select all

``````objref vy0_copy
vy0_copy = vy0_vec.c()
``````
or else stop recording vy0_vec with vy0_vec.play_remove(). I suggest copying. Then you can compare your copy to voltage trajectories resulting from future runs.
Now you can disconnect with
Y { disconnect() }
do another Init&Run and notice that Y (and its subtree, if any) isn't getting any current from its former parent and so the whole subtree stays at rest.

Now, instead of using and IClamp to stimulate Y(0), I prefer the more direct route of using a voltage clamp.
You can add a voltage clamp and play the vy0_copy waveform into it and the Init&Run should give the same result as the connected model. (but better not change dt).

The idiom for the voltage clamp with time dependent control is

Code: Select all

``````objref clamp
Y { clamp = new SEClamp(0) }
clamp.dur1 = 1e9
clamp.amp1=-65
clamp.rs = 1e-3
Y { vy0_copy.play(&clamp.amp1) } // if dt does not change, do not need a t_copy vector as second arg.
``````
Now the voltage in the Y and its subtree should be the same as when it was connected.
I did not exectute any of the above fragments but the idea is sound.
subhasishg
Posts: 7
Joined: Tue Jun 25, 2013 10:22 pm

### Re: Isolate a section from a neuron

Thanks Hines, let me try it out.