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
449 stars 235 forks source link

Contamination Percent #143

Closed sina253 closed 5 months ago

sina253 commented 4 years ago

Hi Kilosort2 calculating a value named: ContamPct, which I guess should be contamination percentage. For some of our sorting sessions this number is low for good labeled clusters and all 100 for the MUA labeled clusters. However, for the other sorting sessions ContamPct values are very different and are even more than 100 for clusters.

Is this a bug?

marius10p commented 4 years ago

Share screenshots please. I don't know why it would be above 100.

Stefxnia83 commented 4 years ago

Hi Marius, I attached two example where you can see the value of the contamination percentage for all the multiunits is always 100. I also attached an example of a cluster labeled as good and the value of the contamination percentage is always 100. Also, the data have been collected by a 96 channels Utah Array. The recording loci do not have different depths, but as you can see the channels are attributed to different depths and look like they are attributed to one shank. Could that affect the output of the sorting?

ContamPct_MUA_100 ContamPct_MUA_100_2 ContamPct_SUA_100

marius10p commented 4 years ago

I am not sure why a cluster would be labelled as good even though the contamination is computed as 100%. I'll double check, but in any case, that label is meant to be used as guidance. Works very well on some data, and poorly on other data.

"Depth" is interpreted as the y-dimension of your channel map file. This won't really make an impact on the sorting in your case, it's just for visualization in Phy.

JoseGuzman commented 4 years ago

I have exactly the same issue (see attached screenshot). ContamPct

I am not sure what can be the reason, but it seems to happen when the templates are on the same channel (see colors in the figure). I am using 128 channels from Cambridge Neurotech probes.

Stefxnia83 commented 4 years ago

Thank you!

marius10p commented 4 years ago

Ok, I'll have to look into that. Looks like the ones labelled as good with ContamPct=100 might have very few spikes. I thought I had a special case to exclude those, but I'll have to check it.