Parameters suggestion for short probes
Dear Kilosort community, I have been using CambridgeNeurotech H- and P-series probes to do acute recording (typically around 1 hour) in head-fixed insects. In this particular issue, I would like to ask for advice on the kilosort4 parameters for a 32-channel 2-shank probes. Below is the diagram of the probe and GUI.
I have read through issues about tuning parameters for such a short probe such as #686, #896 #892 #831 so my general approach to this issue has been
- set
nblocks = 0to disable drift correction; - increase
batch_size = 180000to account for low number of channels (the sampling frequency is 30000); - set
dminx = 22.5, the horizontal spacing between contacts; - set
nearest_templates = 16to account for the fact that there are 16 channels on each shank.
[Note: I use kilosort ver. 4.0.37 and sort out units from the two shanks altogether] This set of parameters seems to work fine when the recording is good enough (what I meanted by work fine is that I usually expect 1 or 2 units in a recording session and the kilosort would classifiy 10-30 putatitive units (ids), the number that I can still merge and split on phy afterwards). However, recently I have a recording session where kilosort sorted out more than 100 ids and classified nearly half of them to be good. Although there are good units among them, they are usually those with fewer spikes, which is probably how they pass the acg threshold easily. For example,
On the other hand, there are other id with weird mean waveform, which seems to come from units mixing up with noises. And the labels good and mua are not longer informative.
For example,
This gave me some hope that there are good units mixed up with noises and by tuning some other parameters, I would be able to improve the quality of spike sorting in this dataset. So far, what I have tried is
- increase
batch_sizeto 300000 (10s); - increase the
highpass_cutoffto 600; - increase the
Th (univerisal)and/orTh (learned)by 1 or 2; - reduce the
max_channel_distanceto 16; - even reduce the
whitening_rangeto 16.
I have also used the default setting (except for keeping drift correction off). However, none of them improved sorting quality dramatically.
Below are the log and diagnostics files from some of the testings.
Use default settings
kilosort4.log
'batch_size': 180000, 'dminx': 22.5, 'nearest_templates': 16, 'max_channel_distance': 16.0,
kilosort4.log
'batch_size': 300000, 'dminx': 22.5, 'nearest_templates': 16, 'max_channel_distance': 16.0, 'Th_universal': 11.0,
'highpass_cutoff': 600.0,
kilosort4.log
'batch_size': 300000, 'dminx': 22.5, 'nearest_templates': 16, 'max_channel_distance': 16.0, 'Th_universal': 11.0, 'Th_learned': 10.0, 'highpass_cutoff': 600.0, 'whitening_range': 16,
kilosort4.log
Could anyone please give me guidance about what to do next with those parameters, or more generally potential issues in the recording with this kind of short probes? I would be happy to provide a snippet of the recording if that helps. Many thanks in advance!
It's hard to say much from this, other than it looks like you have two pretty clearly separated groups of units: ones with higher spike counts and low amplitude, and ones with high amplitude but lower spike counts (on average). If you can look at those in Phy and see that one group is noise while the other is neural, then that's a pretty clear indication that the noise in your recording is interfering with clustering. Tinkering with KS4 parameters is not going to fix that, you would need to do something else to remove that noise from the recording (if possible) prior to sorting.
I see! Thank you very much for your suggestions. I will try to reduce the noise first