Kilosort4 settings
Kilosort4 (Pachitariu et al. 2024): high-density extracellular probes
dspk sort kilosort4 [OPTIONS] --output <OUTPUT> <RECORDING>Arguments
<RECORDING>
Recording (SpikeGLX .bin / .cbin, raw .bin + JSON .meta, NWB, Zarr)
Settings
--source <SOURCE>
Source within the file (an iddspk-cli openlists); default: the largest electrical one--probe <PROBE>: one ofneuropixels1,neuropixels2,tetrode,utah,hdemg4x8,hdemg8x8
Probe preset; default: the geometry the recording carries (SpikeGLX), else an error--probe-file <PROBE_FILE>
Probe file (.json: probeinterface or Kilosort 4) saying which channel each contact is wired to: the data is read in contact order (unconnected contacts left out), with its geometry--progress <PROGRESS>: defaultbar, one ofbar,json
How progress is reported:bar(on stderr) orjson(one JSON object per line on stdout:progressevents, thendoneorerror; for programs running this one)--channel-map <CHANNEL_MAP>
Channel map (.toml / .json, pairs underremap) applied after the probe: channels reordered, dropped, renamed; the geometry follows them--pitch-um <PITCH_UM>: default8000
Electrode pitch of HD-EMG grid presets (µm)--start-sec <START_SEC>: default0
Start of the part to process (s)--duration-sec <DURATION_SEC>
Length of the part to process (s); default: to the end-o, --output <OUTPUT>
Output folder or store--format <FORMAT>
Output format; default: from the name (.nwb.zarr→ nwb, other.zarr→ zarr, else phy)phy: Phy / Kilosort folder (.npyarrays,.tsvtables)zarr: dspk.sorting.zarrstorenwb: NWB/unitstable in a.nwb.zarrstore
--templates <TEMPLATES>
Predefined universal templates (.npzwithwPCA,wTEMP) when –templates-from-data false--show-config
Print every setting of the run and exit--nt <NT>: default61
Samples per waveform (odd); 61 is 2 ms at 30 kHz--nt-ms <NT_MS>
Waveform length in ms (overrides –nt: rounded to an odd sample count for the recording)--nt0min <NT0MIN>
Sample a waveform’s trough is aligned to; default: int(20 · nt / 61)--th-universal <TH_UNIVERSAL>: default10
Universal-template detection threshold (whitened σ)--th-learned <TH_LEARNED>: default9
Learned-template matching threshold (whitened σ)--th-single-ch <TH_SINGLE_CH>: default6
Single-channel thresholds of the clips templates are learned from (whitened σ), comma-separated--templates-from-data <TEMPLATES_FROM_DATA>: defaulttrue, one oftrue,false
Learn the universal templates from the recording (false: Kilosort4’s predefined ones, from –templates or downloaded through dspk-hub)--n-templates <N_TEMPLATES>: default6
Universal templates learned--n-pcs <N_PCS>: default6
Principal components per channel--nskip <NSKIP>: default25
Every nskip-th batch is used for template learning--do-car <DO_CAR>: defaulttrue, one oftrue,false
Common average reference before filtering--do-bandpass <DO_BANDPASS>: defaulttrue, one oftrue,false
Butterworth band-pass (order 3 per edge, zero phase); false: no Butterworth--bandpass-low-hz <BANDPASS_LOW_HZ>: default300
Lower band edge (Hz)--bandpass-high-hz <BANDPASS_HIGH_HZ>: default6000
Upper band edge (Hz), below Nyquist; 0: no upper edge (a high-pass)--do-notch <DO_NOTCH>: defaultfalse, one oftrue,false
Line-noise notch after the band--notch-hz <NOTCH_HZ>: default60
Notch frequency (Hz; 50 outside the Americas)--notch-q <NOTCH_Q>: default30
Quality factor of the notch (bandwidth = notch / Q)--whitening-range <WHITENING_RANGE>: default32
Channels in each local whitening neighbourhood--batch-size <BATCH_SIZE>: default60000
Samples per batch--max-peels <MAX_PEELS>: default50
Matching-pursuit rounds per window--global-merges <GLOBAL_MERGES>: defaulttrue, one oftrue,false
Merge units whose waveforms are alike and whose spikes are mutually refractory--merge-similarity <MERGE_SIMILARITY>: default0.5
Waveform similarity (correlation over lags) a pair needs to be tested for a merge--duplicate-spike-ms <DUPLICATE_SPIKE_MS>: default0.25
A unit’s spikes within this many ms of its previous spike are removed (0 keeps them)--reproducible <REPRODUCIBLE>: defaulttrue, one oftrue,false
Same input on the same device gives the same spikes