{"id":19034763,"url":"https://github.com/int-brain-lab/ibl-sorter","last_synced_at":"2025-04-23T17:46:58.713Z","repository":{"id":233836342,"uuid":"784290492","full_name":"int-brain-lab/ibl-sorter","owner":"int-brain-lab","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-20T15:55:17.000Z","size":922,"stargazers_count":6,"open_issues_count":7,"forks_count":2,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-04-12T00:57:15.763Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/int-brain-lab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-09T15:02:12.000Z","updated_at":"2024-12-22T12:51:18.000Z","dependencies_parsed_at":"2024-04-26T17:39:50.668Z","dependency_job_id":"4d433051-aa49-4ece-b72b-516fb20d7ac2","html_url":"https://github.com/int-brain-lab/ibl-sorter","commit_stats":null,"previous_names":["int-brain-lab/pykilosort","int-brain-lab/ibl-sorter"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/int-brain-lab%2Fibl-sorter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/int-brain-lab%2Fibl-sorter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/int-brain-lab%2Fibl-sorter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/int-brain-lab%2Fibl-sorter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/int-brain-lab","download_url":"https://codeload.github.com/int-brain-lab/ibl-sorter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250484935,"owners_count":21438329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T21:47:22.454Z","updated_at":"2025-04-23T17:46:58.693Z","avatar_url":"https://github.com/int-brain-lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IBL Spike Sorting\n\nThis is the implementation of the IBL spike sorting pipeline described on this white paper: (https://doi.org/10.6084/m9.figshare.19705522.v4).\nThe clustering part is based on the original MATLAB version of [Kilosort 2.5](https://github.com/MouseLand/Kilosort), written by Marius Pachitariu.\n\n## Usage\n\nWe provide a few datasets to explore parametrization and test on several brain regions.\nThe smallest dataset is a 100 seconds excerpt to test the installation. Here is the minimal working example:\n\n```python\nimport shutil\nfrom pathlib import Path\n\nfrom iblsorter.ibl import run_spike_sorting_ibl, ibl_pykilosort_params, download_test_data\n\nif __name__ == \"__main__\":\n    data_path = Path(\"/mnt/s0/spike_sorting/integration_tests\")  # path on which the raw data will be downloaded\n    scratch_dir = Path.home().joinpath(\"scratch\",\n                                    'iblsorter')  # temporary path on which intermediate raw data will be written, we highly recommend a SSD drive\n    ks_output_dir = Path(\"/mnt/s0/spike_sorting/outputs\")  # path containing the kilosort output unprocessed\n    alf_path = ks_output_dir.joinpath(\n        'alf')  # this is the output standardized as per IBL standards (SI units, ALF convention)\n\n    # download the integration test data from amazon s3 bucket\n    bin_file, meta_file = download_test_data(data_path)\n\n    # prepare and mop up folder architecture for consecutive runs\n    DELETE = True  # delete the intermediate run products, if False they'll be copied over to the output directory for debugging\n    shutil.rmtree(scratch_dir, ignore_errors=True)\n    scratch_dir.mkdir(exist_ok=True)\n    ks_output_dir.mkdir(parents=True, exist_ok=True)\n\n    # loads parameters and run\n    params = ibl_pykilosort_params(bin_file)\n    params['Th'] = [6, 3]\n\n    run_spike_sorting_ibl(bin_file, delete=DELETE, scratch_dir=scratch_dir,\n                            ks_output_dir=ks_output_dir, alf_path=alf_path, log_level='INFO', params=params)\n```\n\n\n## Installation \n\n### System Requirements\n\nThe code makes extensive use of the GPU via the CUDA framework. A high-end NVIDIA GPU with at least 8GB of memory is required.\nThe solution has been deployed and tested on Cuda 12+ and Python 3.12 in October 2024.\n\n\n### Python environment\n\nOnly on Linux, first install fftw by running the following \n    \n    sudo apt-get install -y libfftw3-dev\n\nNavigate to the desired location for the repository and clone it\n\n    git clone https://github.com/int-brain-lab/ibl-sorter.git\n    cd ibl-sorter\n\nInstallation for cuda 11.8\n\n    pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118\n    pip install cupy-cuda11x\n    pip install -e .\n\nInstallation for the latest cuda:\n\n    pip3 install torch torchvision torchaudio\n    pip install cupy-cuda12x\n    pip install -e .\n\n### Making sure the installation is successful and CUDA is available\n\nHere we make sure that both `cupy` and `torch` are installed and that the CUDA framework is available.\n\n```python\nfrom iblsorter.utils import cuda_installation_test\ncuda_installation_test()\n```\n\nThen we can run the integration test.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fint-brain-lab%2Fibl-sorter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fint-brain-lab%2Fibl-sorter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fint-brain-lab%2Fibl-sorter/lists"}