Skip to content

Question on computing spike location across kilosort versions #818

@JoeZiminski

Description

@JoeZiminski

Hi Kilosort team, hope you are doing well. I am currently working to load kilosort spike outputs into SpikeInterface format, work in progress here. This includes computing the spike locations. I have a couple of questions to check my understanding and confirm the best way to approach this across kilosort versions, any help would be much appreciated.

Initially I based the approach on the spikes method, which calculates the center-of-mass using pc_features. Now I realise this is most relevant for KS1. To check my understanding: this is the 'private PCA' in which for each spike, PCA is performed directly on the spike waveform ($t \ \text{x} \ c$ matrix) is giving scores for projection onto $c$ principal components. The scores for the top 3 components are retained.

In all other kilosort versions, a template matching approach is used. Now template_features gives the projection of the spike waveform onto the most similar template (out of 6 possible in KS4). These are not from a PCA but computed as the magnitude of the projection of the spike onto the templates during the template matching step. template_features is (num spikes, num features) where features is a set of n channels (I think 32 in KS2/2.5, 10 in KS4). This array holds the magnitudes for each channel, when the waveform is projected onto the closet-matching template). For these versions, I guess it it makes more sense to use the centre of mass over the template_features, rather than pc_features?

A main reason I am clarifying is because for some spikes, all scores onto the first principal component are negative. If I understand correctly, depending on the method, the interpretation of this case changes. In the 'private PCA' context, this sign is arbitrary and the sign of the scores can be reversed for these spikes. However, in the template_features content, this means the waveform is in the opposite direction to the template, and should probably be excluded.

It would be great to check that I have understood the above correctly and can handle the estimation of spike location accordingly. Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions