Native spike-sorting curation

Sorrel

A high-performance GUI for manual curation of spike-sorted electrophysiology data — phy / Kilosort, SpikeInterface, NWB, and KS4 rez out of the box, with a monomorphised Rust core, wgpu compute, and a durable SQLite journal.

Built For Curation Work

Phy & Kilosort, natively

Reads spike_times, spike_clusters, params.py, templates, PC features, amplitudes, similar_templates, channel_positions, and quality-metric sidecars exactly as phy does.

Multiple backends

phy / Kilosort, SpikeInterface SortingAnalyzer (binary folder), Kilosort 4 rez.mat, and NWB. SpikeGLX, Open Ephys, and MDA work as raw trace sources.

Static-dispatch core

Session, UI, render, and compute paths are generic over the DataProvider trait — every hot path is monomorphised per backend, no Box<dyn Trait>.

GPU trace pipeline

Optional wgpu kernels for common-median referencing, high-pass filtering, and mean-snippet extraction — sharing the renderer's device and queue, with a transparent CPU fallback.

Durable curation journal

Every relabel, merge, split, and undo/redo lands in SQLite before the in-memory session moves. Replay on open is idempotent; resealed at save.

Built-in views

Trace, raster, ISI, CCG, waveform, template, feature, drift, probe, similarity, quality, and merge/split suggestions, all in one window.

Headless QC export

sorrel --export-qc DIR runs every metric on the loaded session and writes cluster_qc.tsv + cluster_qc.json without spawning a window.

Python bridge

sorrel.open(recording, sorting) opens a SpikeInterface analyzer in the native GUI via the sorrel-py bridge.

Reads What You Already Have

phy / Kilosort

Directory of spike_times.npy, spike_clusters.npy, params.py, plus optional templates, PC features, amplitudes, channel positions, similarity, and quality-metric sidecars.

SpikeInterface

SortingAnalyzer saved as binary_folderrecording.json, the flat sorting under sorting/, optional probe.json, and quality_metrics extension.

NWB & KS4 rez

*.nwb via /units/spike_times and the electrodes table; rez.mat via rez/st3 and rez/ops. Both gated behind --features hdf5.

Recording sources

SpikeGLX .bin+.meta, Open Ephys continuous.dat+structure.oebin, and Mountainsort MDA plug in via --dat, --spikeglx-meta, --oebin.

Build & Run

Compile the release binary, then point it at a sorting directory — Sorrel auto-detects the backend.

cargo build --release -p sorrel
sorrel my_run/phy