Skip to main content

Efficient spike detection and sorting for dense MEA

Project description

Herding Spikes 2

Build Status Gitter chat

Spikes

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. 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 detection and localisation runs in real time on recordings from 4,096 channels at 7kHz on a desktop PC. Large recordings with millions of events can be sorted in minutes.

Since we believe publicly funded research code should be free and open, all code is released under GPL-3.0.

Supported systems

Contributors, alphabetical

Quick start

The code has been tested with Python version 3.6. It is essential numpy is available before installing. The other dependencies will be installed by the installer.

If your system does not have Python pre-installed, the Anaconda distribution may be used.

All operative systems - Installation via pip

We suggest you use Anaconda if you don't have a favourite Python installed yet. We also recommend installing the code in a virtual environment (see below in the "from source" sections).

A pip distribution is available and can be installed as follows:

pip install numpy scipy
pip install herdingspikes

Note: HerdingSpikes is tested on Python 3.5 and above. It may work on Python 3.0-3.4.

To install from source, clone this repository and follow the instructions below.

Linux/Mac - from source

We suggest you install the code in a virtual environment. You can create one by running

python3 -m venv --system-site-packages desired/location/HS2venv
source desired/location/HS2venv/bin/activate

You can omit --system-site-packages if you don't want to use the local versions of common Python libraries. You will need to activate whenever you're using the module.

The module can automatically be installed, including all dependencies, by running

pip install numpy scipy
python setup.py install

Windows - from source

1. Creating a Python virtual environment

Option 1: GUI

Once Anaconda is installed, create and activate a virtual environment called HS2env. This can be done with the Anaconda Navigator per mouse click. To make sure numpy and Cython are available, type

conda install -n C:\Users\HS2env numpy
Option 2: Command line (from source)

Alternatively, open the Anaconda Prompt and type:

conda search "^python$"

This will display a list of available python versions. Here we choose 3.6.5:

conda create -n C:\Users\HS2env python=3.6.5 anaconda

This environment should be activated every time HS2 is used with the command

conda activate C:\Users\HS2env

To make sure numpy is available, type

conda install -n C:\Users\HS2env numpy

2. Installing a C++ Compiler

HS2 contains fast C++ code, which requires a compiler. If you don't have a C++ compiler installed, the easiest solution is to download and install the Microsoft Visual Studio Build Tools: https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017.

3. Obtaining and installing HS2

Getting the code

Either download and uncompress: https://github.com/mhhennig/HS2/archive/master.zip

Or install git from https://git-scm.com/download/win. Then open a command prompt and type

git clone https://github.com/mhhennig/HS2.git

This will create a folder HS2 in the current directory. Note that updates can now be simply retrieved by typing git pull.

Install

To install, go to the HS2 directory, e.g.

cd HS2

and type

python setup.py install

Now HS2 will be available in the current virtual environment.

Example code

Example code for the different supported systems is in the folder notebooks. These can be run without installing HS2 system-wide, but 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. Each notebook will download a short segment of raw data.

Go here for documentation. A worked example for Biocam data is here.

Contact

The herders are based at the School of Informatics, University of Edinburgh. Contact us here, we are happy to help.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

herdingspikes-0.3.2.tar.gz (344.4 kB view details)

Uploaded Source

Built Distributions

herdingspikes-0.3.2-cp37-cp37m-macosx_10_7_x86_64.whl (482.3 kB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

herdingspikes-0.3.2-cp36-cp36m-macosx_10_7_x86_64.whl (484.0 kB view details)

Uploaded CPython 3.6m macOS 10.7+ x86-64

herdingspikes-0.3.2-cp35-cp35m-macosx_10_6_x86_64.whl (481.5 kB view details)

Uploaded CPython 3.5m macOS 10.6+ x86-64

File details

Details for the file herdingspikes-0.3.2.tar.gz.

File metadata

  • Download URL: herdingspikes-0.3.2.tar.gz
  • Upload date:
  • Size: 344.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for herdingspikes-0.3.2.tar.gz
Algorithm Hash digest
SHA256 edefae0cce3629275282d8404827d1d262389d9e90df31c3c33e083bcb11ec7d
MD5 1a8cbc3f5fcc2406c2eb65bd3ae2c292
BLAKE2b-256 94172b1732ef01d4c24b5ee22ef70e32b0fff00b61713f41e40dc145315cfd1b

See more details on using hashes here.

Provenance

File details

Details for the file herdingspikes-0.3.2-cp37-cp37m-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: herdingspikes-0.3.2-cp37-cp37m-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 482.3 kB
  • Tags: CPython 3.7m, macOS 10.7+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for herdingspikes-0.3.2-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 3c862a43d3471d97bd66225419ae2465ae4bb8b9e659531d4dfb2cea3785874c
MD5 0c9bb895f78b03b0f8ef9b41434c5fea
BLAKE2b-256 3835bab57e6ed2db16e11420748b468909b508ae1b22d3db0d6477889dbdf399

See more details on using hashes here.

Provenance

File details

Details for the file herdingspikes-0.3.2-cp36-cp36m-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: herdingspikes-0.3.2-cp36-cp36m-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 484.0 kB
  • Tags: CPython 3.6m, macOS 10.7+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for herdingspikes-0.3.2-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 264f8571eeb743ffff90a81f01b50e36ee3831d481877bdd4ef7e55d779e8fad
MD5 f8c548e25fe38018996fb3ff1abeb2dd
BLAKE2b-256 ff1af45f7b4e779ea7883b75a719721d6cd62f43826719efbba552c38ba9ae03

See more details on using hashes here.

Provenance

File details

Details for the file herdingspikes-0.3.2-cp35-cp35m-macosx_10_6_x86_64.whl.

File metadata

  • Download URL: herdingspikes-0.3.2-cp35-cp35m-macosx_10_6_x86_64.whl
  • Upload date:
  • Size: 481.5 kB
  • Tags: CPython 3.5m, macOS 10.6+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for herdingspikes-0.3.2-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 d6fc36081e54d2e37de2c786bfb1ca2fd31021ae35ba8cdab5c56cb05be035bc
MD5 c75b6a60fe011a37b939d5ea1c350c7d
BLAKE2b-256 0417fb9b268f6a2893a7a470dd623d263f6bcdd79bfec167f1298444b243cf0b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page