Sliding refractory period violations (:code:`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 :ref:`ISI violations ` 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. Example code ------------ With SpikeInterface: .. code-block:: python import spikeinterface.qualitymetrics as sqm # Combine sorting and recording into a sorting_analyzer contamination = sqm.compute_sliding_rp_violations(sorting_analyzer=sorting_analyzer, bin_size_ms=0.25) References ---------- .. autofunction:: spikeinterface.qualitymetrics.misc_metrics.compute_sliding_rp_violations Links to original implementations --------------------------------- * From `IBL `_ * From `Steinmetz Lab `_ Literature ---------- Metric introduced by [IBL]_.