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

A lot of clusters labeled with mua #472

Closed u963593d closed 8 months ago

u963593d commented 2 years ago

Thank you for your support always.

I have seen my results in the phy and found that there are a lot of clusters labeled with mua (attached file). Autorrelograms of clusters labeled with mua don't have a dip in the lag of 0ms. I also found that the more the number of spikes is, the more it is likely to be classified to mua. How could I reduce clusters labeled with mua?

I analyzed the data recorded for 30 min in 420 electrodes (electrode interval: 35um) parameters are as below.

% sample rate ops.fs = 10000;

% frequency for high pass filtering (150) ops.fshigh = 300;

% threshold on projections (like in Kilosort1, can be different for last pass like [10 4]) ops.Th = [10 4];

% how important is the amplitude penalty (like in Kilosort1, 0 means not used, 10 is average, 50 is a lot) ops.lam = 20;

% splitting a cluster at the end requires at least this much isolation for each sub-cluster (max = 1) ops.AUCsplit = 0.8;

% minimum spike rate (Hz), if a cluster falls below this for too long it gets removed ops.minFR = 0;

% spatial constant in um for computing residual variance of spike ops.sigmaMask = 100;

% threshold crossings for pre-clustering (in PCA projection space) ops.ThPre = 9;

% spatial scale for datashift kernel ops.sig = 20;

% type of data shifting (0 = none, 1 = rigid, 2 = nonrigid) ops.nblocks = 0;

%% danger, changing these settings can lead to fatal errors % options for determining PCs ops.spkTh = -6; % spike threshold in standard deviations (-6) ops.reorder = 1; % whether to reorder batches for drift correction. ops.nskip = 25; % how many batches to skip for determining spike PCs

ops.GPU = 1; % has to be 1, no CPU version yet, sorry % ops.Nfilt = 1024; % max number of clusters ops.nfilt_factor = 5; % max number of clusters per good channel (even temporary ones) ops.ntbuff = 64; % samples of symmetrical buffer for whitening and spike detection ops.NT = 64*1024+ ops.ntbuff; % must be multiple of 32 + ntbuff. This is the batch size (try decreasing if out of memory). ops.whiteningRange = 32; % number of channels to use for whitening each channel ops.nSkipCov = 25; % compute whitening matrix from every N-th batch ops.scaleproc = 200; % int16 scaling of whitened data ops.nPCs = 5; % how many PCs to project the spikes into ops.useRAM = 0;

Best Regards, Fukuaki K

2022-02-09 122653

TomBugnon commented 2 years ago

Kilosort assumes a refractory period of 2msec when computing the ContamPct metrics. If neurons have shorter refractory periods than that (which seems to be the case eg in the thalamus in my dataset) they might have a super clean autocorrelogram and still be labelled MUA. You could try ignoring KS's assessment and computing the metrics yourself with different refractory periods using Jennifer Colonel's ecephys_spike_sorting pipeline Cheers

00Yijunchen commented 11 months ago

Any soulutions to this problems?I have the similar question.I analyzed the data recorded for 40 min in 12 electrodes and I have seen my results in the phy and found that there are a lot of clusters labeled with mua ,also the waveforms are very strange from normal ones.But I detected datasets that are shorter and emouse data ,the results looked all normal.