Build, simulate, and analyze data-driven multiscale brain circuit models
NetPyNE provides programmatic and graphical interfaces to develop data-driven multiscale brain neural circuit models using Python and NEURON. Users can define models using a standardised JSON-compatible, rule-based, declarative format Based on these specifications, NetPyNE will generate the network in NEURON, enabling users to run parallel simulations, optimize and explore network parameters through automated batch runs, and use built-in functions for visualization and analysis (e.g.,generate connectivity matrices, voltage traces, spike raster plots, local field potentials, and information theoretic measures). NetPyNE also facilitates model sharing by exporting and importing standardized formats: NeuroML and SONATA.
Get started: Dive into modeling with NetPyNE
To get a hands-on start with NetPyNE, a graphical user interface (GUI) makes it simple to develop complex simulations without programming experience.
For an in-depth introduction, you can go through the videos and materials from our recent comprehensive modeling course. For installation steps and several text and video tutorials, see our website or the individual links presented here.
How to use NetPyNE on EBRAINS
We provide EBRAINS specific tutorials on building simple, oscillatory and multiscale networks with reaction-difussion (RxD), importing existing cell models, analysis and plotting of network and simulation results, running batch parameter explorations.
We also make available example motor cortex (M1) and hippocampal CA3 network models. Tutorials can be cloned into a Collab and executed interactively via JupyterLab.
Overview of NetPyNE Components and Workflow
NetPyNE provides a programmatic and graphical interface for the creation, parallel simulation, optimisation, and analysis of data-driven, biophysically detailed multiscale network models in NEURON. This makes multiscale modeling accessible to a wider community, including students and experimentalists; and facilitates and accelerates the workflow of experienced modelers.
NetPyNE and the NetPyNE GUI are available via the EBRAINS platform and the Open Source Brain platform. NetPyNE has also been integrated or interfaced with multiple tools in the community including The Virtual Brain (TVB), the Neuroscience Gateway (NSG), Human Neocortical Neurosolver (HNN), SciUnit/SciDash, LFPy and coreNEURON.
Build, simulate, optimise, visualise and analyse models
Build, simulate and optimise
- Define models using declarative, standardized, rule-based, high-level language (programmatic or via GUI)
- Automatically convert high-level biological specifications to a NEURON network (preventing coding errors and inefficiencies risked with manual implementation)
- Include multiple scales from intra- and extra-cellular molecular reaction-diffusion (RxD) to network level
- Import existing cell models from hoc, Python, NeuroML, and SONATA
- Specify complex connectivity and stimulation patterns at the population, cell, and dendritic level
- Generate a network instance as a Python hierarchical structure with all required NEURON objects
- Easily set up and run parallel simulations, including distributing cells and gathering data from computing nodes
- Run automated parameter explorations/optimizations via grid search or evolutionary algorithms, including simulation submission and management on different environments (local MPI, HPC Slurm/Torque, Neuroscience Gateway)
Visualise and analyse
- Visualize and analyse your model using built-in functions: connectivity, voltage/current traces, molecular concentrations, spike raster plot, firing statistics, information theoretic analysis, etc.
- Position virtual LFP recording electrodes at any arbitrary 3D locations and generate LFP and CSD plots
- Realistic simulation of current dipoles and EEG signals using LFPykit tool
- Load/save from/to common formats (JSON, Pickle, Matlab) and import/export from/to widely-used standards (NeuroML and SONATA)
- Use the web-based GUI to build, run and analyse models, and import/export the model from/to Python scripts
Example models: See NetPyNE in action
There are 20+ example models available to explore in our GitHub repository and 90+ user-developed models. These include NetPyNE models of many different brain regions (e.g. cortex, thalamus, hippocampus, cerebellum), disease (e.g. ischemia, epilepsy, schizophrenia) and other phenomena (e.g. oscillatory coding, sensorimotor learning, memory retrieval, TMS/tDCS stimulation) [5,6].
Below we provide further details of large-scale thalamocortical models built using NetPyNE. A list of publications making use of NetPyNE is also available.
Motor, somatosensory and auditory thalamocortical circuit models
We used NetPyNE to build and simulate large-scale and biologically realistic models of rodent motor (M1), rodent somatosensory (S1), and macaque auditory (A1) thalamocortical circuits. Each model simulates a cortical column and corresponding thalamic circuits and contains in the order of ~15k detailed neurons ~30M synapses.
The model neuronal densities, classes, morphology, biophysics, and connectivity were derived from experimental data. The rodent M1 and S1 models are being used to study neural coding and learning in corticothalamic circuits of the sensorimotor pathway. The macaque A1 model is being used to explore oscillatory mechanisms in the context of speech processing and related disorders. The models may help better understand a variety of diseases, including schizophrenia, Alzherimer’s disease, epilepsy, and motor disorders. See References.
Potjans & Diesmann cortical microcircuit model
The Potjans-Diesmann cortical microcircuit model is a widely used model originally implemented in NEST. It is a full-scale spiking network model of 1 mm² of cortex, comprising four cortical layers, each containing an excitatory and an inhibitory population, with close to 80,000 point neurons.
We reimplemented the model using NetPyNE and reproduced the findings of the original publication. We also implemented a method for scaling the network size that preserves firing rates and other statistics. Our new implementation enabled the use of more detailed neuron models with multicompartmental morphologies and multiple biophysically realistic ion channels. This opens the model to new research, including the study of dendritic processing, the influence of individual channel parameters, the relation to local field potentials (LFPs), and other multiscale interactions.
Get involved in the NetPyNE community
NetPyNE was first released in 2016 and since then has enjoyed a rapidly growing community of users and developers.
Users and developers can interact via Github, the NetPyNE mailing list, two Q&A forums, and regular workshops and courses organised every year. The project is open-source and welcomes contributions: from bug reports and feature requests to actual code improvements (see our contributors guide for more information), and sharing of your models and success stories.
NetPyNE is funded by the National Institutes of Health (NIH), National Institutes of Biomedical Imaging and Bioengineering (NIBIB), the National Science Foundation (NSF), and by the Human Brain Project.
 Dura-Bernal S, Suter B, Gleeson P, Cantarelli M, Quintana A, Rodriguez F, Kedziora DJ, Chadderdon GL, Kerr CC, Neymotin SA, McDougal R, Hines M, Shepherd GMG, Lytton WW. NetPyNE: a tool for data-driven multiscale modeling of brain circuits. eLife 2019;8:e44494, 2019.
 Lytton WW, Seidenstein AH, Dura-Bernal S, McDougal RA, Schurmann F, Hines ML. Simulation neurotechnologies for advancing brain research: Parallelizing large networks in NEURON. Neural Computation, 2016.
 Gleeson P, Cantarelli M, Quintana A, Earnsah M, Piasini E, Birgiolas J, Cannon RC, Cayco- Gajic A, Crook S, Davison AP, Dura-Bernal S, et al. Open Source Brain: a collaborative resource for visualizing, analyzing, simulating and developing standardized models of neurons and circuits. Neuron, 10.1016/j.neuron.2019.05.019. 2019.
 Dai K, Hernando J, Billeh JN, Gratiy SL, Planas J, Davison AP, Dura-Bernal S, Gleeson P, Devresse A, Gevaert M, King JG, Van Geit WAH, Povolotsky AV, Muller E, Courcol J-D, Arkhipov A. The SONATA Data Format for Efficient Description of Large-Scale Network Models. PLOS Computational Biology 16(2): e1007696. 2019.
 Metzner, C., Mäki-Marttunen, T., Karni, G. et al. The effect of alterations of schizophrenia-associated genes on gamma band oscillations. Schizophr 8, 46 (2022). https://doi.org/10.1038/s41537-022-00255-7
 Medlock L, Sekiguchi K, Hong S, Dura-Bernal S, Lytton WW, Prescott SA. Journal of Neuroscience, 13 April 2022, 42 (15) 3133-3149; DOI: https://doi.org/10.1523/JNEUROSCI.1199-21.2022
 Dura-Bernal S, Neymotin SA, Suter BA, Dacre J, Moreira JVS, Urdapilleta E, Schiemann J, Duguid I, Shepherd GMG, Lytton WW. (2023) Multiscale model of primary motor cortex circuits reproduces in vivo cell type-specific dynamics associated with behavior. Cell Reports 2023 Jun 8;42(6):112574. [PDF]
 Dura-Bernal S, Griffith EY, Barczak A, O’Connell MN, McGinnis T, Schroeder C, Lytton WW, Lakatos P, Neymotin SA. Data-driven multiscale model of macaque auditory thalamocortical circuits reproduces in vivo dynamics. BioRxiv 2022.02.03.479036; doi: https://doi.org/10.1101/2022.02.03.479036. 2022.
 Borges F, Moreira J, Takarabe LM, Lytton WW, Dura-Bernal S. (2022) Large-scale biophysically detailed model of somatosensory thalamocortical circuits in NetPyNE. Frontiers in Neuroinformatics doi: 10.3389/fninf.2022.884245
 Sivagnanam S, Gorman W, Doherty D, Neymotin S, Hovhannisyan H, Fang S, Lytton W, Dura-Bernal S. (2020) Simulating large-scale models of brain neuronal circuits using Google Cloud Platform. Practice and Experience in Advanced Research Computing, PEARC2020.
 Romaro C, Najman F, WW Lytton, Roque AC, Dura-Bernal S (2021) NetPyNE implementation and rescaling of the Potjans-Diesmann cortical microcircuit model. Neural Computation, 33 (7): 1993–2032.