## Measuring the distance of a synapse

The basics of how to develop, test, and use models.
miklos
Posts: 7
Joined: Sun Nov 14, 2010 11:03 am

### Measuring the distance of a synapse

Hi!

I would like to know if it is possible to measure the distance of a gap junction/synapse from a given section of the cell. I used the distance() function, but an error occured: "distance not a public member of Gap". I interpreted the gap.mod from The NEURON Book. What would be a proper solution?

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

### Re: Measuring the distance of a synapse

What was the hoc code that generated the error message?
miklos
Posts: 7
Joined: Sun Nov 14, 2010 11:03 am

### Re: Measuring the distance of a synapse

objref vec
vec = new Vector()

proc dist_gap(){
access soma
distance()
for i=0,3{
vec.append(g.distance())
}
}
ted
Posts: 5793
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

### Re: Measuring the distance of a synapse

Well, there's your problem. The error message was right. The documentation of "distance" in the Programmer's Reference says

Code: Select all

``````distance() with no arguments
specifies the origin as location 0 of the currently accessed section.
distance(x) (0<=x<=1)
returns the distance (in microns) from the origin to this point on the currently accessed section``````
It only talks about points on sections. Says nothing about gap junctions or anything else. For example, to find the distance between the 0 end of soma and the midpoint of dend[25], you'd do
soma distance()
dend[25] { print distance(0.5) }

By the way, code should only contain one access statement. Read about that in the "Hot tips" area of the NEURON Forum
viewforum.php?f=28
Use only one "access" statement
miklos
Posts: 7
Joined: Sun Nov 14, 2010 11:03 am

### Re: Measuring the distance of a synapse

Thank you for the correction!
ted
Posts: 5793
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

### Re: Measuring the distance of a synapse

Thanks for using NEURON.
miklos
Posts: 7
Joined: Sun Nov 14, 2010 11:03 am

### Re: Measuring the distance of a synapse

I have a further question of the location and the connection of the gap junctions.

I located them on the two different cells which I would like to connect, but it was not successful.
1) the distance() function - with 0.5 in the argument -returns with "1e+20" (which means there are no continuous path between the soma and the gap junction according to the programmer's reference)
2) after injecting a depolarizing current (IClamp), only one cell (the one which received the injection directly) was depolarized, the other cell's membrane potential remains at the resting level.

I think I made some mistakes on the location of the gap junctions, but unfortunately I'm not able to figure it out.

My code if the following, where dendb and dendr are the two different dendrites of the two cells which I would like to connect. The .mod file of the gap junction is still the same from the NEURON Book.

Code: Select all

``````objref g[4]
for i=0,3 {
g[i] = new Gap(0.5)
g[i].g = 3
}

dendb[126] g[0].loc(0.953)
dendr[3] g[1].loc(0.409)

setpointer g[0].vgap, dendr[3].v(0.409)
setpointer g[1].vgap, dendb[126].v(0.953)

dendb[76] g[2].loc(0.793)
dendr[111] g[3].loc(0.594)

setpointer g[2].vgap, dendr[111].v(0.594)
setpointer g[3].vgap, dendb[76].v(0.793)
``````
ted
Posts: 5793
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

### Re: Measuring the distance of a synapse

miklos wrote:I located them on the two different cells which I would like to connect, but it was not successful.
1) the distance() function - with 0.5 in the argument -returns with "1e+20" (which means there are no continuous path between the soma and the gap junction according to the programmer's reference)
That is as expected if a point process is attached to one cell and you try to measure the distance between that location and the soma of the other cell.
2) after injecting a depolarizing current (IClamp), only one cell (the one which received the injection directly) was depolarized, the other cell's membrane potential remains at the resting level.
Have you examined the gap junction mechanisms' i variables? If the i variables are zero, did you examine the membrane potentials on the two sides of each gap to verify that your current injection changes at least one of them?
miklos
Posts: 7
Joined: Sun Nov 14, 2010 11:03 am

### Re: Measuring the distance of a synapse

I examined the variables, and the problem is solved now. Thank you!