Sliding refractory period violations (sliding_rp_violations)

Calculation

Compute maximum allowed refractory period violations for all possible refractory periods in recording. Bins of 0.25ms are used in the [IBL] implementation. For each bin, this maximum value is compared with that observed in the recording.

In the [IBL] implementation, a threshold is imposed and a binary value returned (based on whether the unit ‘passes’ the metric). The SpikeInterface implementation, instead, returns the minimum contamination with at least 90% confidence. This contamination value is between 0 and 1.

Expectation and use

Similar to the ISI violations metric, this metric quantifies the number of refractory period violations seen in the recording of the unit. This is an estimate of false positive rate. A high number of violations indicates contamination, so a low value is expected for true units.

Example code

With SpikeInterface:

import spikeinterface.qualitymetrics as qm

# Make recording, sorting and wvf_extractor object for your data.

contamination = qm.compute_sliding_rp_violations(wvf_extractor, bin_size_ms=0.25)

References

spikeinterface.qualitymetrics.misc_metrics.compute_sliding_rp_violations(waveform_extractor, bin_size_ms=0.25, window_size_s=1, exclude_ref_period_below_ms=0.5, max_ref_period_ms=10, contamination_values=None)

Compute sliding refractory period violations, a metric developed by IBL which computes contamination by using a sliding refractory period. This metric computes the minimum contamination with at least 90% confidence.

Parameters
waveform_extractorWaveformExtractor

The waveform extractor object.

bin_size_msfloat

The size of binning for the autocorrelogram in ms, by default 0.25

window_size_sfloat

Window in seconds to compute correlogram, by default 1

exclude_ref_period_below_msfloat

Refractory periods below this value are excluded, by default 0.5

max_ref_period_msfloat

Maximum refractory period to test in ms, by default 10 ms

contamination_values1d array or None

The contamination values to test, by default np.arange(0.5, 35, 0.5) %

Returns
contaminationdict of floats

The minimum contamination at 90% confidence

References

Based on metrics described in [IBL] This code was adapted from https://github.com/SteinmetzLab/slidingRefractory/blob/1.0.0/python/slidingRP/metrics.py

Literature

Metric introduced by [IBL].