Coder Social home page Coder Social logo

spikesort's Introduction

Spikesort (A MATLAB-based spike sorter for NEV files)

Maintained by the Smith Laboratory (www.smithlab.net). If you use Spikesort and find it useful (or if you have problems), please drop us an email ([email protected]).

Authors:

Ryan Kelly - wrote the original version of Spikesort in 2006 while he was a PhD student at CMU
Matthew Smith - worked with Ryan Kelly on the original version, and led development since 2011
Adam Snyder - extensive development of Spikesort from 2012-2018 while at Pitt/CMU as a postdoc
Shruti Vempati - contributed bug fixes and improvements in 2016-2017 while she was a BioE undergrad at Pitt
Xiaohan Zhong - cleaned up the code and added features in 2018 prior to the GitHub initial release

Publishing data using Spikesort:

If you use it in work you're going to publish, we would appreciate it if you would acknowledge us. You could put the software name and URL in your paper, or you could cite one or both of these references:

  • Kelly RC, Smith MA, Samonds JM, Kohn A, Bonds AB, Movshon JA & Lee TS (2007) Comparison of recordings from microelectrode arrays and single electrodes in the visual cortex. Journal of Neuroscience, 27: 261-264
  • Kelly RC (2010) Statistical Modeling of Spiking Activity in Large Scale Neuronal Networks, Ph.D. Thesis, Carnegie Mellon University

DISCLAIMER:

Spikesort is intended for sorting spike waveforms in NEV files (native format of Blackrock and Ripple hardware). This software modifies the NEV files and rewrites the sort codes for the channels. The authors of Spikesort take no responsibility for any errors in the software or in its use with your data. Remember that Spikesort modifies the NEV file, so you should have a backup before running this software. You should check that the sorting did what you thought it did with your NEV file. YOU ARE RESPONSIBLE FOR YOUR OWN DATA! That said, Spikesort continues to undergo development and has been used extensively. Bugs have existed in the software and will exist again, but it is relatively robust and mature.

Cloning:

This repository uses submodules. Be sure to use the following for cloning:

git clone https://github.com/SmithLabNeuro/spikesort.git --recursive

Alternatively, if cloned without the --recursive flag, once in the repository local copy, run the following to initialize the submodules:

git submodule update --init

Main File List:

genSpikeMapColor.c + mex-compiled files - take waveforms and produce an image shown in the GUI
genSpikeMapColorMatlab.m โ€“ [NOT USED] this is a slower Matlab-native code version of genSpikeMapColor.c
getSNR.m - calculate SNR (signal-to-noise ratio) - see Kelly et al 2007 (Journal of Neuroscience, 27: 261-264)
loadSort.m - load the saved sort file
manageTempFiles.m - manage temporary Spikesort files
readSampleWaveforms.m - load a subset of spikes for sorting
readWaveforms2.m - read the waveforms, times and units
readWaveforms2_timer.m - uses a timer function so that it can run in the background
readWaveforms2_timer_sparse.m - does a sparse (limited) read of waveforms for speed
rubberbandbox3.m - draw a rubber band box and return the start and end points (for selecting spikes)
rubberBandMotionFunction.m - window motion callback function
saveSort.m - save a sort to a specified location
spikesort_gui.m - define the operation callbacks
spikesort_nevscan.m - read the NEV file & get file information (called when a set of files are loaded)
spikesort_write2.m - called to write the sort codes to the NEV file
spikesort.m - spikesort main function

Utility File List:

Note: in some cases these are not standalone, and call other Spikesort functions
chanPlot.m - plot the spike waveforms for specified channel(s) with various plot options
justSNR.m - return channels list, sort codes, SNR values and spike counts (and average waveform)
moveToSortCode.m - write a list of sort codes into a NEV file
plx2nev.m - take a PLX file and convert it to NEV file with the same file name but a NEV extension
plxSortFromNEV.m - take a NEV-converted PLX file & write sort codes back into the PLX file
waves2nev.m - take waveforms, channels, sort codes, times and write them into a NEV file

Notes:

Mex Files: Spikesort uses a Mex-compiled C function (genSpikeMapColor.c) to speed up generating the waveform image for display. This function is currently compiled for several platforms. If you need to recompile, go to the Spikesort directory and type "mex genSpikeMapColor.c". Alternatively, there is a matlab- native version (genSpikeMapColorMatlab.m), but it is much slower.
NEV files: Spikesort works on NEV files, the native data format for Blackrock and Ripple hardware. If you have data from another recording setup, you can export your waveforms and convert them to a NEV using the waves2nev.m function supplied in the Spikesort directory. Also plx2nev.m converts Plexon PLX files to NEV.
Performance: Spikesort creates temporary sort files of in-progress sorts. When you first run Spikesort, it will ask you where to store these files (you can change the location in the GUI). It will create a "spikesortunits" folder that contains ch*.mat and hist*.mat files. These are the cached waveforms and the sorting history for each channel. It cleans up that directory and creates a tempsort_*.mat file on exit. The speed of Spikesort will be affected strongly by the disk access speed of the NEV file and also of this spikesortunits directory.

Usage:

For more details and a GUI tutorial, see this file.

spikesort's People

Contributors

deepaissar avatar jsoldadomagraner avatar mattslab avatar meganmcd13 avatar smithlabrig avatar yuumii-san avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

spikesort's Issues

Command P

Describe the bug
The hot key command P is used for two different things. One for Sparse load and another for opening and closing PCA. Seems like this no longer works for opening the PCA.

To Reproduce
Try kitting command P and see what happens.

Expected behavior
I don't think a hot key is needed at all for sparse load and should only be for opening and closing PCA.

[New feature] warning if nasnet is not correctly initialized

Is your feature request related to a problem? Please describe.
If spikesort is not cloned recursively, nasnet will not be available and will error.

Describe the solution you'd like
A warning should appear in the GUI if nasnet files are not accessible

Stuck on save temp sort gui

Describe the bug
When you close sort without saving a gui pops up saying wait for temp sort and when you click ok nothing happens, if you wait nothing happens, only clicking the red exit button closes the window. Matlab read out:

Error using matlab.graphics.axis.Axes/get
Invalid or deleted object.

Error in rubberbandbox3 (line 45)
p2=get(h,'Currentpoint'); %get end point

Error in spikesort_gui (line 343)
[point1, point2, status] = rubberbandbox3(Handles.plotHandle);

Error while evaluating DestroyedObject ButtonDownFcn.

To Reproduce
Close after opening a file and making some edits.

Expected behavior
Closes when you click ok, or say wait time or something.

[New feature] Peak Valley plot

Is your feature request related to a problem? Please describe.
One helpful feature for spike sorting is the peak-valley value. This allows for selection of all spikes with the same amplitude (likely coming from the same neuron).

Describe the solution you'd like
Similar to how the PCA plot allows for different components to be plotted, one "component" should be peak-valley.

[Bug] Sorting multiple files with PCA mode

Describe the bug
When sorting groups of files (>1) and using the PCA sorting option, if spikes are selected in the PCA view and assigned to sort codes there is variability in where they are actually assigned.

This bug does not affect sorting in the regular time-voltage rectangle mode, only sorting with PCA.

array map plots

chanPlot needs to be modified/updated

should be modified to use readNEV and create a grid of channels with all waveforms (plot using genSpikeMapC). Ideally will be flexible for different array sizes and multi-array inputs.

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.