Skip to content

Conversation

@chrishalcrow
Copy link
Member

@chrishalcrow chrishalcrow commented Oct 31, 2025

Add SLAy as a method for compute_merge_unit_groups https://www.biorxiv.org/content/10.1101/2025.06.20.660590v1

SLAy combines a template similarity measure, a cross-correlation significance measure and a sliding refractory period violation measure to make a merge decision. You need an analyzer with templates, correlograms and template_similarity. If you do, you can try it using:

import spikeinterface.full as si
merges = si.compute_merge_unit_groups(analyzer, preset="slay")

or, for more control, e.g.

merges = si.compute_merge_unit_groups(sa, preset="slay", steps_params ={'slay_score': {'k1': 0.7, 'slay_threshold': 0.8}})

This is an approximate implementation. Some details

  • For now, we use a simple template_similarity instead of the auto-encoder
  • We port the _sliding_RP_viol and _compute_xcorr functions from https://github.com/saikoukunt/SLAy . I think the sliding RP computation is fairly different between our implementation in quality_metrics. Will take a closer look...

To do:

  • unit tests
  • test against results in paper

With help and permission from @saikoukunt

@alejoe91 alejoe91 added the curation Related to curation module label Oct 31, 2025
return sig


def _sliding_RP_viol_pair(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably...

Comment on lines 1746 to 1750
bin_rate_max = np.max(smoothed_acg)
max_conts_max = np.array(bTest) / bin_size_ms * 1000 * (bin_rate_max * acceptThresh)
# compute confidence of less than acceptThresh contamination at each refractory period
confs = 1 - poisson.cdf(sum_res, max_conts_max)
rp_viol = 1 - confs.max()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@alejoe91 alejoe91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One very minor detail!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

curation Related to curation module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants