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

Question about the detection threshold #2758

Open
Antho2422 opened this issue Apr 25, 2024 · 4 comments
Open

Question about the detection threshold #2758

Antho2422 opened this issue Apr 25, 2024 · 4 comments
Labels
question General question regarding SI

Comments

@Antho2422
Copy link
Contributor

Hi all,

I have a question concerning the detection threshold. I am trying to add an horizontal line to my plot of detected spikes on traces.

To get the y value of the line I do : threshold_value * noise_levels (that I got from the sorting analyzer extension) and this is the result I get :

image

This is a noise cluster so do not mind the quality of the detection. The issue here is that some of the detected events seems to be below the line of threshold and I do not know exactly why ?

I remember that Pierre told me someday that there was a 0.67 factor on the traces and I would like to know if I should take it into account or if this can be coming from something else ?

Thanks,
Anthony

@zm711
Copy link
Collaborator

zm711 commented Apr 25, 2024

@yger, seems like you discussed this. I haven't looked in the widgets for this so would you mind answering this one?

@zm711 zm711 added the question General question regarding SI label Apr 25, 2024
@yger
Copy link
Collaborator

yger commented Apr 25, 2024

If you are getting the noise levels from the sorting analyzer, then the internal multiplication by 0.67 (to get the MAD) is automatically handled, and you should just do detect_threshold * noise_levels to understand how the peaks were detected. The point I mentionned before was that, if you want to have a detection threshold at 6 MAD, then you should provide detect_threshold=4 because internally, SI will do (4/0.67) * MAD

@yger
Copy link
Collaborator

yger commented Apr 25, 2024

However, be careful because si.get_noise_levels() has a default mode with return_scaled=True. So if your data have a scaling, be cautious: detect_peaks internally deals with unscaled data. So do not detect noise levels yourself with return_scaled=True, and provide them to detect_peaks that way

@Antho2422
Copy link
Contributor Author

Thanks for the answer. I did not detect the peaks manually, this was the results of peaks detected using SC2. I just wanted to visually inspect what was detected on the raw traces using the appropriated plot function from SI and then plotting on top of that a line corresponding to the threshold + the noise level

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

No branches or pull requests

3 participants