Fast spike sorting for high density multielectrode arrays
Update July 2024
This is a new version 0.4, which introduces new, fast and performant spike detection code.
The final legacy version is 0.3.104, which introduced compatibility with SpikeInterface. SpikeInterface wraps many spike sorters, can read almost any file format and contains other useful functionality into a single code base.
This new version still supports the old detection code and can be used to transition to the new code.
This software provides functionality for the detection, localisation and clustering of spike data from dense multielectrode arrays based on the methods described in the following papers:
J.-O. Muthmann, H. Amin, E. Sernagor, A. Maccione, D. Panas, L. Berdondini, U.S. Bhalla, M.H. Hennig MH (2015). Spike detection for large neural populations using high density multielectrode arrays. Front. Neuroinform. 9:28. doi: 10.3389/fninf.2015.00028.
G. Hilgen, M. Sorbaro, S. Pirmoradian, J.-O. Muthmann, I. Kepiro, S. Ullo, C. Juarez Ramirez, A. Puente Encinas, A. Maccione, L. Berdondini, V. Murino, D. Sona, F. Cella Zanacchi, E. Sernagor, M.H. Hennig (2016). Unsupervised spike sorting for large scale, high density multielectrode arrays. Cell Reports 18, 2521–2532. bioRxiv: http://dx.doi.org/10.1101/048645.
This implementation is highly efficient, spike sorting runs in real time on recordings from 4,096 channels or more at 20+kHz on a desktop PC. Large recordings with millions of events can be sorted in minutes. No GPU is required, and the code is fully parallelised.
Since we believe publicly funded research code should be free and open, this code is released under GPL-3.0.
- any recording system supported by SpikeInterface
- 3Brain BIOCAM and BIOCAM X (custom implementation only in versions 0.3.XXX), for Lightning use SpikeInterface to read raw data
- this software was developed specifically for high density multielectrode arrays, for example the Neuropixels probe, the SinAPS probes, or high-density MEAs such as the BioCam or the MaxWell Biosystems HD-MEA
- what herding spikes is not: performance is poor for recording systems with few recording channels and channels separated by more than 60 microns; for such recordings, use one of the many other sorters available in SpikeInterface](https://github.com/SpikeInterface/spikeinterface)
The code has been tested with Python version 3.12. We suggest you use Miniconda, Anaconda or Mamba to set up a working Python system. We also recommend installing the code in a virtual environment, e.g.:
conda create -n hs python cython numpy
conda activate hs
A pip distribution is available and can be installed as follows:
pip install numpy cython # if not already installed
pip install herdingspikes
Windows and Mac users follow the instructions here.
The module can automatically be installed, including all dependencies, by cloning this repository:
git clone https://github.com/mhhennig/HS2.git
Then run:
pip install numpy cython
pip install -e .
A quick start guide is available.
This document explains how to use Herdingspikes with SpikeInterface.
Example code is in the folder notebooks. These can be run without installing HS2 system-wide and requires to run python setup.py build_ext --inplace
in the HS2
directory. Next, run jupyter notebook
and navigate to the directory to try the code.
- Mariyana Cholakova: Parameter optimisation
- Matthias Hennig: Spike sorting
- Jano Horvath: Parameter optimisation
- Cole Hurwitz: Spike detection, localisation and sorting, C++ code
- Rickey K. Liang: Optimised and fully refactored spike detection and localisation (Lightning)
- Oliver Muthmann: Original spike detection and localisation algorithm
- Albert Puente Encinas: C++ implementation, optimisation and parallelisation
- Martino Sorbaro: Spike sorting, class structure and much of the python code
- Cesar Juarez Ramirez: Visualisation
- Raimon Wintzer: GUI and visualisation
The herders are based at the School of Informatics, University of Edinburgh. Contact us here, we are happy to help.