Skip to content

Commit

Permalink
Merge pull request #669 from suny-downstate-medical-center/sd_example
Browse files Browse the repository at this point in the history
Spreading Depression Example
  • Loading branch information
salvadord authored Mar 9, 2022
2 parents 7eb021c + d98c384 commit 64a0ca9
Show file tree
Hide file tree
Showing 7 changed files with 1,801 additions and 0 deletions.
103 changes: 103 additions & 0 deletions examples/spreadingDepression/Neuron.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
from neuron import h
from cfg import cfg
import numpy as np

class ENeuron:
""" A neuron with soma and dendrite with; fast and persistent sodium
currents, potassium currents, passive leak and potassium leak and an
accumulation mechanism. """
def __init__(self):
self.soma = h.Section(name='Esoma', cell=self)
# add 3D points to locate the neuron in the ECS
self.soma.pt3dadd(0.0, 0.0, 0.0, 2.0 * cfg.somaR)
self.soma.pt3dadd(0.0, 2.0 * cfg.somaR, 0.0, 2.0 * cfg.somaR)
if cfg.epas:
self.soma.insert('pas')
self.soma(0.5).pas.e = cfg.epas
self.soma(0.5).pas.g = cfg.gpas

class E2Neuron:
""" A neuron with soma and dendrite with; fast and persistent sodium
currents, potassium currents, passive leak and potassium leak and an
accumulation mechanism. """
def __init__(self):
self.soma = h.Section(name='E2soma', cell=self)
# add 3D points to locate the neuron in the ECS
self.soma.pt3dadd(0.0, 0.0, 0.0, 2.0 * cfg.somaR)
self.soma.pt3dadd(0.0, 2.0 * cfg.somaR, 0.0, 2.0 * cfg.somaR)
if cfg.epas:
self.soma.insert('pas')
self.soma(0.5).pas.e = cfg.epas
self.soma(0.5).pas.g = cfg.gpas

class I2Neuron:
""" A neuron with soma and dendrite with; fast and persistent sodium
currents, potassium currents, passive leak and potassium leak and an
accumulation mechanism. """
def __init__(self):
self.soma = h.Section(name='I2soma', cell=self)
# add 3D points to locate the neuron in the ECS
self.soma.pt3dadd(0.0, 0.0, 0.0, 2.0 * cfg.somaR)
self.soma.pt3dadd(0.0, 2.0 * cfg.somaR, 0.0, 2.0 * cfg.somaR)
if cfg.epas:
self.soma.insert('pas')
self.soma(0.5).pas.e = cfg.epas
self.soma(0.5).pas.g = cfg.gpas

class E4Neuron:
""" A neuron with soma and dendrite with; fast and persistent sodium
currents, potassium currents, passive leak and potassium leak and an
accumulation mechanism. """
def __init__(self):
self.soma = h.Section(name='E4soma', cell=self)
# add 3D points to locate the neuron in the ECS
self.soma.pt3dadd(0.0, 0.0, 0.0, 2.0 * cfg.somaR)
self.soma.pt3dadd(0.0, 2.0 * cfg.somaR, 0.0, 2.0 * cfg.somaR)
if cfg.epas:
self.soma.insert('pas')
self.soma(0.5).pas.e = cfg.epas
self.soma(0.5).pas.g = cfg.gpas

class I4Neuron:
""" A neuron with soma and dendrite with; fast and persistent sodium
currents, potassium currents, passive leak and potassium leak and an
accumulation mechanism. """
def __init__(self):
self.soma = h.Section(name='I4soma', cell=self)
# add 3D points to locate the neuron in the ECS
self.soma.pt3dadd(0.0, 0.0, 0.0, 2.0 * cfg.somaR)
self.soma.pt3dadd(0.0, 2.0 * cfg.somaR, 0.0, 2.0 * cfg.somaR)
if cfg.epas:
self.soma.insert('pas')
self.soma(0.5).pas.e = cfg.epas
self.soma(0.5).pas.g = cfg.gpas

class E5Neuron:
""" A neuron with soma and dendrite with; fast and persistent sodium
currents, potassium currents, passive leak and potassium leak and an
accumulation mechanism. """
def __init__(self):
self.soma = h.Section(name='E5soma', cell=self)
# add 3D points to locate the neuron in the ECS
self.soma.pt3dadd(0.0, 0.0, 0.0, 2.0 * cfg.somaR)
self.soma.pt3dadd(0.0, 2.0 * cfg.somaR, 0.0, 2.0 * cfg.somaR)
if cfg.epas:
self.soma.insert('pas')
self.soma(0.5).pas.e = cfg.epas
self.soma(0.5).pas.g = cfg.gpas

class I5Neuron:
""" A neuron with soma and dendrite with; fast and persistent sodium
currents, potassium currents, passive leak and potassium leak and an
accumulation mechanism. """
def __init__(self):
self.soma = h.Section(name='I5soma', cell=self)
# add 3D points to locate the neuron in the ECS
self.soma.pt3dadd(0.0, 0.0, 0.0, 2.0 * cfg.somaR)
self.soma.pt3dadd(0.0, 2.0 * cfg.somaR, 0.0, 2.0 * cfg.somaR)
if cfg.epas:
self.soma.insert('pas')
self.soma(0.5).pas.e = cfg.epas
self.soma(0.5).pas.g = cfg.gpas

# v0.00 - classes for each cell type in network
38 changes: 38 additions & 0 deletions examples/spreadingDepression/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# RxD Spreading Depression/Depiolarization
## Overview
A tissue-scale model of spreading depolarization (SD) in brain slices
ported to NetPyNE from [Kelley et al. 2022](https://github.com/suny-downstate-medical-center/SDinSlice).

We use NetPyNE to interface with the NEURON simulator's reaction-diffusion framework to embed thousands of neurons
(based on the the model from Wei et al. 2014)
in the extracellular space of a brain slice, which is itself embedded in an bath solution.
![model schematic](./schematic.png)
We initiate SD in the slice by elevating extracellular K+ in a spherical region at the center of the slice.
Effects of hypoxia and propionate on the slice were modeled by appropriate changes to the volume fraction
and tortuosity of the extracellular space and oxygen/chloride concentrations.

In this example, we use NetPyNE to define the cells, extracellular space,
ion/oxygen dynamics, and channel/cotransporter/pump dynamics, but we use
calls to NEURON to handle running the simulation and interval saving.

## Setup and execution
Requires NEURON with RxD and Python. We recommend using [MPI](https://www.open-mpi.org/) to parallelize simulations. Simulations, especially without
multiple cores, may take upwards of thiry minutes.

To run the simulation on a sinle core:
```
python3 init.py
```
To run on (for instance) 6 cores with MPI:
```
mpiexec -n 6 nrniv -python -mpi init.py
```

Parameters like slice oxygenation, radius and concentration of the K+ bolus used
to initiate SD, neuronal density, etc. can be changed by editing **cfg.py**.

## References
Craig Kelley, Adam J. H. Newton, Sabina Hrabetova, Robert A. McDougal, and William W. Lytton. 2022. “Multiscale Computer Modeling of Spreading Depolarization in Brain Slices.” bioRxiv. https://doi.org/10.1101/2022.01.20.477118.

Yina Wei, Ghanim Ullah, and Steven J. Schiff. "Unification of neuronal spikes, seizures, and spreading depression." Journal of Neuroscience 34, no. 35 (2014): 11733-11743.
https://doi.org/10.1523/JNEUROSCI.0516-14.2014
Loading

0 comments on commit 64a0ca9

Please sign in to comment.