Problems with using Extracellular Stimulation

Where are they and what do they have?

Moderator: tom_morse

Post Reply
piyush.karande
Posts: 2
Joined: Sun May 02, 2010 9:20 pm

Problems with using Extracellular Stimulation

Post by piyush.karande »

I have been trying to use extracellular stimulation using the scripts at http://www.neuron.yale.edu/ftp/ted/neur ... nd_rec.zip
on morphological RGC cells which I got from http://senselab.med.yale.edu/modeldb/Sh ... odel=18501

But when I insert the xtra mechanism NEURON seems to crash with nrniv.exe.stackdump. And before neuron exits i see a a segmentation violation at the init() of the cell's hoc file.

Is there any way I can use cell's .asc morphological data file in the above url with cell builder to create a session like the one used in extracellular_stim_and_rec.zip?

I am pretty sure I have done all the initializations correctly.

My goal is to investigate the thresholds of the cell when an extracellular electrode is used to stimulate at different positions above the cell.
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Problems with using Extracellular Stimulation

Post by ted »

piyush.karande wrote:when I insert the xtra mechanism NEURON seems to crash with nrniv.exe.stackdump.
Is there any way I can use cell's .asc morphological data file in the above url with cell builder to create a session like the one used in extracellular_stim_and_rec.zip?
Read through that model's mosinit.hoc just a little way and you will discover

Code: Select all

proc restart() {local i
 . . .
	print "loading: ",$s1    
	sprint(tstr, "%s.asc", $s1)
	load_file(1, tstr)
	sprint(tstr, "%s.hoc", $s1)
	load_file(1, tstr)
 . . .
so merely replace initxstim.hoc's
load_file("cell.ses")
with
load_file("foo.asc")
load_file("foo.hoc")
forall insert xtra
where foo is the name of one of their cells, and copy the pertinent .hoc and .asc files (e.g. ctt1209a.hoc and ctt1209a.ses) to the directory that contains initxstim.hoc. Of course, if you want your model cell to use the same ionic currents as Sheasby et al.'s models do, you'll have to put copies of their mod files in that directory and run mknrndll (or nrnivmodl, depending on your OS). And if you want to use other currents, you'll have to add the necessary mod files and make the appropriate changes to foo.hoc.
piyush.karande
Posts: 2
Joined: Sun May 02, 2010 9:20 pm

Re: Problems with using Extracellular Stimulation

Post by piyush.karande »

I had added the xtra mechanism to the hoc file of the cell. any way now when i did what you said ie add

Code: Select all

load_file("ctty238a.asc")

load_file("ctty238a.hoc")

forall insert extracellular
forall insert xtra

forall rx_xtra = 1
forall x_extra = 0
forall y_xtra = 0
forall z_xtra = 0
forall xraxial[0] = 1e+09
forall xraxial[1] = 1e+09
forall xg[0] = 1e+09
forall xg[1] = 1e+09
forall e_extracellular = 0
instead of load_file("cell.ses"), i get the following error

Code: Select all

loading membrane mechanisms from nrnmech.dll
Additional mechanisms from files
 capump_modified.mod spike_modified.mod xtra.mod
        1 
        1 
        1 
        1 
        1 
        1 
nrniv: syntax error
 in setpointers.hoc near line 9
                setpointer im_xtra(x), i_membrane(x)
                    ^
xopen("setpointers.hoc"        )
execute1("{xopen("setpointers.hoc")}"      )
load_file("setpointers.hoc"    )
        0 
nrniv: Segmentation violation
 in setpointers.hoc near line 10
                setpointer ex_xtra(x), e_extracellular(x)
                                            ^
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Problems with using Extracellular Stimulation

Post by ted »

I had added the xtra mechanism to the hoc file of the cell. any way now when i did what you said
Actually you did what I _should_ have said (I should have said to insert not just xtra, but also extracellular). Very good.

I see the cause of the problem. This is a tricky one, because the error message

Code: Select all

nrniv: syntax error
in setpointers.hoc near line 9
                setpointer im_xtra(x), i_membrane(x)
                    ^
is misleading. The problem isn't in setpointers.hoc, it's in interpxyz.hoc which has a proc grindaway() that tries to iterate over all pt3d data (i.e. anatomical measurements of the form (x,y,z,diam)). The model cell specified by ctty238a.asc does use the pt3d style to define the geometry of the sections that it creates--so far so good--but Sheasby et al. wanted their models to have axons, and the anatomical data they were using didn't include axons. So ctty238a.hoc goes on to make a "synthetic axon" by creating three sections called initseg, narrowr, and axon, whose geometry is specified in terms of L and diam, i.e. the "stylized" method for specifying geometry. Consequently those three sections do NOT have pt3d data associated with them, and that's what trips up grindaway().

The fix is to execute define_shape() before loading setpointers.hoc. The first few lines of initxstim.hoc then become

Code: Select all

load_file("nrngui.hoc")
// load_file("cell.ses")
load_file("ctt3219f.asc")
load_file("ctt3219f.hoc")
forall {
  insert extracellular
  insert xtra
}
define_shape() // create pt3d data for the stylized sections

load_file("anatscale.hoc")      // show xyz scale bars
load_file("interpxyz.hoc")      // only interpolates sections that have extracellular
load_file("setpointers.hoc")    // automatically calls grindaway() in interpxyz.hoc
 . . .
Stylized and pt3d specification of geometry are discussed here
http://www.neuron.yale.edu/neuron/stati ... l#Geometry
and define_shape() is discussed here
http://www.neuron.yale.edu/neuron/stati ... fine_shape

Two more problems remain. One is that rigc.ses and rigxc.ses set up range variable plots over paths that don't exist in the new model cell--they refer to sections with the base name dend, but the new model cell has sections whose base name is dend2 (even if the base names were identical, the shape of the new cell is completely different so the paths that are good for it would probably be quite uninteresting in the new cell). The symptom is that, when the hoc parser reaches a statement that refers to a nonexistent section, NEURON emits an error message about a nonexistent section (finally a helpful error message!) and halts. The quickest fix is to edit these two ses files, identifying the code blocks that set up the windows whose graphs refer to nonexistent sections, comment them out, execute initxstim.hoc again, use the NEURON Main Menu toolbar to bring up a new shape plot, use that shape plot to set up the range variable plots that are of interest, and save new session files. This is a little tricky because it involves using the Print & File Window Manager to select which elements of the GUI should be saved to rigc.ses and which should be saved to rigxc.ses.

Anyway, I have now taken care of that and will email you three new files
xinitxstim.hoc
xrigc.ses
xrigxc.ses
xrigc.ses is an updated version of rigc.ses--it uses the latest version of the RunControl panel, and creates one more tool for launching simulations--the "Movie Run" tool, which ensures that space plots are updated on each fadvance() and thus makes them evolve more smoothly in time.

I gave the new ses files new names so I wouldn't confuse them with the originals; ditto for the new hoc file (also made corresponding changes to the hoc files's load_file() statements). Now double clicking on xinitxstim.hoc, or executing
nrngui xinitxstim.hoc
should bring up the model, and clicking on the Init & Run button should launch a simulation.


Finally, the second problem mentioned above: this particular cell model has a few "issues" of its own. The first is that it does not initialize to steady state. That may be partly because of how its mod files are initialized, but I suspect it has more to do with the fact that the model includes calcium accumulation. Ion accumulation mechanisms often have very slow dynamics, and for some reason or other people tend to be careless about initializing them. If you are serious about using these models in your work, you may want to fix this problem. It would be best to discuss this new question in the
Adding new mechanisms and functions to NEURON
viewforum.php?f=16
area of the forum.
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Problems with using Extracellular Stimulation

Post by ted »

There is one more problem with this particular cell model: the properties of the three stylized sections are somewhat arbitrary. Their diameters and lengths may be "plausible," but that's not the same as saying they are based on measurements from this particular cell. Furthermore, the shape and orientation of these structures is completely arbitrary. I won't say anything about their membrane properties.

Look at a graphical rendering of the model cell, and you'll see a long straight horizontal line, like a big antenna--that's the stylized sections. At the left end of this antenna there's a little fuzzy tangle of lint--that's the soma and dendrites. Put this whole structure into an electrical field, and guess which part is going to pick up most of the signal--the big antenna, or the little tangle of lint?

So the structure and biophysical properties of the synthetic axon (I'm counting all three stylized sections as being the "synthetic axon") are likely to dominate the response of the model cell to extracellular stimulation. That is, the response of the model to extracellular stimulation is governed by something that is more or less a fiction.

There is an exception to this rather bleak prospect: the properties of the soma and dendrites will be most important if the extracellular field is most intense in their vicinity, and falls off very rapidly with increasing distance. This is the case with a monopolar or bipolar stimulating electrode located close to the soma and dendrites. How close? Suppose the smallest sphere that completely encloses the soma and dendrites has diameter D. As a rough guess, I would suggest that the distance from the stimulating electrode to the center of this sphere would have to be < D.

And there is also a workaround (although it introduces its own potential problem): don't stimulate the synthetic axon. Instead, stimulate just those sections whose geometry is based on morphometric data. This is easily done--insert extracellular and xtra _before_ you load the file that creates the stylized sections. The first few lines of xinitxstim.hoc become

Code: Select all

load_file("nrngui.hoc")
// load_file("cell.ses")
load_file("ctt3219f.asc")
// defer creation of stylized sections
// so that synthetic axon will not dominate model response
// to extracellular fields
// load_file("ctt3219f.hoc")
forall {
  insert extracellular
  insert xtra
}
load_file("ctt3219f.hoc")
The "problem" that this introduces is that real cells do have axons, which may be quite long and are likely to have specific orientations in space. The decision as to which approach to take (stimulate the axon, vs. don't stimulate the axon) depends on your intended use for the model, and what you know or can assume about the spatial extent and orientation of the extracellular field and the axon.
shwetakgp
Posts: 36
Joined: Sun Jun 16, 2013 1:21 am

Re: Problems with using Extracellular Stimulation

Post by shwetakgp »

use the NEURON Main Menu toolbar to bring up a new shape plot, use that shape plot to set up the range variable plots that are of interest, and save new session files. This is a little tricky because it involves using the Print & File Window Manager to select which elements of the GUI should be saved to rigc.ses and which should be saved to rigxc.ses.
i deleted rigxc.hoc and rigc.hoc and formed rigc.hoc that had graphs of e_extracellular,e_extra and v and made the changes accordingly but the response of graphs is not appropiate .i deleted the code of cell.ses and put my own in it.
i have mailed you a zip file named extrastim cell
it would be a great help if you could see what is wrong
and can i add conductance of na,k,ca ,lea k channels values as input to this model.if yes then how...
any help is greatly appreciated
shwetakgp
Posts: 36
Joined: Sun Jun 16, 2013 1:21 am

Re: Problems with using Extracellular Stimulation

Post by shwetakgp »

can anyone please answer my query....
Post Reply