Skip to content
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

Clarification on units for parameters: threshold, min_avg_amp, and AHP_thr. #83

Open
litzj01 opened this issue Sep 10, 2024 · 2 comments

Comments

@litzj01
Copy link

litzj01 commented Sep 10, 2024

Hello,
I am wondering if you could clarify what the units are for the parameters: threshold, min_avg_amp, and AHP_thr.
We are hoping to modify our parameters for our sorts as we are running into the issue that HS2 4 is detecting way more spikes and units compared to HS2 3.104 (and far more than what is reasonably expected for our recordings).

@b-grimaud
Copy link
Contributor

I'm pretty sure threshold is a multiple of the standard deviation of the signal.

For the other two there are some clarifications in #80, but from my experience a lot of it comes down from trying out parameters and iterating until you find something that visually matches what you expect of a spike and produces good clusters.

@mhhennig
Copy link
Owner

Thanks @b-grimaud , I basically agree :)

threshold is indeed an amplitude threshold, but it compares the current amplitude against a baseline and noise estimate that are both approximated as percentiles (baseline is the 33 signal percentage). This is described here:
https://www.frontiersin.org/articles/10.3389/fninf.2015.00028/full

min_avg_amp is a threshold for the sum of the signal from threshold crossing to peak - essentially it rejects threshold crossings too short to be real spikes. Note this will depend on signal filtering. On BioCam data we used to apply no filtering, but this HS version has a built-in lowpass filter (can be turned off for a small speed gain). This will affect this sum and so give inconsistent results.

AHP_thr is a threshold for a rebound after a detected peak, it rejects events that don't show a repolarisation. It's compared again against the basline estimate. As @lkct discovered, this was actually not working in the previous implementation, but now it will help reject noise events.

Hope this makes sense. I suggest to analyse a small data segment, start with a high threshold and then see where you start detecting noise. Visualisation is useful, happy to help with tha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants