# Herding Spikes 2 Lightning
Fast spike sorting for high density multielectrode arrays
[![PyPI version](https://badge.fury.io/py/herdingspikes.svg)](https://badge.fury.io/py/herdingspikes)
[![Build Status](https://travis-ci.org/mhhennig/HS2.svg?branch=master)](https://travis-ci.org/mhhennig/HS2)
![Spikes](documentation/pictures/spikes.png)
---
**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](https://github.com/SpikeInterface/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.
---
## Software for high density electrophysiology
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](http://journal.frontiersin.org/article/10.3389/fninf.2015.00028/abstract). 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.](http://www.cell.com/cell-reports/fulltext/S2211-1247(17)30236-X) 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.
### Supported systems <a name="systems"></a>
- any recording system supported by [SpikeInterface](https://github.com/SpikeInterface/spikeinterface)
- [3Brain](http://3brain.com/) 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](https://www.neuropixels.org/), 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)
## Installing Herdingspikes <a name="quickstart"></a>
The code has been tested with Python version 3.12. We suggest you use [Miniconda](https://docs.conda.io/en/latest/miniconda.html), [Anaconda](https://www.anaconda.com/download) or [Mamba](https://github.com/mamba-org/mamba) to set up a working Python system. We also recommend installing the code in a virtual environment, e.g.:
```bash
conda create -n hs python cython numpy
conda activate hs
```
A pip distribution is available and can be installed as follows:
```bash
pip install numpy cython # if not already installed
pip install herdingspikes
```
Windows and Mac users follow the instructions [here](documentation/windows_mac_install.md).
### From source
The module can automatically be installed, including all dependencies, by cloning this repository:
```bash
git clone https://github.com/mhhennig/HS2.git
```
Then run:
```bash
pip install numpy cython
pip install -e .
```
## Documentation <a name="documentation"></a>
A [quick start guide](documentation/quick_start.md) is available.
[This document](documentation/spikeinterface.md) explains how to use Herdingspikes with SpikeInterface.
Example code is in the folder [notebooks](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.
## Contributors, alphabetical <a name="people"></a>
- [Mariyana Cholakova](https://www.linkedin.com/in/mariyana-cholakova-a17496136/): Parameter optimisation
- [Matthias Hennig](http://homepages.inf.ed.ac.uk/mhennig/index.html): Spike sorting
- [Jano Horvath](https://github.com/JanoHorvath): Parameter optimisation
- [Cole Hurwitz](https://github.com/colehurwitz31): Spike detection, localisation and sorting, C++ code
- [Rickey K. Liang](https://lkct.github.io/): Optimised and fully refactored spike detection and localisation (Lightning)
- [Oliver Muthmann](mailto:ollimuh@googlemail.com): Original spike detection and localisation algorithm
- [Albert Puente Encinas](https://github.com/albertpuente): C++ implementation, optimisation and parallelisation
- [Martino Sorbaro](http://martinosorb.github.io): Spike sorting, class structure and much of the python code
- [Cesar Juarez Ramirez](mailto:cesaripn2@gmail.com): Visualisation
- [Raimon Wintzer](https://github.com/lsIand): GUI and visualisation
## Contact <a name="contact"></a>
The herders are based at the School of Informatics, University of Edinburgh. Contact us [here](http://homepages.inf.ed.ac.uk/mhennig/contact/), we are happy to help.
Raw data
{
"_id": null,
"home_page": "https://github.com/mhhennig/HS2",
"name": "herdingspikes",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "spikes sorting electrophysiology detection",
"author": "Matthias Hennig Lab, University of Edinburgh",
"author_email": "m.hennig@ed.ac.uk",
"download_url": "https://files.pythonhosted.org/packages/bc/dc/de745e119d29e1cf889888357cc2693549c7dda5fb49e6a072d19d238e8d/herdingspikes-0.4.5.tar.gz",
"platform": null,
"description": "# Herding Spikes 2 Lightning \n\nFast spike sorting for high density multielectrode arrays\n\n[![PyPI version](https://badge.fury.io/py/herdingspikes.svg)](https://badge.fury.io/py/herdingspikes)\n[![Build Status](https://travis-ci.org/mhhennig/HS2.svg?branch=master)](https://travis-ci.org/mhhennig/HS2)\n\n![Spikes](documentation/pictures/spikes.png)\n\n---\n**Update July 2024**\n\nThis is a new version 0.4, which introduces new, fast and performant spike detection code.\n\nThe final legacy version is 0.3.104, which introduced compatibility with [SpikeInterface](https://github.com/SpikeInterface/spikeinterface). SpikeInterface wraps many spike sorters, can read almost any file format and contains other useful functionality into a single code base.\n\nThis new version still supports the old detection code and can be used to transition to the new code.\n\n---\n\n## Software for high density electrophysiology\n\nThis 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:\n\nJ.-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](http://journal.frontiersin.org/article/10.3389/fninf.2015.00028/abstract). Front. Neuroinform. 9:28. doi: 10.3389/fninf.2015.00028.\n\nG. 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.](http://www.cell.com/cell-reports/fulltext/S2211-1247(17)30236-X) Cell Reports 18, 2521\u20132532. bioRxiv: <http://dx.doi.org/10.1101/048645>.\n\nThis 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.\n\nSince we believe publicly funded research code should be free and open, this code is released under GPL-3.0.\n\n### Supported systems <a name=\"systems\"></a>\n\n- any recording system supported by [SpikeInterface](https://github.com/SpikeInterface/spikeinterface)\n- [3Brain](http://3brain.com/) BIOCAM and BIOCAM X (custom implementation only in versions 0.3.XXX), for Lightning use SpikeInterface to read raw data\n- this software was developed specifically for high density multielectrode arrays, for example the [Neuropixels probe](https://www.neuropixels.org/), the SinAPS probes, or high-density MEAs such as the BioCam or the MaxWell Biosystems HD-MEA\n- 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)\n\n## Installing Herdingspikes <a name=\"quickstart\"></a>\n\nThe code has been tested with Python version 3.12. We suggest you use [Miniconda](https://docs.conda.io/en/latest/miniconda.html), [Anaconda](https://www.anaconda.com/download) or [Mamba](https://github.com/mamba-org/mamba) to set up a working Python system. We also recommend installing the code in a virtual environment, e.g.: \n\n```bash\n conda create -n hs python cython numpy\n conda activate hs\n```\n\nA pip distribution is available and can be installed as follows:\n\n```bash\n pip install numpy cython # if not already installed\n pip install herdingspikes\n```\n\nWindows and Mac users follow the instructions [here](documentation/windows_mac_install.md). \n\n### From source\n\nThe module can automatically be installed, including all dependencies, by cloning this repository:\n\n```bash\n git clone https://github.com/mhhennig/HS2.git\n```\n\nThen run:\n \n```bash\n pip install numpy cython\n pip install -e .\n```\n\n## Documentation <a name=\"documentation\"></a>\n\nA [quick start guide](documentation/quick_start.md) is available.\n\n[This document](documentation/spikeinterface.md) explains how to use Herdingspikes with SpikeInterface.\n\nExample code is in the folder [notebooks](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.\n\n## Contributors, alphabetical <a name=\"people\"></a>\n\n- [Mariyana Cholakova](https://www.linkedin.com/in/mariyana-cholakova-a17496136/): Parameter optimisation\n- [Matthias Hennig](http://homepages.inf.ed.ac.uk/mhennig/index.html): Spike sorting\n- [Jano Horvath](https://github.com/JanoHorvath): Parameter optimisation\n- [Cole Hurwitz](https://github.com/colehurwitz31): Spike detection, localisation and sorting, C++ code\n- [Rickey K. Liang](https://lkct.github.io/): Optimised and fully refactored spike detection and localisation (Lightning)\n- [Oliver Muthmann](mailto:ollimuh@googlemail.com): Original spike detection and localisation algorithm\n- [Albert Puente Encinas](https://github.com/albertpuente): C++ implementation, optimisation and parallelisation\n- [Martino Sorbaro](http://martinosorb.github.io): Spike sorting, class structure and much of the python code\n- [Cesar Juarez Ramirez](mailto:cesaripn2@gmail.com): Visualisation\n- [Raimon Wintzer](https://github.com/lsIand): GUI and visualisation\n\n## Contact <a name=\"contact\"></a>\n\nThe herders are based at the School of Informatics, University of Edinburgh. Contact us [here](http://homepages.inf.ed.ac.uk/mhennig/contact/), we are happy to help. \n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "Efficient spike detection and sorting for dense MEA",
"version": "0.4.5",
"project_urls": {
"Homepage": "https://github.com/mhhennig/HS2"
},
"split_keywords": [
"spikes",
"sorting",
"electrophysiology",
"detection"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bcdcde745e119d29e1cf889888357cc2693549c7dda5fb49e6a072d19d238e8d",
"md5": "c494a7a8111853c462184e0b547ea623",
"sha256": "71792dac3fe4d72f4b1a440168467613d068a5fd0d78079bfa5e0ed0dae18154"
},
"downloads": -1,
"filename": "herdingspikes-0.4.5.tar.gz",
"has_sig": false,
"md5_digest": "c494a7a8111853c462184e0b547ea623",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 289247,
"upload_time": "2024-09-10T09:13:06",
"upload_time_iso_8601": "2024-09-10T09:13:06.153984Z",
"url": "https://files.pythonhosted.org/packages/bc/dc/de745e119d29e1cf889888357cc2693549c7dda5fb49e6a072d19d238e8d/herdingspikes-0.4.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-10 09:13:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mhhennig",
"github_project": "HS2",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "herdingspikes"
}