Skip to content

EMUsort settings

EMUsort (O’Connell et al. 2026): high-density intramuscular arrays, motor units

dspk sort emusort [OPTIONS] --output <OUTPUT> <RECORDING>

Arguments

  • <RECORDING>
    Recording (SpikeGLX .bin / .cbin, raw .bin + JSON .meta, NWB, Zarr)

Settings

  • --source <SOURCE>
    Source within the file (an id dspk-cli open lists); default: the largest electrical one
  • --probe <PROBE>: one of neuropixels1, 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>: default bar, one of bar, json
    How progress is reported: bar (on stderr) or json (one JSON object per line on stdout: progress events, then done or error; for programs running this one)
  • --channel-map <CHANNEL_MAP>
    Channel map (.toml / .json, pairs under remap) applied after the probe: channels reordered, dropped, renamed; the geometry follows them
  • --pitch-um <PITCH_UM>: default 8000
    Electrode pitch of HD-EMG grid presets (µm)
  • --start-sec <START_SEC>: default 0
    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 (.npy arrays, .tsv tables)
    • zarr: dspk .sorting.zarr store
    • nwb: NWB /units table in a .nwb.zarr store
  • --templates <TEMPLATES>
    Predefined universal templates (.npz with wPCA, wTEMP) when –templates-from-data false
  • --show-config
    Print every setting of the run and exit
  • --nt <NT>: default 61
    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>: default 9
    Universal-template detection threshold (whitened σ)
  • --th-learned <TH_LEARNED>: default 8
    Learned-template matching threshold (whitened σ)
  • --th-single-ch <TH_SINGLE_CH>: default 6 9 12 15
    Single-channel thresholds of the clips templates are learned from (whitened σ), comma-separated
  • --templates-from-data <TEMPLATES_FROM_DATA>: default true, one of true, false
    Learn the universal templates from the recording (false: Kilosort4’s predefined ones, from –templates or downloaded through dspk-hub)
  • --n-templates <N_TEMPLATES>: default 9
    Universal templates learned
  • --n-pcs <N_PCS>: default 9
    Principal components per channel
  • --nskip <NSKIP>: default 2
    Every nskip-th batch is used for template learning
  • --do-car <DO_CAR>: default false, one of true, false
    Common average reference before filtering
  • --do-bandpass <DO_BANDPASS>: default true, one of true, false
    Butterworth band-pass (order 3 per edge, zero phase); false: no Butterworth
  • --bandpass-low-hz <BANDPASS_LOW_HZ>: default 300
    Lower band edge (Hz)
  • --bandpass-high-hz <BANDPASS_HIGH_HZ>: default 5000
    Upper band edge (Hz), below Nyquist; 0: no upper edge (a high-pass)
  • --do-notch <DO_NOTCH>: default false, one of true, false
    Line-noise notch after the band
  • --notch-hz <NOTCH_HZ>: default 60
    Notch frequency (Hz; 50 outside the Americas)
  • --notch-q <NOTCH_Q>: default 30
    Quality factor of the notch (bandwidth = notch / Q)
  • --whitening-range <WHITENING_RANGE>: default 32
    Channels in each local whitening neighbourhood
  • --batch-size <BATCH_SIZE>: default 60000
    Samples per batch
  • --max-peels <MAX_PEELS>: default 50
    Matching-pursuit rounds per window
  • --global-merges <GLOBAL_MERGES>: default true, one of true, false
    Merge units whose waveforms are alike and whose spikes are mutually refractory
  • --merge-similarity <MERGE_SIMILARITY>: default 0.5
    Waveform similarity (correlation over lags) a pair needs to be tested for a merge
  • --duplicate-spike-ms <DUPLICATE_SPIKE_MS>: default 0.25
    A unit’s spikes within this many ms of its previous spike are removed (0 keeps them)
  • --reproducible <REPRODUCIBLE>: default true, one of true, false
    Same input on the same device gives the same spikes
  • --remove-channel-delays <REMOVE_CHANNEL_DELAYS>: default true, one of true, false
    Estimate and remove per-channel delays (up to 2 ms)
  • --remove-spike-outliers <REMOVE_SPIKE_OUTLIERS>: default true, one of true, false
    Remove outlier clips (HDBSCAN) before learning the universal templates
  • --hdbscan-min-cluster-size <HDBSCAN_MIN_CLUSTER_SIZE>: default 20
    HDBSCAN min_cluster_size of the outlier removal