How to get synapse offset/position

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
vogdb
Posts: 28
Joined: Sun Aug 13, 2017 9:51 am

How to get synapse offset/position

Post by vogdb » Thu Nov 21, 2019 5:46 am

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())

vogdb
Posts: 28
Joined: Sun Aug 13, 2017 9:51 am

Re: How to get synapse offset/position

Post by vogdb » Thu Nov 21, 2019 11:58 am

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.

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

Re: How to get synapse offset/position

Post by ted » Thu Nov 21, 2019 1:25 pm

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?

vogdb
Posts: 28
Joined: Sun Aug 13, 2017 9:51 am

Re: How to get synapse offset/position

Post by vogdb » Tue Nov 26, 2019 5:01 am

Thank you, Ted! I heard of *d_lambda* but forgot its specifics. My purpose was rather educational.

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

Re: How to get synapse offset/position

Post by ted » Tue Nov 26, 2019 2:53 pm

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)
)

vogdb
Posts: 28
Joined: Sun Aug 13, 2017 9:51 am

Re: How to get synapse offset/position

Post by vogdb » Wed Nov 27, 2019 3:52 am

Thank you so much! This is a very useful information for me.

Post Reply