Page 1 of 1

How to get synapse offset/position

Posted: Thu Nov 21, 2019 5:46 am
by vogdb
Hi! Can somebody please clarify. It looks I'm missing something fundamental.

How to know that syn is at 0.77 offset? get_segment().x, get_loc return 0.5. Do I miss something? Is syn moved to the offset 0.5 after instantiation?

Code: Select all

from neuron import h
h.load_file('stdrun.hoc')
dend = h.Section(name='dend')
dend.L = 200
syn = h.ExpSyn(dend(0.77))
print(syn.get_segment().x)
print(syn.get_loc())

Re: How to get synapse offset/position

Posted: Thu Nov 21, 2019 11:58 am
by vogdb
Aha, I see. It is up to the number of segments in section. With high enough number of segments the synapse is placed to a nearly correct position otherwise it is placed as close as possible. So if I do

Code: Select all

dend.nseg = 100
then I have 0.775 as my synapse position.
This is very tricky.

Re: How to get synapse offset/position

Posted: Thu Nov 21, 2019 1:25 pm
by ted
If it is absolutely essential to place "something" at a very particular location along a neurite, then represent the neurite by two sections connected in series, assign each section whatever length you need, and place the "something" at their junction point. Then you are free to use whatever values of nseg are necessary for adequate spatial accuracy of the simulation--and those values will probably be a lot smaller than 100. By the way, are you aware of the d_lambda rule for deciding what value of nseg to use?

Re: How to get synapse offset/position

Posted: Tue Nov 26, 2019 5:01 am
by vogdb
Thank you, Ted! I heard of *d_lambda* but forgot its specifics. My purpose was rather educational.

Re: How to get synapse offset/position

Posted: Tue Nov 26, 2019 2:53 pm
by ted
Good. I hope you're still in an educational mood. The d_lambda rule is a rational basis for specifying the spatial discretization of a model. It involves setting nseg to a value that is a small fraction of the AC length constant at a high frequency. The rationale behind it is developed in the second half of this article
NEURON: a tool for neuroscientists
Hines, M.L. and Carnevale, N.T.
The Neuroscientist 7:123-135, 2001
Here's a revised preprint of that article https://neuron.yale.edu/neuron/static/p ... e_rev2.pdf
and you'll find a bit of code that implements the rule on this page
https://neuron.yale.edu/neuron/static/d ... ambda.html
with instructions for how to use it with hoc. The "trick" for reusing this code with Python is simply
h.xopen("fixnseg.hoc")
h.geom_nseg()
If the model cell in question doesn't have a soma, comment out the
soma area(0.5)
statement in proc geom_nseg() (i.e. change it to
// soma area(0.5)
)

Re: How to get synapse offset/position

Posted: Wed Nov 27, 2019 3:52 am
by vogdb
Thank you so much! This is a very useful information for me.