cortex-lab / phy

phy: interactive visualization and manual spike sorting of large-scale ephys data
BSD 3-Clause "New" or "Revised" License
311 stars 157 forks source link

spikes labelled twice #1131

Open antimo-buonocore opened 2 years ago

antimo-buonocore commented 2 years ago

Hi everyone,

I think I have an issue with spike sorting using kilosort. It seems that in some cases the same spike is present in two different clusters (same channel). In the first figure, you can see cluster ID 180 on channel 16 and the blue spike highlighted in the TraceView. In the second figure, the same spike is highlighted in cluster ID 181, again on channel 16. If I select both clusters (figure 3), the spikes perfectly overlap (but one of the two seems to contain an extra portion of signal on the left side, here in blue).

If I merge the two clusters, the spike is counted twice.

I also noticed that cluster ID 180 is associated to some activity in channel 15, that is also highlighted in blue in the Trace View. This is not present in cluster ID 181

Do you have any idea why this is happening?

Thanks!

Antimo

Figure 1 FIG1

Figure 2 FIG2

Figure 3 FIG3

zm711 commented 1 year ago

@antimo-buonocore

Kilosort is not perfect for generating spike information so Phy gives you the chance to manually merge clusters that Kilosort split. I'm including the link to the Phy read the docs which explains good criteria for merging/splitting kilosort output data in Phy.

https://phy.readthedocs.io/en/latest/