Backends & Inputs
Sorrel reads several sorting and recording formats. The general rule:
- Sorting backends carry both a sorting and (optionally) the raw trace.
- Recording-only formats plug into a sorting via
--dat/--spikeglx-meta/--oebin.
| Kind | Format | Notes |
|---|---|---|
| Sorting | phy / Kilosort directory | Reads Phy arrays as-is, including Kilosort 4’s native .npy output. |
| Sorting | SpikeInterface SortingAnalyzer (binary folder) | Reads recording.json (binary, or a channel- and sample-preserving preprocessing chain over binary), the flat sorting under sorting/, optional probe.json, and extensions/quality_metrics/metrics.csv. |
| Sorting | NWB (local HDF5) | HDF5 is bundled by default. Reads /units, with or without a trace. --nwb-series selects an acquisition or processed series; --dat pairs a separate raw NWB. See NWB. |
| Sorting | NWB-Zarr (local Zarr v2 directory) | Default zarr feature. Same units and lazy trace reader as HDF5 NWB; --dat can mix storage formats. See NWB. |
| Sorting | DANDI NWB / NWB-Zarr (remote) | On by default. Read-only range streaming with local journals. See DANDI streaming. |
| Sorting | Legacy MATLAB rez.mat / rez2.mat | MATLAB v7.3 (HDF5) files from Kilosort 2, 2.5, and 3. See Legacy MATLAB rez.mat. |
| Recording | SpikeGLX (*.bin + *.meta) | Use as --dat; pass --spikeglx-meta for sample rate / channels / dtype. |
| Recording | Open Ephys binary (continuous.dat + structure.oebin) | Use as --dat; pass --oebin to inherit metadata. |
| Recording | Mountainsort MDA (*.mda) | Use as --dat. Reads the MDA header. |
Backend detection
When --backend is not specified, the detector is run on the input path:
- File path
*.nwb→ NWB (HDF5). - File path
rez.mat/rez2.mat→ legacy MATLAB reader (HDF5). - Directory containing
spike_times.npy+spike_clusters.npy→ phy / Kilosort. - Directory ending in
.nwb.zarror withnwb_versionin root.zattrs→ NWB (Zarr). - Directory containing
recording.json(orbinary.json) and asorting/folder → SortingAnalyzer.
If none match, Sorrel exits with a message listing what it looked for.
Probe geometry
If a probe.json or probegroup.json (probeinterface) is present in
the directory, Sorrel uses it to lay out the WaveformView and ProbeView.
Phy’s channel_positions.npy wins when both are present (it’s
authoritative for the row order in the raw .dat).
Quality metrics sidecars
Sorrel auto-loads cluster-level metrics at startup from any of:
quality_metrics.csv(one row per cluster, header columns become metric names — SI’s format).cluster_<metric>.tsvfiles (one file per metric — phy’s format)./unitscolumns marked as Sorrel QC metrics by the Python NWB export.
NaNs mean the upstream tool didn’t report a value for that cluster.