spike sorting i: bijan pesaran new york university

45
Spike Sorting I: Bijan Pesaran New York University

Upload: janice-tyler

Post on 18-Dec-2015

255 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Spike Sorting I: Bijan Pesaran New York University

Spike Sorting I:

Bijan Pesaran

New York University

Page 2: Spike Sorting I: Bijan Pesaran New York University

Acknowledgements

• Ken Harris and Samar Mehta at Neuroinformatics course Woods Hole.

Page 3: Spike Sorting I: Bijan Pesaran New York University

Aims

We would like to …

• Monitor the activity of large numbers of neurons simultaneously

• Know which neuron fired when

• Know which neuron is of which type

• Estimate our errors

Page 4: Spike Sorting I: Bijan Pesaran New York University

Primate retinal ganglion cells, courtesy of the lab of Dr. E.J. Chichilnisky

THE PROBLEM: Multiple Neural Signals

-400

-200

0

200

3 msec

4.64 4.66 4.68 4.7 4.72 4.74 4.76

-400

-300

-200

-100

0

100

200

300

Time (sec)

Vol

tage

(A

/D L

evel

s)

0 1 2 3 4 5 6 7 8 9 10

-400

-200

0

200

Time (sec)

Vol

tage

(A

/D L

evel

s)

Page 5: Spike Sorting I: Bijan Pesaran New York University

THE GOAL: Spike Times of Single Neurons

Time (sec)

Spike Detector

4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5

Neuron #1 Spikes

Neuron #2 Spikes

-400

-200

0

200

Raw Data

Region from previous slide

Page 6: Spike Sorting I: Bijan Pesaran New York University

THE ‘GRADUATE STUDENT’ ALGORITHM

4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5

-400

-300

-200

-100

0

100

200

300

Time (sec)

Vol

tage

(A

/D L

evel

s)

Raw Data

Threshold detector at 32

0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6

-600

-500

-400

-300

-200

-100

0

100

200

300

Time (msec)

Vol

tage

(A

/D L

evel

s)

Candidate Waveforms

Spike Height vs. Width Plot

-700 -600 -500 -400 -300 -200 -1000

0.2

0.4

0.6

Wid

th (

mse

c)

Height (A/D Levels)

0 10 20 30 40 500

50

100

150

200

250

# of

Inte

rval

s

Time (msec)

Interspike Interval Histogram

1 2 3 40

50

100

150

200

Page 7: Spike Sorting I: Bijan Pesaran New York University

A GENERAL FRAMEWORK

Locate Spikes Preprocess Waveforms

Density Estimation

Spike Classification

Quality Measures

Page 8: Spike Sorting I: Bijan Pesaran New York University

Extracellular Recording Hardware

• You can buy two types of hardware, allowing

• Wide-band continuous recordings

• Filtered, spike-triggered recordings

Page 9: Spike Sorting I: Bijan Pesaran New York University

The Tetrode

• Four microwires twisted into a bundle

• Different neurons will have different amplitudes on the four wires

Page 10: Spike Sorting I: Bijan Pesaran New York University

Raw Data

Spikes

Page 11: Spike Sorting I: Bijan Pesaran New York University

High Pass Filtering

• Local field potential is primarily at low frequencies.

• Spikes are at higher frequencies.

• So use a high pass filter. 800hz cutoff is good.

Page 12: Spike Sorting I: Bijan Pesaran New York University

Filtered Data

Cell 1

Cell 2

Page 13: Spike Sorting I: Bijan Pesaran New York University

Spike Detection

• Locate spikes at times of maximum extracellular negativity

• Exact alignment is important: is it on peak of largest channel or summed channels?

Page 14: Spike Sorting I: Bijan Pesaran New York University

Data Reduction

• We now have a waveform for each spike, for each channel.

• Still too much information!

• Before assigning individual spikes to cells, we must reduce further.

Page 15: Spike Sorting I: Bijan Pesaran New York University

Principal Component Analysis

• Create “feature vector” for each spike.

• Typically takes first 3 PCs for each channel.

• Do you use canonical principal components, or new ones for each file?

Page 16: Spike Sorting I: Bijan Pesaran New York University

“Feature Space”

Page 17: Spike Sorting I: Bijan Pesaran New York University

Cluster Cutting

• Which spikes belong to which neuron?

• Assume a single cluster of spikes in feature space corresponds to a single cell

• Automatic or manual clustering?

Page 18: Spike Sorting I: Bijan Pesaran New York University

Cluster Cutting Methods

• Purely manual – time consuming, leads to high error rates.

• Purely automatic – untrustworthy.

• Hybrid – less time consuming, lowest error rates.

Page 19: Spike Sorting I: Bijan Pesaran New York University

Semi-automatic Clustering

Page 20: Spike Sorting I: Bijan Pesaran New York University

How Do You Know It Works?

• We can split waveforms into clusters, but are we sure they correspond to single cells?

• Simultaneous intra- and extra-cellular recordings allow us to estimate errors.

• Quality measures allow us to guess errors even without simultaneous intracellular recording.

Page 21: Spike Sorting I: Bijan Pesaran New York University

Intra-extra Recording• Simultaneous recording with a wire

tetrode and glass micropipette.

Page 22: Spike Sorting I: Bijan Pesaran New York University

Intra-extra Recording

Extracellular waveform is almost minus derivative of intracellular

Page 23: Spike Sorting I: Bijan Pesaran New York University

Bizarre Extracellular Waveshapes

Model Experiment

Page 24: Spike Sorting I: Bijan Pesaran New York University

Two Types of Error

• Type I error (false positive) – Incorrect inclusion of noise, or spikes of other

cells

• Type II error (false negative)– Omission of true spikes from cluster

• Which is worse? Depends on application…

Page 25: Spike Sorting I: Bijan Pesaran New York University

Manual Clustering Contest

Page 26: Spike Sorting I: Bijan Pesaran New York University

Best Ellipsoid Error Rates

Find ellipsoid that minimizes weighted sum of Type I and Type II errors.

Must evaluate using cross-validation!

Page 27: Spike Sorting I: Bijan Pesaran New York University

Humans vs. B.E.E.R.

Page 28: Spike Sorting I: Bijan Pesaran New York University

Waveshape Helps Separation

Page 29: Spike Sorting I: Bijan Pesaran New York University

Why were human errors higher?

• To understand this, try to understand why clusters have the shape they do

• Simplest possibility: spike waveform is constant, cluster spread comes from background noise

• Are clusters multivariate normal?

Page 30: Spike Sorting I: Bijan Pesaran New York University

Problem: Overlapping Spikes

Page 31: Spike Sorting I: Bijan Pesaran New York University

Problem: Cellular Synchrony

Page 32: Spike Sorting I: Bijan Pesaran New York University

Problem: Bursting

Page 33: Spike Sorting I: Bijan Pesaran New York University

Problem: Misalignment

• When you have a spike whose peak occurs at different times on different channels, it can align on either.

• This causes the cluster to be split in two.

Page 34: Spike Sorting I: Bijan Pesaran New York University

Problem: Dimensionality

Manual clustering only uses 2 dimensions at a time

BEER measure can use all of them

Page 35: Spike Sorting I: Bijan Pesaran New York University

“Semi-Automatic” Clustering

•Uses all dimensions at once

•Errors should be lower

•Still requires human input

Page 36: Spike Sorting I: Bijan Pesaran New York University

Semi-automatic Performance

Page 37: Spike Sorting I: Bijan Pesaran New York University

Software: KlustaKwik• Mixture of Gaussians, unconstrained

covariance matrices

• Speed is crucial

• CEM Algorithm – faster than EM

• Most probabilities not calculated

• Local maxima result in over- and under-clustering

• Split and merge features to tunnel out of local maxima

• Still requires supercomputer resources.

klustakwik.sourceforge.net

Page 38: Spike Sorting I: Bijan Pesaran New York University

Software: Klusters

Recluster Feature

Ergonomic Design

Auto/Cross correlograms

Grouping Assistant

Waveforms

Timecourse

klusters.sourceforge.net

Page 39: Spike Sorting I: Bijan Pesaran New York University

Cluster Quality Measures

• Would like to automatically detect which cells are well isolated.

• BEER measure needs intracellular data, which we don’t have in general.

• Will define two measures that only use extracellular data.

Page 40: Spike Sorting I: Bijan Pesaran New York University

Isolation Distance

Size of ellipsoid within which as many spikes belong to our cluster as not

Page 41: Spike Sorting I: Bijan Pesaran New York University

L_ratio

21ratio clusternoise

L cdf N

Page 42: Spike Sorting I: Bijan Pesaran New York University

False Positives and Negatives

Page 43: Spike Sorting I: Bijan Pesaran New York University

Which Measure to Use?

• Isolation distance correlates with false positive error rates– Measures distance to other clusters

• L_ratio correlates with false negative error rates– Measures number of spikes near cluster

boundary

Page 44: Spike Sorting I: Bijan Pesaran New York University

Conclusions

• Automatic clustering will save time and reduce errors.

• Errors can be as low as ~5%.

• Quality measures give you a feeling of how bad your errors are.

Page 45: Spike Sorting I: Bijan Pesaran New York University

Room for Improvement

• Make it faster

• Improved spike detection and alignment

• Quality measures that estimate % error

• Fully automatic sorting

• Resolve overlapping spikes

Easy

Hard