Giter VIP home page Giter VIP logo

pywaveclus's Introduction

Python port of WaveClus Matlab spike sorting package

This python package is (mostly) a port of WaveClus to python.

What is WaveClus

Original WaveClus package: http://vis.caltech.edu/~rodri/Wave_clus/Wave_clus_home.htm

reported in: R. Quian Quiroga, Z. Nadasdy and Y. Ben-Shaul. Neural Computation 16, 1661-1687; 2004.

An excellent description of spike sorting can be found here: http://www.scholarpedia.org/article/Spike_sorting

How does pywaveclus differ?

WaveClus used a elliptic type bandpass filter.

pywaveclus uses wavelet filtering based on code found here: http://www.berkelab.org/Software.html

reported in: A. B. Wiltschko, G. J. Gage and J. D. Berke. Journal of Neuroscience Methods 173:1, 34-40; 2008.

Installation

Requirements

see requirements.txt for most up to date information

  • numpy >= 1.5.1
  • scipy >= 0.8.0
  • pywavelets >= 0.2.0
  • scikits.audiolab >= 0.11.0 (only for reading wav files in pyc.py)
  • tables>=2.2.1 (only for saving hdf5 files in pyc.py)
  • nose >= 0.11 (only for testing)

The library version numbers may be more strict than necessary.

It may be necessary to install these requirements prior to installing as I don't know if setup.py correctly installs missing requirements.

Installing

python setup.py install

Testing

python setup.py test

or

import pywaveclus.tests

pywaveclus.tests.test.run()

Running

To cluster a single audio file run:

pyc.py <file>

pyc.py has lots of command line options (pyc.py -h) and will produce a hdf5 or mat file containing spike times, clusters, and waveforms.

The mat file contains index matched lists (times[0] corresponds to the same spike as waves[0] and clus[0], etc...):

  • times : times of the spikes (in samples/frames)
  • waves : waveforms of the spikes
  • clus : clusters to which the spikes belongs (cluster 0 is unmatched)

The hdf5 file contains a main table SpikeTable that contains a row for each spike and the following columns:

  • time : time of the spike (in samples/frames)
  • wave : waveform of the spike
  • clu : cluster to which the spike belongs (cluster 0 is unmatched)

Notes

Building scikits.audiolab on ubuntu:

  • sudo apt-get install libsndfile1-dev
  • git clone https://github.com/cournape/audiolab.git
  • cd audiolab
  • echo -e "[sndfile]ninclude_dirs = /usr/includenlibrary_dirs = /usr/lib32nsndfile_libs = sndfile" > site.cfg
  • pip install .

pywaveclus's People

Contributors

braingram avatar davidlmorton avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.