LorenFrankLab / spyglass

Neuroscience data analysis framework for reproducible research built by Loren Frank Lab at UCSF
https://lorenfranklab.github.io/spyglass/
MIT License
94 stars 43 forks source link

Suspicious snr #287

Closed emilymonroe95 closed 11 months ago

emilymonroe95 commented 2 years ago

Describe the bug Firstly, our lab based snr values are significantly different than the ones (SNR) from sortingview (I think thats where they come from). Secondly, across sorts, there are often multiple units in a row who have almost the exact same SNR, which should be impossible. We should investigate how our SNR is calculated.

To Reproduce See screenshots. Units 5,6,7 have the same lab-based SNR (last column). Also, can see the difference between lab-based SNR and the sorting view based SNR in the second to last column. In the second screenshot, 53 and 58 have the same lab-based snr- so they are not always consecutive units.

Screen Shot 2022-07-08 at 11 21 16 AM Screen Shot 2022-07-08 at 11 26 28 AM

Expected behavior I'm not exactly sure how the lab based SNR is calculated, but each should be unique, and at least relatively close to the ones given from sorting view.

khl02007 commented 11 months ago

SNR is computed by taking the absolute value of waveform amplitude at the max channel (channel with highest amplitude) and dividing it by the estimate of noise. Since the noise estimate is likely the same across all units, this would happen if the amplitude estimate is also the same. This can happen if the 'unit' is non-neural in origin (artifact related to behavior). It might explain why these units are labeled as noise/reject in the screenshot. Indeed suspicious, but seems like safe to close this for now.