Kilosort icon indicating copy to clipboard operation
Kilosort copied to clipboard

Templates vs. Waveforms, Waveform properties

Open Gittinator opened this issue 4 years ago • 2 comments

I'm using Kilosort (I've tried 2 and 2.5) to sort units from 16 channel MEA recordings with 150um pitch between contacts.

My first question is whether I'm doing this correctly. In particular, I'm converting floating point voltage values to arbitrarily scaled, int16 data and I built a probe file around my probe's spacing, with separate kcoords for each contact (since they are pretty far). Some, but not all, of my data has significant motion noise, which I'm hoping will be accounted for well in the initial processing steps.

I'm interested in analyzing waveform properties, but I'm not sure how to extract the waveforms, or exactly what to use. The mean waveforms look very different from the templates, and also have vastly higher scaling. Also, if I extract the mean waveforms using phylib in Python, they look different (in some cases) from manually extracting the data at that timepoint (normalized according the median, as I think phy does).

I'm also seeing that a lot of the clusters have non-flat, neuron looking templates/average waveforms at channels that are 300+ um apart. While it does like there are two neurons often firing at the same time, I would think these should really be split pretty easily into different clusters based on the probe file.

Gittinator avatar Nov 04 '20 17:11 Gittinator

Sorry, that pitch is too large for drift correction to work. In this case, KS 2.0 should work better, since it doesn't have a geometry model. However, if you really have bad drift, it's possible that many of your neurons are disappearing in-between sites.

The kcoords variable has not been implemented in either 2.0 or 2.5. It is possible, though not likely that some very high-firing neurons results in templates detecting coincidences, and the template from Kilosort are always after high-pass filtering and channel whitening (which also introduces a different scaling), and that's why they look different from the raw data. The average waveforms from Phy should look a lot more similar, though in that case there is probably a subsampling of all the spikes to compute avg waveforms.

marius10p avatar Nov 20 '20 22:11 marius10p

Hi @marius10p, what is the kcoords variable currently used for in Kilosort 2.0, 2.5, and 3.0? Thank you.

kabilar avatar Jun 01 '22 15:06 kabilar