Draft
Add automatic post-sorting unit merge (Phase 3b) via SpikeInterface curation#149
Conversation
Co-authored-by: mandarmp <33731455+mandarmp@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add automatic merging of units after spike sorting
Add automatic post-sorting unit merge (Phase 3b) via SpikeInterface curation
Mar 12, 2026
Collaborator
Collaborator
Collaborator
|
@adamwea can we have your PR then we can add that functionality here to the MAIN BRANCH |
4185207 to
574a594
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Kilosort4 frequently oversplits single neurons into multiple clusters. This adds a dedicated auto-merge phase between the analyzer and report generation that detects and corrects those splits using SpikeInterface's
auto_merge_units.Pipeline change
New Phase 3b inserted between
run_analyzer()andgenerate_reports():run_auto_merge()callssic.auto_merge_units()with the"similarity_correlograms"preset, which gates merges through six sequential criteria:Merged units are saved to
analyzer_merged/and loaded on resume. If no merge candidates are found, or if the step throws, the original analyzer is used unchanged.New controls
--no-auto-mergecuration.no_auto_mergeAvailable on both
mea_analysis_routine.pyandrun_pipeline_driver.py; propagated throughbuild_extra_args.Docs
README.mdupdated with: pipeline stages table, key features list, output directory layout (analyzer_merged/), config section reference, CLI reference table, workflow example, and a new Automatic Unit Merging section covering the algorithm and disable instructions.💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.