SpikeInterface / spikeinterface

A Python-based module for creating flexible and robust spike sorting pipelines.
https://spikeinterface.readthedocs.io
MIT License
533 stars 187 forks source link

Kilosort: 'Error using indexing' #2272

Closed pantelisantonoudiou closed 12 months ago

pantelisantonoudiou commented 1 year ago

Hello, I get an indexing error that originates from MATLAB when I try to run kilosort3 with our data. I tested our data with other sorters such as pykilosort, spykingcircus and mountainsort5 and they get sorted fine and waveforms can be extracted and loaded to the sortingview gui. This indexing error does not show up when I run kilosort3 with the toy example even when using the same sampling frequency, number of channels, probe settings, and data type (float 32), so I am not sure what's causing the error.

  # Load the recording
  raw_recording = BinaryRecordingExtractor.load_from_folder('raw_data')

  # Run spike sorting
  sorter = 'kilosort3'
  sorting = ss.run_sorter(sorter_name=sorter,
                  recording=raw_recording,
                  output_folder=sorter + "_sorting",
                  verbose=True,
                  docker_image=True,)
  print(sorting)
"runtime_trace": [
        "Warning: X does not support locale C.UTF-8",
        "Time   0s. Computing whitening matrix..",
        "Getting channel whitening matrix...",
        "Channel-whitening matrix computed.",
        "Time   2s. Loading raw data and applying filters...",
        "Time   2s. Finished preprocessing 16 batches.",
        "Drift correction ENABLED",
        "----------------------------------------Error using indexing",
        "Subscript indices must either be real positive integers or logicals."
    ],

I can reproduce this error when Drift correction is DISABLED and also when using kilosort2.5.

    "runtime_trace": [
        "Warning: X does not support locale C.UTF-8",
        "Time   0s. Computing whitening matrix..",
        "Getting channel whitening matrix...",
        "Channel-whitening matrix computed.",
        "Time   2s. Loading raw data and applying filters...",
        "Time   2s. Finished preprocessing 16 batches.",
        "Drift correction DISABLED",
        "----------------------------------------Error using indexing",
        "Subscript indices must either be real positive integers or logicals."
    ],

Thank you for your help!

alejoe91 commented 1 year ago

Hi, we have heard several reports of Kilosort3 failing on some datasets.

Unfortunately, we don't know how we can help! Can you open an issue on their main page?

pantelisantonoudiou commented 1 year ago

Thank you for your prompt response! I will open an issue on their page.

alejoe91 commented 12 months ago

clogin this one then :)