pyoelectricity
Source code for the associated publication: Schlötter Moritz, Maret Georg, Kleineidam Christoph J (2023) Annihilation of action potentials induces electrical coupling between neurons eLife 12:RP88335
Science Score: 57.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 12 DOI reference(s) in README -
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.6%) to scientific vocabulary
Keywords
Repository
Source code for the associated publication: Schlötter Moritz, Maret Georg, Kleineidam Christoph J (2023) Annihilation of action potentials induces electrical coupling between neurons eLife 12:RP88335
Basic Info
- Host: GitHub
- Owner: moritz-s
- License: gpl-2.0
- Language: Jupyter Notebook
- Default Branch: main
- Homepage: https://doi.org/10.7554/eLife.88335
- Size: 13.6 MB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Pyoelectricity
This repository contains the code behind our publication
Annihilation of action potentials induces electrical coupling between neurons
Please cite as:
Schlötter Moritz, Maret Georg, Kleineidam Christoph J (2023) Annihilation of action potentials induces electrical coupling between neurons eLife 12:RP88335 doi.org/10.7554/eLife.88335
We analyze colliding Action Potentials (APs) in detail to test and refine models of excitable membranes. The results validate the Tasaki-Matsumoto (TM) model and confirm its behavior upon collision. The TM model predicts the extracellular current generated when APs annihilate, such as at synaptic terminals. This calculation enables the estimation of electric (ephaptic) coupling with neighboring neurons. Our findings show that neighboring neurons are especially influenced when Action Potentials annihilate at axon terminals or when they collide. These predictions align well with experimental observations of lateral inhibition in Purkinje cells (e.g. BB2014).
The code is based on the Python library brian. We modeled excitation using the Tasaki-Matsumoto (TM) model and extended it with a repolarization phase, which we call the Relaxing Tasaki-Matsumoto (RTM) model. Additionally, we incorporated the effects of extracellular electric fields through the Generalized Activating Function (see e.g. here), enabling the calculation of ephaptic interactions.
The source code and data is available at osf.io/duyn3/ and moritz-s/Pyoelectricity and is explained in our publication.
Examples
- test-ExternalField.ipynb Test cases for extracellular fields via pyoelectricity.py.
- standalone-ExternalField.ipynb How to implement extracellular fields with the generalized activating function in brian.
- Example1.ipynb A simple example demonstrating the use of our script to calculate ephaptic interactions (also shown below).
Source code files
General - pyoelectricity.py A collection of functions to calculate propagating and colliding APs, the generated extracellular field, and its influence on surrounding cells.
Code used in the publication - ExperimentAnalysis.ipynb Analysis of experimental data. - end-end.py Calculates the examples of ephaptic coupling at end-end synapses. - end-end-plots.ipynb Generates the figures for end-end synapses. - end-shaft.py Calculates the examples of ephaptic coupling at end-shaft synapses. - end-shaft-plots.ipynb Generates the figures for end-shaft synapses. - Pinceau.ipynb Calculation and plot of the pinceau synapse.
Dependencies: brian2 scipy tables tqdm matplotlib jupyter pandas
Code Example
The following code is available as Example1.ipynb. A simple example demonstrating the use of our script to calculate ephaptic interactions.
python
from brian2 import *
from matplotlib import pyplot as plt
import pyoelectricity as pel
Define and run model
```python
Define the source morphology
source_morpho = Cylinder(x=[0, 0.5]cm, diameter=10um, n=1000)
Add a bouton at the end with a diameter three times the nominal size
sourcemorpho.diameter[sourcemorpho.x>(source_morpho.x[-1]-30um)] = 30um
Define the source model
sourceneuron = pel.maketasakineuron(morpho=sourcemorpho)
sourceneuron = pel.makerepolarizingneuron(morpho=sourcemorpho)
sourceneuron = pel.makehhneuron(morpho=sourcemorpho)
run the source simulation
sourcesimulation = pel.runcable(sourceneuron, defaultclockdt=1us, record_dt=1us, Istimulation=0.5*uamp, poststim_duration=4*ms) ```
Check the source AP
python
v, lambd = pel.get_velocity(source_simulation, is_collision=False)
plt.tight_layout()
Theory: 3.41m/s, 0.146mm
Simulation: 3.32m/s, 0.090mm

Define target and calculate ephaptic effect
```python
Define the target
target_morpho = Cylinder(x=[0.25, 0.75]cm, y=[10, 10]um, diameter=10*um, n=500)
calculate electric potential at the target
text, vext = pel.calculateVeParallel(sourcerecording=sourcesimulation, target=targetmorpho, sigma=1/(100ohmmeter)) ```
```python
calculate the impact upon the target
targetsimulation = pel.runImpactSimulation(text, vext, morphology=targetmorpho, Cm=0.01farad/meter2, Ri=1ohm*meter) ```
python
plt.figure(figsize=(12, 5))
extent = [target_simulation.t[0]/ms,target_simulation.t[-1]/ms,
(target_morpho.x[0]-target_morpho.x.min())/mm,
(target_morpho.x[-1]-target_morpho.x.min())/mm]
plt.imshow(target_simulation.v/mV, aspect='auto', extent=extent)
plt.colorbar(label='membrane potential [mV]')
plt.xlabel('time [ms]')
plt.ylabel('position [mm]')
plt.setp(plt.gca(), xlim = (1.2, 1.7), ylim=(2, 3))
[1.2, 1.7, 2.0, 3.0]

python
plt.figure(figsize=(12, 5))
plt.plot(target_morpho.x/mm, np.min(target_simulation.v/mV, axis=1), label='Peak hyperpolarization')
plt.plot(target_morpho.x/mm, np.max(target_simulation.v/mV, axis=1), label='Peak depolarization')
plt.legend()
plt.title('Maximal effect along the target')
plt.xlabel("position [mm]")
plt.ylabel("membrane potential [mV]")
Text(0, 0.5, 'membrane potential [mV]')

Owner
- Login: moritz-s
- Kind: user
- Repositories: 1
- Profile: https://github.com/moritz-s
Citation (CITATION.cff)
cff-version: 1.2.0
title: "Pyoelectricity"
authors:
- family-names: "Schlötter"
given-names: "Moritz"
orcid: "https://orcid.org/0000-0002-1264-7704"
message: "If you use this software, please cite the associated article from preferred-citation. published at eLife Sciences Publications, Ltd"
preferred-citation:
authors:
- family-names: "Schlötter"
given-names: "Moritz"
orcid: "https://orcid.org/0000-0002-1264-7704"
- family-names: "Maret"
given-names: "Georg"
orcid: "https://orcid.org/0000-0003-4069-648X"
- family-names: "Kleineidam"
given-names: "Christoph J"
orcid: "https://orcid.org/0000-0003-0671-1455"
title: "Annihilation of action potentials induces electrical coupling between neurons"
doi: 10.7554/elife.88335
date-released: 2024-11-25
type: article
journal: "eLife Sciences Publications, Ltd"
url: "https://doi.org/10.7554/eLife.88335"
GitHub Events
Total
- Push event: 9
Last Year
- Push event: 9