Importing spike sorting from *Klusters*: Supervised spike sorting menu missing

Hello everybody out there using Brainstorm,

Thanks for making EEG accessible in an intuitive way!

Brainstorm imports spikes from external supervised spike sorting with Klusters as events (but with channels named "C2S1, C3S1, ..." and not "Spike channel AD01, ..." as shown in the documentation on https://neuroimage.usc.edu/brainstorm/e-phys/SpikeSorting#Klusters).
This hits me when trying to run analysis in the "Electrophysiology" menu like "Raster plot per Neuron", "Spike Field Coherence" or "Spiking phase locking": Brainstorm complains about "No spiking events detected".

The documentation mentions the possibility to use Klusters for supervised spike sorting, but I can only see the "Unsupervised Spike Sorting" and not the "Supervised spike sorting" menu item shown in the documentation when using the latest version of Brainstorm from GitHub:


Therefore, I looked at the source code and found that the functionality is provided via brainstorm3/toolbox/gui/panel_spikes.m.
This function doesn't seem to be called/invoked anywhere else so it seems that the Klusters spike sorting functionality was dropped at some point, because it might no longer be in the focus of interest (see https://neuroimage.usc.edu/forums/t/verification-of-spike-sorting-results/36736).
Is there an older version which was used for generating the example in the documentation which I could use to interface with Klusters?
I'm also not afraid in making minor adjustments in Brainstorm's code for myself in case someone could hint me towards the correct place.

How are you importing the Kluster supervised spike sorting?
Did you check the formatting of already-sorted spike events document?
https://neuroimage.usc.edu/brainstorm/e-phys/ConvertToBrainstormEvents

This screenshot was taken during an earlier phase of the e-phys development. The supervised spike sorting is not performed through a process, but it is done directly on the GUI:
https://neuroimage.usc.edu/brainstorm/e-phys/SpikeSorting#Supervised_Spike_Sorting

Klusters is used to perform supervised spike sorting on results obtained with KiloSort unsupervised sorting.

Thanks for your answer.
Spike sorting outside Brainstorm (with KiloSort and other software) works well including manual curation with Klusters.
I had seen

https://neuroimage.usc.edu/brainstorm/e-phys/ConvertToBrainstormEvents

but after having generated a simple events file in this format and having copied via the filesystem into the corresponding folder of brainstorm_db, it did not appear inside Brainstorm.
I also thought of simply running Kilosort from Brainstorm, but it gives me an error message due to inadequate input arguments and wrong input format. A similar error message is shown when trying to start WaveClus via Brainstorm.
Therefore, I'm hitting barriers at different places making it difficult to get started.
Can you recommend additional diagnostics I could run to pin down the problem? Is there a way to get more verbose output, i.e. a more detailed error message?

Making manual edits on the database folders is not recommended as it can lead to database corruption.
The event file that you created needs to be imported. With the recordings figure open, In the Record tab select the option: (Events section in the tab) File > Import in database... and select the file you created.
https://neuroimage.usc.edu/brainstorm/Tutorials/EventMarkers#Other_menus

Post the error message that appears and how you got there.

Have you tried to follow the e-phy tutorial using the provided data? Doing this would be an indication that the plugins are installed and working properly.

Thanks again for taking the time to answer, which finally enabled me to make some progress!

By renaming the event variables from C...S... to Spikes Channel E..., I can get plots of phase locking for the neurons (which are unfortunately the same for each channel - this is still a problem).
These events are even detected automatically (they are shown without any additional work) when working with Klusters data/output.

It is strange that the raster plot for the neurons is empty (which might be a matter of adjusting the marker size in the plot or something like that; sorry for not posting an additional screenshot, this forum seems to be set that new users can only post one image).

(Just for the sake of completeness:)

With KiloSort, I get the error message

***************************************************************************
** Error: Error: Data type mismatch.
** Invalid inputs for process:
** "WaveClus"
** 
***************************************************************************

which I didn't expect, thinking that KiloSort would run on the Raw data matrix in my brainstorm_db database.

With WaveClus I get the same error message

***************************************************************************
** Error: Error: Data type mismatch.
** Invalid inputs for process:
** "WaveClus"
** 
***************************************************************************

This is the graph I get for example for the phase locking:

It looks encouraging. The only thing which is surprising to me as I wrote is that it looks the same for each channel I choose in the main window. (The channels aren't really synchronous with respect to phase, frequency and amplitude.)

This makes the empty raster plot slightly more surprising: In the corresponding MATLAB data structures, I can indeed see no spikes for the raster plot, but there are spikes in the phase locking plot.

Btw: Are pull requests on GitHub welcome? The first line of the title of the phase locking plots usually says "156 Neurons", which is actually the number of spikes. I should manage to find the corresponding place in the code and fix it.

Yes, collaboration is welcomed, thank you!
Check this document that we prepared on how to contribute to Brainstorm: