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 can be computed for different synchrony sizes (>1), defining the number of simultaneous spikes to count.

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_sizes=(2, 4, 8))
# synchrony is a tuple of dicts with the synchrony metrics for each unit

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, synchrony_sizes=(2, 4, 8), unit_ids=None)

Compute synchrony metrics. Synchrony metrics represent the rate of occurrences of “synchrony_size” spikes at the exact same sample index.

Parameters
sorting_analyzer: SortingAnalyzer

A SortingAnalyzer object

synchrony_sizeslist or tuple, default: (2, 4, 8)

The synchrony sizes to compute.

unit_idslist or None, default: None

List of unit ids to compute the synchrony metrics. If None, all units are used.

Returns
sync_spike_{X}dict

The synchrony metric for synchrony size X. Returns are as many as synchrony_sizes.

References

Based on concepts described in [Gruen] This code was adapted from Elephant - Electrophysiology Analysis Toolkit

Literature

Based on concepts described in [Gruen]