Clusters with high similarity displayed offset in time
Closed this issue · 2 comments
Sometimes I get clusters which have a high similarity score (eg. 0.9) but the waveforms seem shifted in time in the waveform view as the waveforms are not peak aligned in the display in phy. Now I am unsure whether I should still merge these clusters based on the waveform similarity/amplitude/pc features or whether the offset in time is actually indicative of being a different unit. The data has been sorted in KiloSort and it might be cause in the sorting step or simply be a display issue in phy.
Based on the ACG/PC features for such clusters, I think that they actually arise from same unit but it seems that the display in phy does not align spikes based on the peak amplitude but some earlier bin.
Does anyone know how the waveforms are put in relation to each other in phy?
How could one peak align the spikes of clusters in relation to each other?
Hi Sarruedi,
This is actually an issue that I'm running into, as well. For us, it's important to have the same units aligned by their peaks because our research focuses on spike timing and temporal misalignment can have an impact on our analyses.
One of the parameters that I have played with is weight_power. This is the exponent of the power in the "center of mass" calculation that is explained in the SpikeDetekt section of the Online Methods in Rossant 2016. I have varied the parameter from 2 -- the recommended value in their publication -- to 1000 as they say that "p=inf ... measures the time of the spike peak." To be honest, I have not noticed much of a difference in the alignment of sorting. In the latter case, I've noticed that the waveforms within a Klusta cluster appear to be better aligned, but there are still Klusta clusters of the same unit (determined by visual comparison) with different temporal alignments as you've described above.
At this point, I've circumvented the issue by using the Klusta Suite to do a preliminary sorting of spikes. Once I have Klusta clusters that match, I visually match temporally misaligned groups and run them through my own custom script to realign them to their peaks.
I am currently working on a spike sorting workflow as follows:
- SpikeDetekt to identify candidate spike events
- Custom script interfaced to the Klusta Suite to align detected events to their peaks
- KlustaKwik to automatically propose groups
- Manual curation as described in Rossant 2016
closing this for now, as our focus is now on Kilosort and spyking circus and co rather than klusta/spikedetekt/klustakwik