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
431 stars 228 forks source link

Parameter Adjustment for 24-Channel Probe with 150 um Spacing and 40 kHz Sampling Rate #729

Open Yirat-he opened 1 week ago

Yirat-he commented 1 week ago

Hi, I’m working with a 24-channel probe with 150 um spacing between contacts and a 40 kHz sampling rate. I have a few questions regarding the parameter adjustments for optimal performance: dminx and dmin Parameters: Since my probe only has vertical contacts, I tried setting dminx to 0, but the GUI doesn't allow it. What would be the recommended value for dminx in this case? For dmin, I saw in a previous answer that it should be set to double the spacing between contacts. Is that correct for my setup? Thresholds (Th_universal and Th_learned): I’ve experimented with Th_universal and Th_learned values of 9 and 8, and 9 and 6, respectively, but the results were not satisfactory. Could you provide guidance on appropriate threshold values for my setup? min_template_size Parameter: Given the 150 um spacing between contacts, what should I set for min_template_size? Attached is a screenshot of the parameters I currently use. I would greatly appreciate any insights or recommendations you can provide Thank you! image

jacobpennington commented 1 week ago

@Yirat-he You do not need to change dminx at all. If all your contacts have the same x-position, it will implicitly be treated as 0. You do not need to change dmin either. The default will place some templates in between channels, which are not likely to be useful since your spacing is so large, but with only 24 channels it's unlikely to have a noticeable impact on performance. Setting dmin = 300 should be fine, though. You can see where universal templates are placed relative to the contacts by clicking the "universal templates" checkbox under the probe preview in the GUI.

You do not need to change the min_template_size parameter. In general, you should not need to change any of the parameters from their defaults (aside from things like number of channels and sampling rate) unless you encounter problems, so you should always try sorting with the default values before changing anything.

I can't give any advice on thresholds without seeing screenshots of the results in Phy. You should start by sorting with the default values (for thresholds and min template size, nearest chans, etc). If the results still don't look satisfactory, upload some screenshots from Phy pointing out which parts look off.

Yirat-he commented 1 week ago

Thank you for the detailed response. I tried sorting with the default parameters, only adjusting those related to the channels, but I received a "No spikes detected" error. Attached is a screenshot of the error message. Previously, I changed the parameters based on your answers to NirvikNU (https://github.com/MouseLand/Kilosort/issues/638) and did get some sorting results, but they were not satisfactory. Any additional guidance would be greatly appreciated. image

Thank you again for your help!

jacobpennington commented 1 week ago

I see. Those adjustments make sense then. Can you please share some screenshots from the Phy results to show which part is not satisfactory?

zkcsmxz commented 1 week ago

Hi I wonder if the probe is 150 um spacing. Is it suitable for spike sorting? is there a maximum distance in space?

jacobpennington commented 1 week ago

Yes this is still suitable for sorting, there is no maximum distance in space.