-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add synchrony metrics to quality metrics #1205
Closed
Moritz-Alexander-Kern
wants to merge
10
commits into
SpikeInterface:main
from
Moritz-Alexander-Kern:add_synchrony_metric
Closed
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
265048d
add synchrony metrics to qualitiymetrics module
a14a215
Update spikeinterface/qualitymetrics/misc_metrics.py
Moritz-Alexander-Kern 36ee4ba
Update spikeinterface/qualitymetrics/misc_metrics.py
Moritz-Alexander-Kern 73f1239
Merge branch 'master' into add_synchrony_metric
Moritz-Alexander-Kern 5ec8d44
add tests for synchrony metric
ac33ce4
Merge branch 'master' into add_synchrony_metric
3961be6
fix tests for synchrony metric
35618de
remove no longer needed functionality
41ee0ff
docstring
c9f74dc
Merge branch 'master' into add_synchrony_metric
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Synchrony Metrics (:code:`synchrony_metrics`) | ||
======================================= | ||
|
||
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 separated by spread - 1 or less empty bins, | ||
within and across spike trains in the spiketrains list. | ||
|
||
Expectation and use | ||
------------------- | ||
A larger value indicates a higher synchrony of the respective spike train with the other spike trains. | ||
|
||
Example code | ||
------------ | ||
|
||
.. code-block:: python | ||
|
||
import spikeinterface.qualitymetrics as qm | ||
# Make recording, sorting and wvf_extractor object for your data. | ||
presence_ratio = qm.compute_synchrony_metrics(wvf_extractor) | ||
# presence_ratio is a tuple of dicts with the synchrony metrics for each unit | ||
|
||
Links to source code | ||
-------------------- | ||
|
||
From `Elephant - Electrophysiology Analysis Toolkit <https://github.com/NeuralEnsemble/elephant/blob/master/elephant/spike_train_synchrony.py#L245>`_ | ||
|
||
|
||
References | ||
---------- | ||
|
||
.. automodule:: spikeinterface.toolkit.qualitymetrics.misc_metrics | ||
|
||
.. autofunction:: compute_synchrony_metrics | ||
|
||
Literature | ||
---------- | ||
|
||
Described in Gruen_ | ||
|
||
Citations | ||
--------- | ||
.. [Gruen] Sonja Grün, Moshe Abeles, and Markus Diesmann. Impact of higher-order correlations on coincidence distributions of massively parallel data. | ||
In International School on Neural Networks, Initiated by IIASS and EMFCSC, volume 5286, 96–114. Springer, 2007. |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be moved to the
full
extra, sinceelephant
is used by submodules.In addition, the function really only uses this function from elephant. I think it would be better to directly port this function (with proper references), so we don't have to rely on an additional dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback, I see your point.
Please allow me some time to look into this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course :) no rush!