Python packages for the rodent neuroscientist

Ning Leow
4 min readSep 8, 2021

--

I decided to make a list of useful Python-based resources that some amazing fellow scientists and programmers have made available to the neuroscience community! This is by no means meant to be an exhaustive list, and is heavily biased towards neuroscientists using rodent models! Great lists for neuroscientists using other techniques like EEG, fMRI, MEG can be found here & here

Last updated 23th Nov 2023

Anatomy & Microscopy

  • brainreg— Atlas registration and segmentation
  • brainrender — Visualize neuro-anatomical data in 3d
  • TRACER — Toolkit for Reconstructing Anatomical CoordinatEs in Rats
  • TRAILMAP — Extract axonal data from cleared brains
  • cellfinder — Suite for cell detection, registration (using brainreg), analysis of cell positions
  • bg-atlasapi — Interface with anatomical atlasses
  • HERBS — Histological E-data Registration in rodent Brain Spaces
  • mouse_connectivity_models — voxel-scale connectivity models with anatomical tracing data
  • cellpose — Cell and nucleus segmentation
  • MorphometricAnalysis — Sholl Analysis and Morphometric Analysis for Neurons
  • neuron_morphology — Working with single-neuron morphological reconstruction data, such as those in Allen Cell Types Database
  • BarDensr — BARcode DEmixing through Non-negative Spatial Regression for spatial transcriptomic data

Extracellular Single Unit Electrophysiology

  • phy — Visualization and manual curation of large-scale electrophysiological data
  • YASS — Yet Another Spike Sorter
  • elephant — Analysis suite for spike train data and time series recordings
  • spikeinterface — Create flexible and robust spike sorting pipelines
  • spykes — Analysis and visualization suite for spike data
  • spiketools — Analysis suite for spike data
  • neuropyxels — Various utilities for Neuropixels data from SpikeGLX & outputs from KiloSort & Phy

Local Field Potentials

Patch Electrophysiology

  • stimfit — Various utilities for analysis of patch electrophysiological data

2P Ca2+ Imaging

  • suite2p — Ca2+ imaging analysis pipeline: Registration & Motion Correction, Cell detection, Signal Extraction, Spike deconvolution
  • CaImAn — Ca2+ imaging analysis pipeline: Registration & Motion Correction, Cell detection, Signal Extraction, Spike deconvolution
  • SIMA — Ca2+ imaging analysis pipeline: Registration & Motion Correction, Cell detection, Signal Extraction
  • Cascade — Calibrated spike inference from calcium imaging data
  • fissa — Fast Image Signal Separation Analysis, decontaminate somatic signals

Widefield Ca2+ Imaging

  • LocaNMF — Decompose widefield imaging data to obtain localized functional regions
  • MesoNet —Automated registration and segmentation of mesoscale mouse brain images

Fiber Photometry

  • GuPPy — Guided Photometry Analysis in Python
  • pyPhotometry — fiber photometry data acquisition (requires hardware)

Decoding / Machine Learning Applications

  • neural_decoding — Suite of regression and classification-based neural decoding tools
  • neuroglia — Machine learning library for neurophysiology data
  • replay_trajectory_classification — Decode spatial position represented by neural activity and categorizing the type of trajectory

Dimensionality Reduction / State Space Models

  • tensortools — Tensor Component Analysis (TCA; canonical polyadic (CP) tensor decompositions of higher-order data arrays)
  • neuralflow — Model neural activity with continuous latent Langevin dynamics.
  • LFADS — Latent Factor Analysis via Dynamical Systems to infer latent dynamics from single-trial neural spiking data
  • ssm — Suite for various state space models
  • drcme — dimensionality reduction and clustering of morphological and electrophysiological data

Behavior: Pose Estimation / Classification / Movement Analysis

  • DeepLabCut — 2D & 3D pose estimation & tracking (+ multi-animal)
  • sleap — Pose estimation & tracking (+ multi-animal)
  • anipose — multi-camera 3D tracking & pose estimation with DLC
  • DeepPoseKit — 2D Pose estimation
  • DeepGraphPose — Pose estimation
  • facemap — Unsupervised video analysis of rodent behavior (+ multiple camera views)
  • DeepEthogram —Supervised behavioral classification from raw pixels
  • SimBA — Pose estimation & behavior classification
  • B-SOiD — Behavior classification
  • VAME — Unsupervised behavior clustering
  • PyRat — Behavior analysis from DLC output

Behavior: Ultrasonic Vocalizations

  • AMVOC — Analyze mouse vocal communication through analyzing audio recordings from mouse communication signals (online & offline)
  • MSA2 — Offline detection of USVs

Other Physiological Signal Analysis Tools

  • deepinterpolation — deep learning-based denoising of various data types (calcium imaging, electrophysiology, fMRI)
  • stumpy — time series data mining (eg. pattern discovery, motifs, segmentation)
  • neurokit —Advanced biosignal processing routines for various types of signals (ECG, EOG, RRV, etc)
  • affinewarp — Piecewise Linear Time Warping
  • netneurotools — Tools for network neuroscience
  • d_code — Various ephys & imaging analysis routines especially for ScanImage and Ehpus data
  • pynapple — Various neurophysiological data analyses for time series, trial-based analyses + generic functions for neuroscience such as tuning curves and cross-correlograms.

Cognitive Neuroscience Analysis

  • pSignifit — Fitting of psychometric functions
  • pyddm — Generalized drift diffusion modeling

Experimental Design

  • psychopy — Create behavioral paradigms and psychophysical experiments
  • expyriment — Create behavioral paradigms and psychophysical experiments
  • pyControl — System of open source hardware & software for controlling behavioural experiments, built around the Micropython microcontroller.
  • autopilot — Facilitates hardware-intensive behavioral experiments with swarms of networked Raspberry Pis
  • DeepLabStream — Real-time tracking to orchestrate closed-loop experiments
  • pyPhotometry — fiber photometry data acquisition (requires hardware)

Simulation

  • brian2 — Simulator for spiking neural networks
  • nengo —Simulator for spiking neural networks
  • bindsnet —Simulator for spiking neural networks
  • sinaps — Simulate voltage and calcium dynamics/signal progation

--

--

Ning Leow

Neuroscience Post-Doc @ MIT Brain & Cognitive Sciences