MouseLand / Kilosort

Fast spike sorting with drift correction for up to a thousand channels
https://kilosort.readthedocs.io/en/latest/
GNU General Public License v3.0
469 stars 245 forks source link

Preprocessing removes good spikes? #542

Closed jazlynntan closed 8 months ago

jazlynntan commented 1 year ago

Hi,

I was looking my the Neuropixel 1.0 raw data acquired via open ephys (continuous.dat) and the preprocessed output from Kilosort 3 (temp_wh.dat) and found that some good-looking spikes are actually lost. I tried different whiteningRange and trange parameter values but the filtered outcomes look indistinguishable.

Does anyone have experience with tuning the preprocessing parameters? For example, what parameters have the most effect or in what direction they should be tuned?

Thank you!

raw_traces_cc_zoom

processed_traces_th99_whiteningrange16_zoom_v2

ryanlash commented 1 year ago

Any luck figuring this out? We run a 2 shank 64 channel cambridge molex connector and seem to be running into a similar issue. We found does not occur from filtering but believe that the whitening step could be the issue

jazlynntan commented 1 year ago

We tried to tune some of the parameters such as threshold for negative crossings, whitening range and so on. However, I did not see noticeable differences. The spike detection and clustering still seemed to be working relatively well, so I hope this issue does not occur too often. I would be very interested to know how you resolved it if you manage to figure it out though

ryanlash commented 1 year ago

No nothing yet. We tried commenting out the actual whitening step but this didn't seem to work either and unsure as to the cause. We're essentially seeing a lack of spikes based on what we see from the raw data which doesn't match what we see on the raw trace in phy. Are you seeing a different signal in phy compared to your raw data or is it just spikes?

ryanlash commented 1 year ago

raw_vs_phy

ryanlash commented 1 year ago

The top is our raw data bottom is the signal as it appears in phy which is clearly different and missing at least one spike in the processed version. Is this what you're seeing as well?