Skip to main content

Build Status PyPI version

SpikeMetrics

Computes quality metrics for sorted units. This module can calculate metrics separately for individual epochs. If no epochs are specified, metrics are computed for the entire recording.

The base code (and portions of the README images/description) was ported from: https://github.com/AllenInstitute/ecephys_spike_sorting/tree/master/ecephys_spike_sorting/modules/quality_metrics

Copyright 2019. Allen Institute. All rights reserved.

Included Metrics

Metric Icon Description Reference
Spike Count Spike count in an epoch
Firing rate Mean spike rate in an epoch
Presence ratio Fraction of epoch in which spikes are present
Amplitude cutoff Estimate of miss rate based on amplitude histogram
ISI violations Rate of refractory-period violations
Isolation distance The Mahalanobis distance from a specified unit within as many spikes belong to the specified unit as to other units Harris et al. Neuron 32.1 (2001): 141-149.
L-ratio The Mahalanobis distance and chi-squared inverse cdf (given the assumption that the spikes in the cluster distribute normally in each dimension) are used to find the probability of cluster membership for each spike. Schmitzer-Torbert and Redish. J Neurophy 91.5 (2004): 2259-2272.
d' The classification accuracy between units based on linear discriminant analysis (LDA). Hill et al. (2011) J Neurosci 31, 8699-9705
Nearest-neighbors Non-parametric estimate of unit contamination using nearest-neighbor classification. Chung et al. (2017) Neuron 95, 1381-1394
Silhouette score A standard metric for quantifying cluster overlap
Maximum drift Maximum change in spike position throughout recording
Cumulative drift Cumulative change in spike position throughout recording

A Note on Calculations

For metrics based on waveform principal components (isolation distance, L-ratio, d', and nearest neighbors hit rate and false alarm rate), it is typical to compute the metrics for all pairs of units and report the "worst-case" value. We have found that this tends to under- or over-estimate the degree of contamination when there are large firing rate differences between pairs of units that are being compared. Instead, we compute metrics by sub-selecting spikes from all other units on the same set of channels, which seems to give a more accurate picture of isolation quality. We would appreciate feedback on whether this approach makes sense.

Metadata

Release files for spikemetrics 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spikemetrics 0.2.4
File Size Uploaded
spikemetrics-0.2.4.tar.gz 18.1 kB Details

Release files / spikemetrics-0.2.4.tar.gz

Download URL spikemetrics-0.2.4.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ffe8798d5ade6ca942b98917d0f5e4b5247508c1d5e023ba348221646ea5d380
BLAKE2b-256 checksum
How to use checksums
a239a1831bfa6a5ff959f23399687ea953f41bf800fbdab18083d252c67299db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.7

Release history Release notifications | RSS feed

This release

0.2.4 This release

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

2 release files

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page