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.
Similar to the :ref:`ISI violations <ISI>` metric, this metric quantifies the number of refractory period violations seen in the recording of the unit. This is an estimate of the false positive rate. A high number of violations indicates contamination, so a low value is expected for high quality units.
With SpikeInterface:
import spikeinterface.qualitymetrics as sqm
# Make recording, sorting and wvf_extractor object for your data.
contamination = sqm.compute_sliding_rp_violations(waveform_extractor=wvf_extractor, bin_size_ms=0.25)
.. autofunction:: spikeinterface.qualitymetrics.misc_metrics.compute_sliding_rp_violations
- From IBL
- From Steinmetz Lab
Metric introduced by [IBL].