Page **1** of **1**

### Ephaptically coupling cells within a network

Posted: **Sun Oct 05, 2014 2:26 pm**

by **Qroid_montreal**

I have a question about how to couple cells ephaptically (i.e. membrane currents -> extracellular) in a network. I know how to play a precalculated stimulation to each segment using a vector list. So something like:

Code: Select all

```
segcount=0
forsec cells.o(i).all { // loop through each section of cells.o(i)
if (ismembrane("extracellular")) { // check each section to find one that has xtra
for (x, 0) { // loop through each internal node
veclist.o(segcount).play(&e_extracellular(x), stim_time)
segcount=segcount+1
}
}
}
```

Now, if I want to calculate the extracellular potential using data from each timestep (i.e. actually go from instantaneous membrane currents -> extracellular potential), what would I do? Would I need to put similar lines inside, say, advance()? Or is there a way to set up the coupling before run()?

### Re: Ephaptically coupling cells within a network

Posted: **Sun Oct 05, 2014 6:24 pm**

by **ted**

Best way to do this is with a linear circuit. That would avoid instability, inaccuracy, and speed penalty that would result from trying to force coupling via hoc statements. I'll get back to you with details.

### Re: Ephaptically coupling cells within a network

Posted: **Tue Oct 07, 2014 9:45 am**

by **Qroid_montreal**

Hi Ted - thanks so much. I'll look this up on the forum and the NEURON book in the meantime.

### Re: Ephaptically coupling cells within a network

Posted: **Tue Oct 07, 2014 2:30 pm**

by **ted**

For the benefit of others who may be reading this thread, here is the zip file that I just emailed to you

https://www.neuron.yale.edu/ftp/ted/neuron/ephap.zip
Download and unzip it, then examine notes.txt, and use NEURON to execute initdevel.hoc or inituse.hoc.

### Re: Ephaptically coupling cells within a network

Posted: **Wed Oct 08, 2014 11:47 am**

by **ted**

After uploading ephap.zip, I had some additional thoughts about this topic, so I have now revised notes.txt accordingly (fixing some typos at the same time) and put a new ephap.zip on the web. Here, for those of you who might be curious about whether it's worth getting the new file, are my additional comments:

Finally, a big caveat: in this particular implementation, the two interacting segments are parts of sections that have nseg>1. "What's wrong with that," you ask. Here's what: change nseg and you change not only the size of these segments but also the coupling between them. In other words, nseg is no longer just a simulation parameter--it has now become part of the model specification, that is, part of the specification of the anatomical and biophysical properties of the biological original that are represented in the model. Change nseg and you not only change accuracy of the solution in space, but you also change the model itself. Very bad idea.

It is much better for the coupled segments to belong to sections that have nseg = 1. For this particular model, this means

1. decide how long the coupled segments will be

2. break each axon into three pieces, like so

Code: Select all

```
(this sketch not to scale)
proximal part distal part
===============+===========+===============
region of
ephaptic
interaction
```

where each piece is a separate section.

Make the section that represents the region of

ephaptic interaction long enough to allow the degree of coupling you want, but short enough to be electrotonically compact so that its nseg can be set to 1. The proximal and distal parts can have whatever nseg values are necessary for spatial accuracy.

"Well, exactly what length, diameter, Ra and membrane properties should I assign to the region of

ephaptic interaction?"

That's where your scientific expertise and judgment come in.

### Re: Ephaptically coupling cells within a network

Posted: **Wed Oct 22, 2014 2:29 pm**

by **Qroid_montreal**

Hi Ted - Sorry for the delay. I had a holiday for a week or so.

I've started with your code. Everything works as you say and it's very instructive, so thank you immensely. There's one thing I'm confused about though, and that's how to adapt your code to model the spatial dependency of extracellular potential when the cell is in a uniform medium. If I have it right, your code essentially "wires" the axons of the two cells together. So if im_0 is the net current in the axon of the firing cell, im_1=0 is the current in the axon of the silent cell, then the extracellular potential around both axons is V_e = im_0 * Rx. This means that extracellular potential is independent of the cells' locations. (I also checked this by playing with the cells.o(i).position(0, 100*i, 0) line.)

I'm confused how this connects with a spatially-dependent V_e, for example V_e calculated from equation (2) in Holt and Koch 1999: V_e = i / (4*pi*sig_e*r), where r is the distance from current i. In this case V_e is proportional to 1/r.

This is probably a failing of my knowledge of basic physics, but I'm not clear how to connect the two. I'd like to capture the fact that the ephaptic coupling is stronger if the cells are right on top of each other, and virtually non-existent if they're centimetres apart. My first thought was, for each segment i, calculate and sum the V_e produced by all other segments similarly to Holt and Koch, and introduce this modulation of V_e to each segment i on each step of the iteration. So like you say, "force" the coupling with hoc statements. I'm not sure how to do it with linear circuit though...

### Re: Ephaptically coupling cells within a network

Posted: **Wed Oct 22, 2014 8:09 pm**

by **ted**

The model implementation I created is founded on a narrow interpretation of your original question. I saw it as a request for an ephapse, and I gave you an ephapse. The basis for its implementation is a conceptual model in which the zone of interaction between the two cells is spatially quite restricted. It makes the tacit assumption that extracellular potential is negligibly different from 0 in all locations except the one at which the "ephapse" is located. This conceptual model is roughly analogous to the "axon cap" around the axon hillock of a Mauthner cell.

Before proceeding further, I should point out that NEURON's "extracellular" can only add one or more concentric cable layers around a section (neurite). extracellular provides only "nearest-neighbor interactions" along the length of a section; it is not meant to be used as a means for simulating the spread of electrical signals in a volume conductor. If you absolutely must have a model in which there are "live" extensive

ephaptic interactions between two or more cells, you'll have to couple NEURON to a poisson solver and advance solutions by alternating between the two, e.g. the very naive algorithm

Code: Select all

```
starting from an initial condition in which the extracellular potentials computed by the poisson solver are entirely consistent with the membrane currents calculated by NEURON
REPEAT
based on the membrane currents at t (which were computed by NEURON), the poisson solver computes the extracellular potentials at t+dt
based on the extracellular potentials at t0 (which were computed by the poisson solver), NEURON computes the membrane currents at t+dt
update t to t+dt
UNTIL done
```

This might be adequate if dt is very small; a more sophisticated scheme is possible in which NEURON and the poisson solver repeat each advance from t to t+dt until their solutions converge, before moving on to the next time step.

A simpler alternative is possible if you don't need "live"

ephaptic interactions between cells, e.g. if you are only interested in how the activity of cell A might affect cell B, and are willing to ignore the possible effect of B's activity on A. The way to proceed is

1. use a model of cell A to simulate the activity of cell A, capturing the time course of the net membrane currents produced by all of that cell's segments.

2. run simulations of a model of cell B in which the segments of cell B are exposed to the extracellular potentials generated by cell B. Given the spatial and temporal descriptions of the currents produced by cell A, and the locations of the segment centers of cell B, you can calculate the time course of the extracellular potential for each of B's segments. That computation can be done offline. The results can then be played back during a simulation of cell B (using Vector play to drive each segment's e_extracellular).

### Re: Ephaptically coupling cells within a network

Posted: **Tue Nov 04, 2014 4:05 pm**

by **Qroid_montreal**

Hi Ted - I have a previously coded model that does "off-line" ephaptic coupling. I sent the NEURON membrane currents to an external file, calculated Ve in Matlab, and then used play to control the extracellular voltage in a second run of NEURON. I believe this worked, but it meant that my stimulation was only ever one way. The above posts were for a first attempt at "live" coupling.

I've now coded up your suggestion, and again I believe I have live coupling. It works as long as Ve and dt are small enough. Thanks very much for your help.