extracellular stimulation

Anything that doesn't fit elsewhere.
Post Reply
didu_20
Posts: 12
Joined: Wed Jun 19, 2013 9:05 am

extracellular stimulation

Post by didu_20 » Sat Jun 29, 2013 5:06 pm

one very important favour i am a trainee and i have to simulate extracellular stimuation by an electrode in retinal gnglion cells.please please help me and give me some links .programs or material and stuff.
what all concepts should i know to do that??
i have read the neuron book twice and even gone through your extracellular stimulation and recording zip file but i cnt figure out some things-
1) in the file calcrxc.hoc from this equation - for (x,0) {
r = sqrt((x_xtra(x) - xe)^2 + (y_xtra(x) - ye)^2 + (z_xtra(x) - ze)^2)
what is rx and r ?? are they different?
2) in interpxyz i have not understood how to coordinates of nodes have been calculated from this part - // initialize the destination "independent" vector

Code: Select all

range = new Vector(nseg+2)
		range.indgen(1/nseg)
		range.sub(1/(2*nseg))
		range.x[0]=0
		range.x[nseg+1]=1
and this too -

yint.interpolate(range, length, yy)
zint.interpolate(range, length, zz)
i read about these functions but cnt interpret how they are working here.
3) i read about vector.play but i cnt understand this - vsrc.play(point_process_object, &var, ...) because of that i cnt understand this function in stim.hoc - stim_amp.play(&is_xtra, stim_time, 1)
4) THE BIGGEST PROBLEM IS i read from readme that to run it first complie the xtra file then run initstim and initrec. But when i complie xtra.mod file i shows this ERROR
gcc -DDLL_EXPORT -DPIC -I/src/scopmath -I/src/nrnoc -I/src/oc -I/lib -I/gccinc -I/gcc3inc -L/gcclib -c mod_func.c
mod_func.c: In function ‘modl_reg’:
mod_func.c:16:1: error: ‘_’ undeclared (first use in this function)
mod_func.c:16:1: note: each undeclared identifier is reported only once for each function it appears in
mod_func.c:16:2: error: expected ‘;’ before ‘~’ token
/lib/mknrndll.mak:65: recipe for target `mod_func.o' failed
make: *** [mod_func.o] Error 1

There was an error in the process of creating nrnmech.dll
Press Return key to exit

And on running initxstim it shows this
1
nrniv: xtra is not a Mechanism or Point Process
in cell.ses near line 397
}
^
CellMembrane[0].MechanismStandard("xtra" )
xopen("cell.ses" )
execute1("{xopen("cell.ses")}" )
load_file("cell.ses" )
0
nrniv: syntax error
in cell.ses near line 405
bild.subsets.snlist.object(1).ml.append(tobj)
^
oc>
i know its a lot to ask but please anybody (even the users ) please respond me regarding this asap a i have very less time to make this.Any help is greatly appreciated

shailesh
Posts: 104
Joined: Thu Mar 10, 2011 12:11 am

Re: extracellular stimulation

Post by shailesh » Sat Jun 29, 2013 7:38 pm

Offering my few words of advice (till someone comes in with more expertise).

>> Regarding your big problem..... (4)
It certainly seems to be an issue with the compile process rather than the mod files themselves (especially since the same mod files have been used by several NEURON users). Which version of NEURON are you using (also Windows/Linux)? Importantly, are you able to compile other 'mod' files currently? Try installing the latest NEURON 7.3 (http://www.neuron.yale.edu/neuron/download) and see whether the issue persists.

>> Regarding r and rx in calcrxc.hoc..... (1)
Check the comments at the start of calcrxc.hoc:

Code: Select all

A conductive sphere of radius r0 is suspended in an infinite volume of solution that has resistivity rho [ohm cm].....
The surface area of a sphere with radius r is 4 PI r^2.
The resistance of a shell with thickness dr is 
  rho dr / 4 PI r^2
and the resistance is therefore
    inf
  INTEGRAL rho dr / 4 PI r^2
    r0
                     inf
   = - rho / 4 PI r |     = rho / 4 PI r0
                     r0
So to a first approximation, a monopolar stimulating electrode 
that delivers current I produces a field in which potential V 
is given by 
  V = I rho / 4 PI r
where r is the distance from the center of the electrode.
Now, if you check the statements:

Code: Select all

r = sqrt((x_xtra(x) - xe)^2 + (y_xtra(x) - ye)^2 + (z_xtra(x) - ze)^2)
rx_xtra(x) = (rho / 4 / PI)*(1/r)*0.01        // 0.01 converts rho's cm to um and ohm to megohm
We can identify that r: distance from the center of the electrode whereas rx: transfer resistances

>> About vector.play() in stim.hoc..... (3)
The readme file basically sums it up:
Specifies the time course of the stimulating current, which is saved in a pair of Vectors stim_amp and stim_time. This is done in stim.hoc, which also sets up playback of stim_amp during a simulation by asserting stim_amp.play(&is_xtra, stim_time).
Since is_xtra is GLOBAL, this only has to be done for one instance of xtra, i.e. at just one internal node of only one of the sections that contain xtra.
proc stim_waveform() basically defines a step waveform, as nicely shown in its comments:

Code: Select all

  // index    0  1    2    3        4        5
  // stim vec 0, 0,   1,   1,       0        0
  // time vec 0, DEL, DEL, DEL+DUR, DEL+DUR, DEL+DUR+1
  //  really  0, $1,  $1,  $1+$2,   $1+$2,   $1+$2+1
The y-values (amplitude) for this waveform are stored in a vector stim_amp and x-values (time) are stored in a vector stim_time.

Code: Select all

stim_amp.play(&is_xtra, stim_time, 1) // "interpolated" play
The above statement then feeds in these amplitude values (stim_amp) to 'is' parameter of 'xtra' mechanism (hence called 'is_extra') with the associated time intervals being provided by stim_time. Parameter '1' indicates that continuous mode is employed resulting in linear interpolation for intermediate values. As an example, if:

stim_vec = { 0 , 0 , 1, 1, 0, 0}
time_vec = {0, 5, 5, 10, 10, 11}
This would result in a step waveform as follows:
Amplitude = 0 for 0<=time<=5
Amplitude = 1 for 5<=time<=10
Amplitude = 0 for time>=10

Continuous mode here does linear interpolation to evaluate intermediate values at times that have not been explicitly specified. So, we have, as examples:
At time = 2ms, amplitude = 0
At time = 7ms, amplitude = 1
At time = 20ms, amplitude = 0 and so on...

Since is_xtra is GLOBAL, you just need to set the value for any one instance (at just one internal node of only one of the sections that contain xtra) and it will be applicable to all its instances.

didu_20
Posts: 12
Joined: Wed Jun 19, 2013 9:05 am

Re: extracellular stimulation

Post by didu_20 » Sun Jun 30, 2013 6:41 am

thnk you very much .i have understood everything u have expained.but can you tell how the coordinates of nodes have been calculated?
abd also what are that scale bars ?? i couldnt find anything about them...can please tell me when will you be online today or tomorrow as i have many doubts to ask if you could help me

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

Re: extracellular stimulation

Post by ted » Sun Jun 30, 2013 9:19 pm

First let me thank shailesh for pitching in here. And I must acknowledge the difficulty of understanding all the code.
didu_20 wrote:what is rx and r
shailesh got it right.
in interpxyz i have not understood how to coordinates of nodes have been calculated
If a section is represented by nseg compartments, where along the length of the neurite would the centers of those compartments lie? x3d, y3d, and z3d give us the xyz coordinates of each point along the neurite at which a measurement was made. They also allow us to calculate arc length (in microns) along the centroid of the neurite as we move from the first xyz point to the second etc. and on to the last point. Now imagine a graph with arc length as the x axis and the y axis coordinate as the y axis. This is a piecewise linear plot of the y coordinate along the length of the neurite from one end to the other. If we sample this plot at distances
(i - 0.5)/nseg
where i = 1 . . . nseg
we have the y coordinates of the segment centers. Do the same for the x and z 3d data and we have the xyz coordinates of the segment centers.

interpolate does the job at machine language speeds. It is a Vector class method that resamples sampled (x, y) data at user-specified intervals.
i read about vector.play but i cnt understand this - vsrc.play(point_process_object, &var, ...) because of that i cnt understand this function in stim.hoc -
stim_amp.play(&is_xtra, stim_time, 1)
Suggest you construct a toy program to see how it works.
THE BIGGEST PROBLEM IS i read from readme that to run it first complie the xtra file then run initstim and initrec. But when i complie xtra.mod file
What version of NEURON are you using (what is the first line that NEURON prints to its interpreter window when it starts)? What OS are you using? Are you using mknrndll or nrnivmodl to compile the mod file? What is the path of the directory that contains your mod and hoc files?

Code: Select all

nrniv: xtra is not a Mechanism or Point Process
shows that xtra.mod was not compiled.

The "scale bars" are just dummy sections that are created to display three lines that correspond to 100 um length along the x, y, and z axes from the origin.

didu_20
Posts: 12
Joined: Wed Jun 19, 2013 9:05 am

Re: extracellular stimulation

Post by didu_20 » Tue Jul 02, 2013 10:34 am

thanks ted
i was able to understand the concepts and compile my mod file. but i have a new problem I have made a file called ganglion.hoc and replaced it with cell.ses
and made changes in initxstim.hoc and initxrec.hoc accordingly.
When i compile xtra.mod run initxstim.hoc it shows this error-
nrniv: undefined variable e ^

one more thing
i just opened the hoc code of cell.ses ,deleted it and replaced it with my code of ganglion cell and compiled xtra.mod. On running initxstim.hoc it shows an error.
i have mailed you both the zip files of my codes along with the error they have in two diffrent mails.kindly crosscheck it.
thank you for your help

didu_20
Posts: 12
Joined: Wed Jun 19, 2013 9:05 am

Re: extracellular stimulation

Post by didu_20 » Tue Jul 02, 2013 5:37 pm

i got it right.i was making a mistake.

Post Reply