Intro to Neural Spike Analysis in Python
Analyze neural spiking data with Pandas, Seaborn, and Elephant, from spike sorting with SpikeInterface to advanced statistical inference methods.
Authors
This course provides a hands-on introduction to the analysis of neural spiking data based on multiple real-world examples as well as simulations. You’ll learn to leverage data science tools (Pandas, Seaborn) for analyzing spiking data from hundreds of neurons and creating informative visualizations with peri-stimulus time histograms and receptive field maps that compare responses of different units and brain areas. The course also explores simulating neurons as Poisson processes with the Elephant toolbox and applying these simulations to test and understand advanced algorithms (Unitary Event Analysis and SPADE) for statistical inference on spiking patterns in multi-unit recordings. Finally, you’ll learn to extract single-unit spiking activity from extracellular electrophysiological recordings using both Python’s core scientific stack (NumPy, SciPy, Scikit-learn) and the SpikeInterface library.
Credits
Installation
To run the course materials on your own machine, it is recommended that you:
- Install VSCode as your editor
- Install pixi or alternatively conda to create virtual Python environments (see the lessons on environment and package management)
- Create a dedicated folder for this course and install the virtual environment:
Download the pixi.toml file and install the environment:
pixi install --manifest-path pixi.toml
pixi shellDownload the environment.yml file and install the environment:
conda env create -f environment.yml
conda activate spike_analysisCourse Contents
Comparing and Visualizing Neural Spiking Across Different Brain Areas
Surveying Neural Spiking in Visual Cortex
Explore spike train data from visual cortex by creating rasterplots, comparing firing rates across brain areas, and performing statistical tests
Relating Neural Firing to Stimuli
Relate neural activity to stimuli through aligning spike times to stimulus presentations and identifying stimulus-responsive units
Modeling the Receptive Fields of Visual Neurons
Curve Fitting and Model Evaluation
Create parametric models and fit them to data, evaluate goodness-of-fit, and quantify parameter uncertainty
Estimating and Modeling Receptive Field Maps
Compute spatial receptive field maps from neural responses to visual stimuli and fit Gaussian models to characterize receptive field properties
Generative Simulations and Statistical Inference with Elephant
Simulating Neurons as Poisson Processes
Use non-stationary Poisson processes to simulate neural spike trains, analyze spike time variability with the coefficient of variation
Detecting Synchronicity with Unitary Event Analysis (UEA)
Detect statistically significant synchronous spiking events across multiple neurons with Unitary Event Analysis
Mining Statistical Patterns with SPADE
Use SPADE to discover recurring patterns of synchronous firing across large populations of neurons with statistical significance testing
Extracting Single-Unit Spiking Activity from Extracellular Recordings
Detecting Spikes in Continuous Recordings
Filter raw electrophysiological recordings, detect spikes using threshold crossing, and extract spike waveforms from multi-channel data
Feature Extraction and Waveform Clustering
Extract low-dimensional features from spike waveforms using PCA and cluster them into putative single units with Gaussian Mixture Models
Spike Sorting with SpikeInterface
Run automated spike sorting algorithms using the SpikeInterface framework
Postprocessing and Curation with SpikeInterface
Extract waveforms, compute quality metrics, curate sorting results, compare multiple sorters, and localize units on the probe