Efficient simulation of 3D reaction-diffusion in models of neurons (McDougal et al, 2022)

 Download zip file 
Help downloading and running models
Accession:267018
Validation, visualization, and analysis scripts for NEURON's 3D reaction-diffusion support.
Reference:
1 . McDougal RA, Conte C, Eggleston L, Newton AJH, Galijasevic H (2022) Efficient Simulation of 3D Reaction-Diffusion in Models of Neurons and Networks Front. Neuroinform.
Model Information (Click on a link to find other models with that property)
Model Type:
Brain Region(s)/Organism:
Cell Type(s):
Channel(s):
Gap Junctions:
Receptor(s):
Gene(s):
Transmitter(s):
Simulation Environment: NEURON; Python;
Model Concept(s): Methods; Reaction-diffusion;
Implementer(s):
import time
from neuron import h, rxd

h.load_file("import3d.hoc")


class Cell:
    def __init__(self, filename):
        cell = h.Import3d_SWC_read()
        cell.input(filename)
        i3d = h.Import3d_GUI(cell, False)
        i3d.instantiate(self)


if __name__ == "__main__":
    import pandas as pd
    import sqlite3
    import sys

    conn = sqlite3.connect("discretization.db")
    filename = sys.argv[1]
    dx = float(sys.argv[2])
    print(f"processing {filename} at dx={dx}")
    cell = Cell(filename)
    rxd.set_solve_type(cell.all, dimension=3)
    cyt = rxd.Region(cell.all, name="cyt", dx=dx)
    x = rxd.Species(cyt, name="x")
    start = time.perf_counter()
    rxd.re_init()
    elapsed = time.perf_counter() - start
    print(f"elapsed time: {elapsed} sec")
    surface_area = sum(x.nodes.surface_area)
    volume = sum(x.nodes.volume)
    data = pd.DataFrame(
        {
            "morphology": [filename],
            "dx": [dx],
            "volume": [volume],
            "surface_area": [surface_area],
            "num_voxels": [len(x.nodes)],
            "num_surface_voxels": [
                len([node for node in x.nodes if node.surface_area])
            ],
            "discretization_time": [elapsed],
            "num_sections": [len(cell.all)],
            "sum_lengths": [sum([sec.L for sec in cell.all])],
        }
    )
    data.to_sql("morphology", conn, if_exists="append", index=False)

Loading data, please wait...