From 85293eb82bfd884c99f47d6321db0461585e9abd Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Mon, 4 Mar 2024 17:52:22 +0000 Subject: [PATCH] Cleanup params, add installation and singularity tests --- doc/install_sorters.rst | 12 ++++++++++++ src/spikeinterface/sorters/external/kilosort4.py | 8 ++------ .../tests/test_singularity_containers_gpu.py | 8 +++++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/doc/install_sorters.rst b/doc/install_sorters.rst index e805f03eed..51fa94d7e6 100644 --- a/doc/install_sorters.rst +++ b/doc/install_sorters.rst @@ -136,6 +136,18 @@ Kilosort3 * See also for Matlab/CUDA: https://www.mathworks.com/help/parallel-computing/gpu-support-by-release.html +Kilosort4 +^^^^^^^^^ + +* Python, requires CUDA for GPU acceleration (highly recommended) +* Url: https://github.com/MouseLand/Kilosort +* Authors: Marius Pachitariu, Shashwat Sridhar, Carsen Stringer +* Installation:: + + pip install kilosort==4.0 torch + +* For more installation instruction refer to https://github.com/MouseLand/Kilosort + pyKilosort ^^^^^^^^^^ diff --git a/src/spikeinterface/sorters/external/kilosort4.py b/src/spikeinterface/sorters/external/kilosort4.py index b9bf926cd4..236db8bb5b 100644 --- a/src/spikeinterface/sorters/external/kilosort4.py +++ b/src/spikeinterface/sorters/external/kilosort4.py @@ -17,7 +17,6 @@ class Kilosort4Sorter(BaseSorter): requires_locations = True _default_params = { - "n_chan_bin": 385, "nblocks": 1, "Th_universal": 9, "Th_learned": 8, @@ -53,7 +52,6 @@ class Kilosort4Sorter(BaseSorter): } _params_description = { - "batch_size": "Number of samples included in each batch of data. Default value: 60000.", "nblocks": "Number of non-overlapping blocks for drift correction (additional nblocks-1 blocks are created in the overlaps). Default value: 1.", "Th_universal": "Spike detection threshold for universal templates. Th(1) in previous versions of Kilosort. Default value: 9.", "Th_learned": "Spike detection threshold for learned templates. Th(2) in previous versions of Kilosort. Default value: 8.", @@ -95,11 +93,9 @@ class Kilosort4Sorter(BaseSorter): For more information see https://github.com/MouseLand/Kilosort""" installation_mesg = """\nTo use Kilosort4 run:\n - >>> git clone https://github.com/MouseLand/Kilosort - >>> cd Kilosort - >>> pip install . + >>> pip install kilosort==4.0 - More information on Kilosort4 and its installation procedure at: + More information on Kilosort4 at: https://github.com/MouseLand/Kilosort """ diff --git a/src/spikeinterface/sorters/external/tests/test_singularity_containers_gpu.py b/src/spikeinterface/sorters/external/tests/test_singularity_containers_gpu.py index b164f16c43..8032826172 100644 --- a/src/spikeinterface/sorters/external/tests/test_singularity_containers_gpu.py +++ b/src/spikeinterface/sorters/external/tests/test_singularity_containers_gpu.py @@ -57,6 +57,12 @@ def test_kilosort3(run_kwargs): print(sorting) +def test_kilosort4(run_kwargs): + clean_singularity_cache() + sorting = ss.run_sorter(sorter_name="kilosort4", output_folder="kilosort4", **run_kwargs) + print(sorting) + + def test_pykilosort(run_kwargs): clean_singularity_cache() sorting = ss.run_sorter(sorter_name="pykilosort", output_folder="pykilosort", **run_kwargs) @@ -72,4 +78,4 @@ def test_yass(run_kwargs): if __name__ == "__main__": kwargs = generate_run_kwargs() - test_pykilosort(kwargs) + test_kilosort4(kwargs)