-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1981 from alejoe91/additional-quality-metrics
Additional quality metrics
- Loading branch information
Showing
17 changed files
with
336 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Amplitude CV (:code:`amplitude_cv_median`, :code:`amplitude_cv_range`) | ||
====================================================================== | ||
|
||
|
||
Calculation | ||
----------- | ||
|
||
The amplitude CV (coefficient of variation) is a measure of the amplitude variability. | ||
It is computed as the ratio between the standard deviation and the amplitude mean. | ||
To obtain a better estimate of this measure, it is first computed separately for several temporal bins. | ||
Out of these values, the median and the range (percentile distance, by default between the | ||
5th and 95th percentiles) are computed. | ||
|
||
The computation requires either spike amplitudes (see :py:func:`~spikeinterface.postprocessing.compute_spike_amplitudes()`) | ||
or amplitude scalings (see :py:func:`~spikeinterface.postprocessing.compute_amplitude_scalings()`) to be pre-computed. | ||
|
||
|
||
Expectation and use | ||
------------------- | ||
|
||
The amplitude CV median is expected to be relatively low for well-isolated units, indicating a "stereotypical" spike shape. | ||
|
||
The amplitude CV range can be high in the presence of noise contamination, due to amplitude outliers like in | ||
the example below. | ||
|
||
.. image:: amplitudes.png | ||
:width: 600 | ||
|
||
|
||
Example code | ||
------------ | ||
|
||
.. code-block:: python | ||
import spikeinterface.qualitymetrics as sqm | ||
# Make recording, sorting and wvf_extractor object for your data. | ||
# It is required to run `compute_spike_amplitudes(wvf_extractor)` or | ||
# `compute_amplitude_scalings(wvf_extractor)` (if missing, values will be NaN) | ||
amplitude_cv_median, amplitude_cv_range = sqm.compute_amplitude_cv_metrics(wvf_extractor) | ||
# amplitude_cv_median and amplitude_cv_range are dicts containing the unit ids as keys, | ||
# and their amplitude_cv metrics as values. | ||
References | ||
---------- | ||
|
||
.. autofunction:: spikeinterface.qualitymetrics.misc_metrics.compute_amplitude_cv_metrics | ||
|
||
|
||
Literature | ||
---------- | ||
|
||
Designed by Simon Musall and adapted to SpikeInterface by Alessio Buccino. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Firing range (:code:`firing_range`) | ||
=================================== | ||
|
||
|
||
Calculation | ||
----------- | ||
|
||
The firing range indicates the dispersion of the firing rate of a unit across the recording. It is computed by | ||
taking the difference between the 95th percentile's firing rate and the 5th percentile's firing rate computed over short time bins (e.g. 10 s). | ||
|
||
|
||
|
||
Expectation and use | ||
------------------- | ||
|
||
Very high levels of firing ranges, outside of a physiological range, might indicate noise contamination. | ||
|
||
|
||
Example code | ||
------------ | ||
|
||
.. code-block:: python | ||
import spikeinterface.qualitymetrics as sqm | ||
# Make recording, sorting and wvf_extractor object for your data. | ||
firing_range = sqm.compute_firing_ranges(wvf_extractor) | ||
# firing_range is a dict containing the unit IDs as keys, | ||
# and their firing firing_range as values (in Hz). | ||
References | ||
---------- | ||
|
||
.. autofunction:: spikeinterface.qualitymetrics.misc_metrics.compute_firing_ranges | ||
|
||
|
||
Literature | ||
---------- | ||
|
||
Designed by Simon Musall and adapted to SpikeInterface by Alessio Buccino. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.