Since the ultimate aim is to investigate a phenomenon that is produced by the summation
of a large number of inputs that are distributed in space and time, you may also want to
take into account the spatial variation of somatically observed amplitude and time course
(as distance from the soma increases, the same synapse produces smaller, wider
responses at the soma).
I should mention that, for excitatory synapses, the time course and amplitude of synaptic
current is relatively independent of synaptic location and subthreshold fluctuations of
membrane potential. Therefore, if the cell is operating in a region where its IV relationship
is relatively linear, the somatic voltage transient that is produced by an excitatory input
anywhere on the cell is given by the product of the synaptic current (which is location-
independent) and the transfer impedance between the soma and the synaptic location
(which does depend on location).
Back to your original question. Here's a code skeleton.
Code: Select all
// specification of model cell
// topology, geometry, and biophysical properties
create etc.
access soma
. . . etc. . . .
// synaptic mechanism and source of afferent spike "train"
TPRE = 1 // let 1 ms elapse before stimulating the synapse
// so that figures demonstrate a stable baseline
objref precell, nc, syn
syn = new ExpSyn(0.5) // for AMPAergic, Exp2Syn for GABAergic
. . . assign appropriate time constant(s) and reversal potential . . .
pre = new NetStim(0.5)
pre.number = 1
pre.start = TPRE
nc = new NetCon(pre, syn)
// instrumentation
// record v at soma and synaptic locus to a pair of Vectors
// also record time
objref vsoma, vsyn, tvec
vsoma = new Vector()
vsoma.record(&v(0.5), tvec)
objref delayvec
delayvec = new Vector()
// call in the context of a currently accessed section
// with 1 arg that specifies node location
proc putsyn() {
syn.loc($1) // places the synapse
// we also must record v at the new location
vsyn.record(&v($1))
}
// analysis code
PCT = 50 // percent of peak response that you are using to mark the
// "time at which the voltage response occurs"
func latency() { local tsoma, tsyn, i
vsyn.sub(v_init) // eliminate DC baseline
vsoma.sub(v_init)
/* Assuming the synapses are excitatory--
Use Vector class's max() to find vmax, the peak value in vsyn
Then use Vector class's indwhere() to discover the index i of the element of vsyn
which is >= vmax * PCT/100
Then tsyn = tvec.x[i]
Use same strategy to analyze vsoma in order to determine tsoma
*/
return (tsoma-tsyn)
}
// control code
proc batch() {
delayvec = new Vector()
forall for (x) {
putsyn(x)
run()
delayvec.append(latency())
}
}
If you are only interested in latencies for nodes in a particular set of sections, append
the sections of interest to a SectionList and instead of
forall for (x) {
the iterator statement would be
forsec seclist for (x) {
This should get you on the right track. The above code may contain a typo or omit an
important delcaration. Also, I've left out some details, like how to make sure that you
have chosen an appropriate spatial grid, and how to determine what node in the model
corresponds to each element of delayvec, etc..