diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2d0e9261..f461f088 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,10 +1,13 @@ -FROM python:3.9-slim@sha256:5f0192a4f58a6ce99f732fe05e3b3d00f12ae62e183886bca3ebe3d202686c7f +ARG PY_VER=3.11 +ARG DISTRO=bullseye +FROM mcr.microsoft.com/devcontainers/python:${PY_VER}-${DISTRO} -ENV PATH /usr/local/bin:$PATH -ENV PYTHON_VERSION 3.9.17 +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive + +USER root RUN \ - adduser --system --disabled-password --shell /bin/bash vscode && \ # install docker apt-get update && \ apt-get install ca-certificates curl gnupg lsb-release -y && \ @@ -45,4 +48,5 @@ ENV EPHYS_ROOT_DATA_DIR /workspaces/element-array-ephys/example_data ENV DATABASE_PREFIX neuro_ USER vscode -CMD bash -c "sudo rm /var/run/docker.pid; sudo dockerd" \ No newline at end of file + +CMD bash -c "sudo rm /var/run/docker.pid; sudo dockerd" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bf939e88..1c062f18 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -22,8 +22,8 @@ }, "vscode": { "extensions": [ - "ms-python.python@2023.8.0", - "ms-toolsai.jupyter@2023.3.1201040234" + "ms-python.python@2025.6.1", + "ms-toolsai.jupyter@2025.4.1" ] } } diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a0a85cd..93b08501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention. +## [0.4.4] - 2025-06-06 + ++ Update - Update params in test/tutorial ++ Fix - Moved KiloSort's template_features to additional_files + ## [0.4.3] - 2025-06-03 + Update - Use `Spikeinterface` official released versions (instead of install directly from source) diff --git a/notebooks/tutorial.ipynb b/notebooks/tutorial.ipynb index 09d41f44..f022f6fc 100644 --- a/notebooks/tutorial.ipynb +++ b/notebooks/tutorial.ipynb @@ -88,8 +88,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "[2024-03-21 20:57:39,371][INFO]: Connecting root@fakeservices.datajoint.io:3306\n", - "[2024-03-21 20:57:39,378][INFO]: Connected root@fakeservices.datajoint.io:3306\n" + "[2025-06-09 17:50:59,598][INFO]: DataJoint 0.14.4 connected to root@fakeservices.datajoint.io:3306\n" ] }, { @@ -122,7 +121,15 @@ "cell_type": "code", "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[2025-06-09 17:50:59,755][WARNING]: lab.Project and related tables will be removed in a future version of Element Lab. Please use the project schema.\n" + ] + } + ], "source": [ "from tests.tutorial_pipeline import lab, subject, session, probe, ephys" ] @@ -143,433 +150,452 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "%3\n", - "\n", - "\n", + "\n", + "\n", "\n", - "ephys.WaveformSet.Waveform\n", - "\n", - "\n", - "ephys.WaveformSet.Waveform\n", + "ephys.LFP\n", + "\n", + "\n", + "ephys.LFP\n", "\n", "\n", "\n", - "\n", + "\n", + "\n", + "ephys.LFP.Electrode\n", + "\n", + "\n", + "ephys.LFP.Electrode\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "ephys.LFP->ephys.LFP.Electrode\n", + "\n", + "\n", + "\n", "\n", - "probe.ElectrodeConfig\n", - "\n", - "\n", - "probe.ElectrodeConfig\n", + "ephys.EphysRecording.EphysFile\n", + "\n", + "\n", + "ephys.EphysRecording.EphysFile\n", "\n", "\n", "\n", - "\n", + "\n", "\n", - "ephys.EphysRecording\n", - "\n", - "\n", - "ephys.EphysRecording\n", + "ephys.ClusteringTask\n", + "\n", + "\n", + "ephys.ClusteringTask\n", "\n", "\n", "\n", - "\n", - "\n", - "probe.ElectrodeConfig->ephys.EphysRecording\n", - "\n", + "\n", + "\n", + "ephys.Clustering\n", + "\n", + "\n", + "ephys.Clustering\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "ephys.ClusteringTask->ephys.Clustering\n", + "\n", + "\n", + "\n", + "\n", + "probe.ElectrodeConfig\n", + "\n", + "\n", + "probe.ElectrodeConfig\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "probe.ElectrodeConfig.Electrode\n", - "\n", - "\n", - "probe.ElectrodeConfig.Electrode\n", + "\n", + "\n", + "probe.ElectrodeConfig.Electrode\n", "\n", "\n", "\n", "\n", - "\n", + "\n", "probe.ElectrodeConfig->probe.ElectrodeConfig.Electrode\n", - "\n", + "\n", "\n", - "\n", - "\n", - "ephys.LFP\n", - "\n", - "\n", - "ephys.LFP\n", + "\n", + "\n", + "ephys.EphysRecording\n", + "\n", + "\n", + "ephys.EphysRecording\n", "\n", "\n", "\n", - "\n", - "\n", - "ephys.EphysRecording->ephys.LFP\n", - "\n", + "\n", + "\n", + "probe.ElectrodeConfig->ephys.EphysRecording\n", + "\n", "\n", - "\n", - "\n", - "ephys.ClusteringTask\n", - "\n", - "\n", - "ephys.ClusteringTask\n", + "\n", + "\n", + "ephys.InsertionLocation\n", + "\n", + "\n", + "ephys.InsertionLocation\n", "\n", "\n", "\n", - "\n", - "\n", - "ephys.EphysRecording->ephys.ClusteringTask\n", - "\n", + "\n", + "\n", + "subject.Subject\n", + "\n", + "\n", + "subject.Subject\n", + "\n", "\n", - "\n", - "\n", - "ephys.EphysRecording.EphysFile\n", - "\n", - "\n", - "ephys.EphysRecording.EphysFile\n", + "\n", + "\n", + "\n", + "session.Session\n", + "\n", + "\n", + "session.Session\n", "\n", "\n", "\n", - "\n", + "\n", "\n", - "ephys.EphysRecording->ephys.EphysRecording.EphysFile\n", - "\n", + "subject.Subject->session.Session\n", + "\n", "\n", - "\n", - "\n", - "ephys.ClusteringParamSet\n", - "\n", - "\n", - "ephys.ClusteringParamSet\n", + "\n", + "\n", + "ephys.ProbeInsertion\n", + "\n", + "\n", + "ephys.ProbeInsertion\n", "\n", "\n", "\n", - "\n", + "\n", "\n", - "ephys.ClusteringParamSet->ephys.ClusteringTask\n", - "\n", + "ephys.ProbeInsertion->ephys.InsertionLocation\n", + "\n", "\n", - "\n", + "\n", "\n", - "probe.ElectrodeConfig.Electrode->ephys.WaveformSet.Waveform\n", - "\n", + "ephys.ProbeInsertion->ephys.EphysRecording\n", + "\n", "\n", - "\n", - "\n", - "ephys.LFP.Electrode\n", - "\n", - "\n", - "ephys.LFP.Electrode\n", + "\n", + "\n", + "ephys.CuratedClustering\n", + "\n", + "\n", + "ephys.CuratedClustering\n", "\n", "\n", "\n", - "\n", + "\n", "\n", - "probe.ElectrodeConfig.Electrode->ephys.LFP.Electrode\n", - "\n", + "ephys.Clustering->ephys.CuratedClustering\n", + "\n", + "\n", + "\n", + "\n", + "ephys.QualityMetrics.Waveform\n", + "\n", + "\n", + "ephys.QualityMetrics.Waveform\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "ephys.ClusterQualityLabel\n", + "\n", + "\n", + "ephys.ClusterQualityLabel\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "ephys.CuratedClustering.Unit\n", - "\n", - "\n", - "ephys.CuratedClustering.Unit\n", + "\n", + "\n", + "ephys.CuratedClustering.Unit\n", "\n", "\n", "\n", - "\n", + "\n", "\n", - "probe.ElectrodeConfig.Electrode->ephys.CuratedClustering.Unit\n", - "\n", - "\n", - "\n", - "\n", - "ephys.LFP->ephys.LFP.Electrode\n", - "\n", + "ephys.ClusterQualityLabel->ephys.CuratedClustering.Unit\n", + "\n", "\n", "\n", - "\n", + "\n", "ephys.WaveformSet\n", - "\n", - "\n", - "ephys.WaveformSet\n", + "\n", + "\n", + "ephys.WaveformSet\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "ephys.WaveformSet.Waveform\n", + "\n", + "\n", + "ephys.WaveformSet.Waveform\n", "\n", "\n", "\n", "\n", - "\n", + "\n", "ephys.WaveformSet->ephys.WaveformSet.Waveform\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "ephys.WaveformSet.PeakWaveform\n", - "\n", - "\n", - "ephys.WaveformSet.PeakWaveform\n", + "\n", + "\n", + "ephys.WaveformSet.PeakWaveform\n", "\n", "\n", "\n", "\n", - "\n", + "\n", "ephys.WaveformSet->ephys.WaveformSet.PeakWaveform\n", - "\n", - "\n", - "\n", - "\n", - "session.Session\n", - "\n", - "\n", - "session.Session\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "ephys.ProbeInsertion\n", - "\n", - "\n", - "ephys.ProbeInsertion\n", - "\n", + "\n", "\n", + "\n", + "\n", + "ephys.CuratedClustering.Unit->ephys.QualityMetrics.Waveform\n", + "\n", "\n", - "\n", + "\n", "\n", - "session.Session->ephys.ProbeInsertion\n", - "\n", - "\n", - "\n", - "\n", - "subject.Subject\n", - "\n", - "\n", - "subject.Subject\n", - "\n", - "\n", + "ephys.CuratedClustering.Unit->ephys.WaveformSet.Waveform\n", + "\n", "\n", - "\n", + "\n", "\n", - "subject.Subject->session.Session\n", - "\n", + "ephys.CuratedClustering.Unit->ephys.WaveformSet.PeakWaveform\n", + "\n", "\n", - "\n", - "\n", - "ephys.AcquisitionSoftware\n", - "\n", - "\n", - "ephys.AcquisitionSoftware\n", + "\n", + "\n", + "ephys.QualityMetrics.Cluster\n", + "\n", + "\n", + "ephys.QualityMetrics.Cluster\n", "\n", "\n", "\n", - "\n", + "\n", "\n", - "ephys.AcquisitionSoftware->ephys.EphysRecording\n", - "\n", - "\n", - "\n", - "\n", - "ephys.ClusteringMethod\n", - "\n", - "\n", - "ephys.ClusteringMethod\n", - "\n", - "\n", + "ephys.CuratedClustering.Unit->ephys.QualityMetrics.Cluster\n", + "\n", "\n", - "\n", + "\n", "\n", - "ephys.ClusteringMethod->ephys.ClusteringParamSet\n", - "\n", - "\n", - "\n", - "\n", - "ephys.Clustering\n", - "\n", - "\n", - "ephys.Clustering\n", - "\n", - "\n", + "probe.ElectrodeConfig.Electrode->ephys.CuratedClustering.Unit\n", + "\n", "\n", - "\n", + "\n", "\n", - "ephys.ClusteringTask->ephys.Clustering\n", - "\n", - "\n", - "\n", - "\n", - "probe.ProbeType\n", - "\n", - "\n", - "probe.ProbeType\n", - "\n", - "\n", + "probe.ElectrodeConfig.Electrode->ephys.WaveformSet.Waveform\n", + "\n", "\n", - "\n", + "\n", "\n", - "probe.ProbeType->probe.ElectrodeConfig\n", - "\n", + "probe.ElectrodeConfig.Electrode->ephys.LFP.Electrode\n", + "\n", "\n", - "\n", - "\n", - "probe.Probe\n", - "\n", - "\n", - "probe.Probe\n", + "\n", + "\n", + "ephys.EphysRecording.Channel\n", + "\n", + "\n", + "ephys.EphysRecording.Channel\n", "\n", "\n", "\n", - "\n", + "\n", "\n", - "probe.ProbeType->probe.Probe\n", - "\n", + "probe.ElectrodeConfig.Electrode->ephys.EphysRecording.Channel\n", + "\n", "\n", - "\n", - "\n", - "probe.ProbeType.Electrode\n", - "\n", - "\n", - "probe.ProbeType.Electrode\n", - "\n", + "\n", + "\n", + "session.Session->ephys.ProbeInsertion\n", + "\n", "\n", + "\n", + "\n", + "ephys.QualityMetrics\n", + "\n", + "\n", + "ephys.QualityMetrics\n", + "\n", "\n", - "\n", - "\n", - "probe.ProbeType->probe.ProbeType.Electrode\n", - "\n", "\n", - "\n", + "\n", "\n", - "probe.Probe->ephys.ProbeInsertion\n", - "\n", - "\n", - "\n", - "\n", - "ephys.CuratedClustering\n", - "\n", - "\n", - "ephys.CuratedClustering\n", - "\n", + "ephys.QualityMetrics->ephys.QualityMetrics.Waveform\n", + "\n", "\n", + "\n", + "\n", + "ephys.QualityMetrics->ephys.QualityMetrics.Cluster\n", + "\n", "\n", "\n", - "\n", + "\n", "ephys.CuratedClustering->ephys.WaveformSet\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "ephys.CuratedClustering->ephys.CuratedClustering.Unit\n", - "\n", - "\n", - "\n", - "\n", - "ephys.QualityMetrics\n", - "\n", - "\n", - "ephys.QualityMetrics\n", - "\n", - "\n", + "\n", "\n", "\n", - "\n", - "ephys.CuratedClustering->ephys.QualityMetrics\n", - "\n", - "\n", - "\n", "\n", - "ephys.CuratedClustering.Unit->ephys.WaveformSet.Waveform\n", - "\n", + "ephys.CuratedClustering->ephys.QualityMetrics\n", + "\n", "\n", - "\n", - "\n", - "ephys.QualityMetrics.Waveform\n", - "\n", - "\n", - "ephys.QualityMetrics.Waveform\n", + "\n", + "\n", + "probe.Probe\n", + "\n", + "\n", + "probe.Probe\n", "\n", "\n", "\n", - "\n", + "\n", "\n", - "ephys.CuratedClustering.Unit->ephys.QualityMetrics.Waveform\n", - "\n", + "probe.Probe->ephys.ProbeInsertion\n", + "\n", "\n", - "\n", + "\n", + "\n", + "ephys.ClusteringParamSet\n", + "\n", + "\n", + "ephys.ClusteringParamSet\n", + "\n", + "\n", + "\n", + "\n", "\n", - "ephys.CuratedClustering.Unit->ephys.WaveformSet.PeakWaveform\n", - "\n", + "ephys.ClusteringParamSet->ephys.ClusteringTask\n", + "\n", "\n", - "\n", - "\n", - "ephys.QualityMetrics.Cluster\n", - "\n", - "\n", - "ephys.QualityMetrics.Cluster\n", + "\n", + "\n", + "ephys.AcquisitionSoftware\n", + "\n", + "\n", + "ephys.AcquisitionSoftware\n", "\n", "\n", "\n", - "\n", + "\n", "\n", - "ephys.CuratedClustering.Unit->ephys.QualityMetrics.Cluster\n", - "\n", + "ephys.AcquisitionSoftware->ephys.EphysRecording\n", + "\n", "\n", - "\n", + "\n", "\n", - "probe.ProbeType.Electrode->probe.ElectrodeConfig.Electrode\n", - "\n", - "\n", - "\n", - "\n", - "ephys.ClusterQualityLabel\n", - "\n", - "\n", - "ephys.ClusterQualityLabel\n", - "\n", - "\n", + "ephys.EphysRecording->ephys.LFP\n", + "\n", "\n", - "\n", + "\n", "\n", - "ephys.ClusterQualityLabel->ephys.CuratedClustering.Unit\n", - "\n", + "ephys.EphysRecording->ephys.EphysRecording.EphysFile\n", + "\n", "\n", - "\n", + "\n", "\n", - "ephys.Clustering->ephys.CuratedClustering\n", - "\n", + "ephys.EphysRecording->ephys.ClusteringTask\n", + "\n", "\n", - "\n", + "\n", "\n", - "ephys.QualityMetrics->ephys.QualityMetrics.Waveform\n", - "\n", + "ephys.EphysRecording->ephys.EphysRecording.Channel\n", + "\n", "\n", - "\n", + "\n", + "\n", + "probe.ProbeType.Electrode\n", + "\n", + "\n", + "probe.ProbeType.Electrode\n", + "\n", + "\n", + "\n", + "\n", "\n", - "ephys.QualityMetrics->ephys.QualityMetrics.Cluster\n", - "\n", + "probe.ProbeType.Electrode->probe.ElectrodeConfig.Electrode\n", + "\n", "\n", - "\n", - "\n", - "ephys.InsertionLocation\n", - "\n", - "\n", - "ephys.InsertionLocation\n", + "\n", + "\n", + "ephys.ClusteringMethod\n", + "\n", + "\n", + "ephys.ClusteringMethod\n", "\n", "\n", "\n", - "\n", + "\n", "\n", - "ephys.ProbeInsertion->ephys.EphysRecording\n", - "\n", + "ephys.ClusteringMethod->ephys.ClusteringParamSet\n", + "\n", "\n", - "\n", + "\n", + "\n", + "probe.ProbeType\n", + "\n", + "\n", + "probe.ProbeType\n", + "\n", + "\n", + "\n", + "\n", "\n", - "ephys.ProbeInsertion->ephys.InsertionLocation\n", - "\n", + "probe.ProbeType->probe.ElectrodeConfig\n", + "\n", + "\n", + "\n", + "\n", + "probe.ProbeType->probe.Probe\n", + "\n", + "\n", + "\n", + "\n", + "probe.ProbeType->probe.ProbeType.Electrode\n", + "\n", "\n", "\n", "" ], "text/plain": [ - "" + "" ] }, "execution_count": 4, @@ -1772,8 +1798,25 @@ "name": "stderr", "output_type": "stream", "text": [ - "EphysRecording: 100%|██████████| 1/1 [00:00<00:00, 1.69it/s]\n" + "EphysRecording: 0%| | 0/1 [00:00
0\n", "kilosort2\n", "Spike sorting using Kilosort2\n", - "de78cee1-526f-319e-b6d5-8a2ba04963d8\n", + "1be14ec5-8c8a-6d86-e766-f31042931575\n", "=BLOB=
\n", " \n", " \n", @@ -2140,45 +2183,57 @@ "text/plain": [ "*paramset_idx clustering_met paramset_desc param_set_hash params \n", "+------------+ +------------+ +------------+ +------------+ +--------+\n", - "0 kilosort2 Spike sorting de78cee1-526f- =BLOB= \n", + "0 kilosort2 Spike sorting 1be14ec5-8c8a- =BLOB= \n", " (Total: 1)" ] }, - "execution_count": 24, + "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# insert clustering task manually\n", - "params_ks = {\n", - " \"fs\": 30000,\n", - " \"fshigh\": 150,\n", + "params = {}\n", + "params[\"SI_PREPROCESSING_METHOD\"] = \"CatGT\"\n", + "params[\"SI_SORTING_PARAMS\"] = {\n", " \"minfr_goodchannels\": 0.1,\n", - " \"Th\": [10, 4],\n", " \"lam\": 10,\n", " \"AUCsplit\": 0.9,\n", " \"minFR\": 0.02,\n", " \"momentum\": [20, 400],\n", " \"sigmaMask\": 30,\n", - " \"ThPr\": 8,\n", - " \"spkTh\": -6,\n", - " \"reorder\": 1,\n", - " \"nskip\": 25,\n", - " \"GPU\": 1,\n", - " \"Nfilt\": 1024,\n", " \"nfilt_factor\": 4,\n", " \"ntbuff\": 64,\n", - " \"whiteningRange\": 32,\n", - " \"nSkipCov\": 25,\n", " \"scaleproc\": 200,\n", " \"nPCs\": 3,\n", - " \"useRAM\": 0,\n", "}\n", + "params[\"SI_POSTPROCESSING_PARAMS\"] = {\n", + " \"extensions\": {\n", + " \"random_spikes\": {},\n", + " \"waveforms\": {},\n", + " \"templates\": {},\n", + " \"noise_levels\": {},\n", + " # \"amplitude_scalings\": {},\n", + " \"correlograms\": {},\n", + " \"isi_histograms\": {},\n", + " \"principal_components\": {\"n_components\": 5, \"mode\": \"by_channel_local\"},\n", + " \"spike_amplitudes\": {},\n", + " \"spike_locations\": {},\n", + " \"template_metrics\": {\"include_multi_channel_metrics\": True},\n", + " \"template_similarity\": {},\n", + " \"unit_locations\": {},\n", + " \"quality_metrics\": {},\n", + " },\n", + " \"job_kwargs\": {\"n_jobs\": 0.8, \"chunk_duration\": \"1s\"},\n", + " \"export_to_phy\": True,\n", + " \"export_report\": True,\n", + "}\n", + "\n", "ephys.ClusteringParamSet.insert_new_params(\n", " clustering_method=\"kilosort2\",\n", " paramset_idx=0,\n", - " params=params_ks,\n", + " params=params,\n", " paramset_desc=\"Spike sorting using Kilosort2\",\n", ")\n", "ephys.ClusteringParamSet()" @@ -2198,7 +2253,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 27, "metadata": {}, "outputs": [ { @@ -2214,7 +2269,7 @@ "task_mode=\"load\" : enum('load','trigger') # 'load': load computed analysis results, 'trigger': trigger computation" ] }, - "execution_count": 25, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" } @@ -2240,7 +2295,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ @@ -2265,15 +2320,25 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 29, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "Clustering: 100%|██████████| 1/1 [00:00<00:00, 9.05it/s]\n" + "Clustering: 100%|██████████| 1/1 [00:00<00:00, 2.73it/s]\n" ] + }, + { + "data": { + "text/plain": [ + "{'success_count': 1, 'error_list': []}" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -2292,18 +2357,15 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "CuratedClustering: 0%| | 0/1 [00:00=3.7, <3.11", + python_requires=">=3.7, <3.12", version=__version__, # noqa F821 description="Extracellular Array Electrophysiology DataJoint Element", long_description=long_description, diff --git a/tests/conftest.py b/tests/conftest.py index 9a191749..cf9d69f9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -105,35 +105,47 @@ def populate_lfp(pipeline, insert_upstreams): @pytest.fixture(scope="session") def insert_clustering_task(pipeline, populate_ephys_recording): ephys = pipeline["ephys"] - params_ks = { - "fs": 30000, - "fshigh": 150, + params = {} + params["SI_PREPROCESSING_METHOD"] = "CatGT" + params["SI_SORTING_PARAMS"] = { "minfr_goodchannels": 0.1, - "Th": [10, 4], "lam": 10, "AUCsplit": 0.9, "minFR": 0.02, "momentum": [20, 400], "sigmaMask": 30, - "ThPr": 8, - "spkTh": -6, - "reorder": 1, - "nskip": 25, - "GPU": 1, - "Nfilt": 1024, "nfilt_factor": 4, "ntbuff": 64, - "whiteningRange": 32, - "nSkipCov": 25, "scaleproc": 200, "nPCs": 3, - "useRAM": 0, } + params["SI_POSTPROCESSING_PARAMS"] = { + "extensions": { + "random_spikes": {}, + "waveforms": {}, + "templates": {}, + "noise_levels": {}, + # "amplitude_scalings": {}, + "correlograms": {}, + "isi_histograms": {}, + "principal_components": {"n_components": 5, "mode": "by_channel_local"}, + "spike_amplitudes": {}, + "spike_locations": {}, + "template_metrics": {"include_multi_channel_metrics": True}, + "template_similarity": {}, + "unit_locations": {}, + "quality_metrics": {}, + }, + "job_kwargs": {"n_jobs": 0.8, "chunk_duration": "1s"}, + "export_to_phy": True, + "export_report": True, + } + ephys.ClusteringParamSet.insert_new_params( - clustering_method="kilosort2", + clustering_method="kilosort2.5", + paramset_desc="Default parameter set for Kilosort2.0 with SpikeInterface", + params=params, paramset_idx=0, - params=params_ks, - paramset_desc="Spike sorting using Kilosort2", ) session_key = dict(subject="subject5", session_datetime="2023-01-01 00:00:00")