Skip to content

Latest commit

 

History

History
66 lines (43 loc) · 2.63 KB

File metadata and controls

66 lines (43 loc) · 2.63 KB

Drift metrics (drift_ptp, drift_std, drift_mad)

Calculation

Geometric positions and times of spikes within the cluster are estimated. Over the duration of the recording, the drift observed in positions of spikes is calculated in intervals, with respect to the overall median positions over the entire recording. These are referred to as "drift signals".

  • The drift_ptp is the peak-to-peak of the drift signal for each unit.
  • The drift_std is the standard deviation of the drift signal for each unit.
  • The drift_mad is the median absolute deviation of the drift signal for each unit.

The SpikeInterface implementation differes from the original Allen because it uses spike location estimates (using :py~spikeinterface.postprocessing.compute_spike_locations() - either center of mass or monopolar triangulation), instead of the center of mass of the first PC projection. In addition the Allen Institute implementation assumes linear and equally spaced arrangement of channels.

Finally, the original "cumulative_drift" and "max_drift" metrics have been refactored/modified for the following reasons:

  • "max_drift" is calculated with the peak-to-peak, so it's been renamed "drift_ptp"
  • "cumulative_drift" sums the absolute value of the drift signal for each interval. This makes it very sensitive to
    the number of bins (and hence the recording duration)! The "drift_std" and "drift_mad", instead, are measures of
    the dispersion of the drift signal and are insensitive to the recording duration.

Expectation and use

Drift metrics represents how much, in um, a unit has moved over the recording. Larger values indicate more "drifty" units, possibly of lower quality.

Example code

import spikeinterface.qualitymetrics as qm

# It is required to run `compute_spike_locations(wvf_extractor)`
# (if missing, values will be NaN)
drift_ptps, drift_stds, drift_mads = qm.compute_drift_metrics(wvf_extractor, peak_sign="neg")
# drift_ptps, drift_stds, and drift_mads are dict containing the units' ID as keys,
# and their metrics as values.

Reference

spikeinterface.qualitymetrics.misc_metrics.compute_drift_metrics

Literature

First introduced in [Siegle] and modified by the SpikeInterface Team.