Closed asheff794 closed 5 months ago
I would recommend bringing this up on Kilosort repo. On the SpikeInterface side we have seen multiple cases of Kilosort return spikes both before and after the recording time which can lead errors like this, but I'm not sure if this is the cause. You could try scur.remove_excessive_spikes(sorting, recording)
followed by export_to_phy and see if that fixes it. Otherwise this seems more like a problem with the KS output that they would need to know about.
Just wanted to point out I had a typo in the curation function. You need to give it the recording too for it to know which spikes are excessive :)
Thanks @zm711, running remove_excessive_spikes did solve the problem! For me it was the spike times occuring after the recording period, as I had other sessions with negative spike times and those didn't seem to cause any issues.
I raised the issue on the Kilosort repo so they're aware of the problem. Thanks again!
I'm trying to curate the results of kilosort4 using phy2, but on some sessions I am getting index out of bound errors when I try to open the gui. The index numbers provided relate to the number of clusters identified. In the example session I'm posting about here, 36 refers to the number of sorted clusters in spike_clusters.npy (haven't identified where the 41 comes from yet).
I've tried sorting both with the kilosort4 api and spikeinterface's wrapper and both experience the same issue. I've also tried installing phy2 from the environment.yml file and this doesn't change anything either compared to the README instructions. So far I haven't identified anything consistent about which sessions fail to load, it feels random so far. Here is the full error, let me know if any other kilosort output files would be helpful in debugging.