Thank you, this was very helpful to get me started. I do have a couple more questions.
I succeeded in getting your code working on my own morphologies. However I am trying to tweak the code to do something similar and I realize I don't understand some things. The code you provided creates a plot of the voltage at the soma when a synapse is at some distance from the soma. I would like to change the reference point to a segment on a dendrite and then measure the maximal voltage deflection at each segment some distance away from the reference segment as the result of a synapse at the reference segment. I.e. I am trying to see how a synapse placed at a particular location effects the voltage of other regions of the neuron.
In order to do this, I need to change the reference segment and instead of measuring the voltage deflection at the soma and marching though and placing a synapse at every segment in the neuron, I want to place a synapse somewhere and then march through and measure the maximal voltage deflection at every segment in the neuron. Instead of the distances being positive for apical locations and negative for basal locations, all the segments on one side of the reference section will be positive and everything on the other side will be negative. Below I give it my best shot. My cell.hoc file consists of the cell you used in Figure 4 of your paper. I found it on neuromorpho.org at
http://neuromorpho.org/neuroMorpho/neur ... me=5038801 . I uploaded it into NEURON using Import 3D and then exported it to a hoc file. I got around the error of the single point soma via your recommendation at
http://www.neuron.yale.edu/phpBB/viewto ... ypes#p8782. Then I changed the names of the SectionList to be called apicals and basilars to match your code. So far so good as I use this to recreate Figure 4D and it works.
Then I go on to try to alter the instrumentation. I choose to try to use apic[43] as the reference section and the location of the synapse. In the first block I change the reference point from soma to apic[43] although it doesn't have any effect when I run the code. I also change vsoma to be called vseg since I am no longer measuring the the voltage exclusively at the soma:
Code: Select all
///// instrumentation
objref syn
apic[43] syn = new AlphaSynapse(0) // make soma(0) the "reference point" CHANGED THIS FROM SOMA TO APIC[43] BUT IT DIDNT DO ANYTHING
syn.onset = 1 // ms
syn.tau = 1 // ms
syn.gmax = 500e-6 // uS
syn.e = 0 // mV
objref vseg
vseg = new Vector() // for recordings of voltage at a segment
Then in the next section I change the origin for the distance measurements to apic[43]. This does do something.
Code: Select all
tstop = TSTOP
v_init = V_INIT
objref ampvec, distvec
ampvec = new Vector() // for soma psp amplitudes
distvec = new Vector() // for synaptic distances from soma(0)
apic[43] distance() // make apic[43](0) the origin for distance measurements
Now comes the onepoint() procedure which I don't quite understand. I think I can get rid of the syn.loc line since I no longer have to move the synapse. I think the distvec command will still work since I specified apic[43] as the reference section above. I assume vseg (which was vsoma) needs to marched through --in order to do this, I am guessing that vseg needs to be the current section but I am not sure how specify that. Also, I am not completely sure what the .x[0] means in vseg.x[0]--does this mean the voltage at time = 0? If the .x specifies the section number, then why does vseg.max() work without specifying a section number?
Code: Select all
proc onepoint() { local vmax
// syn.loc($2) // move syn to currentsection($2) //NO LONGER HAVE TO DO THIS
// print secname(), " ", $2 // to verify proper operation of program
distvec.append($1*distance($2)) //I THINK THIS WILL STILL WORK
run()
// assumes that cell was initialized to resting steady state!
vmax = vseg.max() - vseg.x[0] // extract psp amplitude from waveform
ampvec.append(vmax)
}
Specifying g happens as normal:
Code: Select all
objref g // for Graph that shows results
Then comes the allpoints() procedure. I am not sure why you are throwing out the ampvec and the distvec. Then you move on to 'soma for(x)'--I assume x is being counted though but I am not quite sure: does x always mean all segments or sections? Now I need to specify the upstream and downstream segments from my reference point. For my current reference point (apic[43]) apic [44], [45], [46], and [47] are upstream (should be positive numbers) and everything else is downstream (should be negative). Below is my best guess.
Code: Select all
proc allpoints() { local vmax
// throw out old results
ampvec = new Vector()
distvec = new Vector()
// deal with all neurites
printf("Working")
//looks like below makes things positive or negative
soma for(x) {
onepoint(1,x)
printf(".") // indicate progress
}
forsec basilars for (x) if (x>0) {
onepoint(-1,x)
printf(".")
}
forsec apicals for(x) if (x==44 || x==45 || x==46 || x==47){ \\ right here I am trying to say x can equal 44 or 45 or 46 or 47
onepoint(1,x)
printf(".")
}
forsec apicals for (x) if (x!=44||45||46||47){ \\ trying to say NOT 44 or 45 or 46 or 47
onepoint(-1,x)
printf(".")
}
printf("done!\n")
// normalize amplitudes
vmax = ampvec.max()
ampvec.div(vmax)
g = new Graph()
ampvec.mark(g, distvec, "O", 5) // medium small black filled circle
g.exec_menu("View = plot") // autoscale axes
}
When I run my current version I get the following error:
Code: Select all
rniv: subscript out of range x
allpoints()
^
onepoint(1, 0)
allpoints()
Any guidance you are willing to provide would be much appreciated. Thank you in advance!