Synchrony Metrics (synchrony
)
Calculation
This function is providing a metric for the presence of synchronous spiking events across multiple spike trains.
The complexity is used to characterize synchronous events within the same spike train and across different spike trains. This way synchronous events can be found both in multi-unit and single-unit spike trains. Complexity is calculated by counting the number of spikes (i.e. non-empty bins) that occur at the same sample index, within and across spike trains.
Synchrony metrics are computed for 2, 4 and 8 synchronous spikes.
Expectation and use
A larger value indicates a higher synchrony of the respective spike train with the other spike trains. Larger values, especially for larger sizes, indicate a higher probability of noisy spikes in spike trains.
Example code
import spikeinterface.qualitymetrics as sqm
# Combine a sorting and recording into a sorting_analyzer
synchrony = sqm.compute_synchrony_metrics(sorting_analyzer=sorting_analyzer)
# synchrony is a tuple of dicts with the synchrony metrics for each unit
Links to original implementations
The SpikeInterface implementation is a partial port of the low-level complexity functions from Elephant - Electrophysiology Analysis Toolkit
References
Various cluster quality metrics.
Some of then come from or the old implementation: * https://github.com/AllenInstitute/ecephys_spike_sorting/tree/master/ecephys_spike_sorting/modules/quality_metrics * https://github.com/SpikeInterface/spikemetrics
Implementations here have been refactored to support the multi-segment API of spikeinterface.
- spikeinterface.qualitymetrics.misc_metrics.compute_synchrony_metrics(sorting_analyzer, unit_ids=None, synchrony_sizes=None)
Compute synchrony metrics. Synchrony metrics represent the rate of occurrences of spikes at the exact same sample index, with synchrony sizes 2, 4 and 8.
- Parameters:
- sorting_analyzerSortingAnalyzer
A SortingAnalyzer object.
- unit_idslist or None, default: None
List of unit ids to compute the synchrony metrics. If None, all units are used.
- synchrony_sizes: None, default: None
Deprecated argument. Please use private _get_synchrony_counts if you need finer control over number of synchronous spikes.
- Returns:
- sync_spike_{X}dict
The synchrony metric for synchrony size X.
References
Based on concepts described in [Grün] This code was adapted from Elephant - Electrophysiology Analysis Toolkit
Literature
Based on concepts described in [Grün]