Skip to content

dspk detect

Detect spikes in a whole recording and write them as a sorting (one unit per channel)

dspk detect [OPTIONS] --output <OUTPUT> <RECORDING>

Arguments

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

Options

  • --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
  • --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
  • --car <CAR>: default true, one of true, false
    Common average reference before filtering
  • --band-low-hz <BAND_LOW_HZ>: default 300
    Band-pass low edge (Hz)
  • --band-high-hz <BAND_HIGH_HZ>: default 5000
    Band-pass high edge (Hz); must be below Nyquist
  • --threshold <THRESHOLD>: default 5
    Threshold in multiples of each channel’s noise σ (MAD)
  • --refractory-ms <REFRACTORY_MS>: default 1
    Smallest interval between two spikes on a channel (ms)
  • --polarity <POLARITY>: default negative, one of negative, positive, both
    Which extrema are spikes
  • --spacing <SPACING>
    Which of two nearer crossings stays
    • locally-exclusive: A crossing stays unless a larger one is nearer (streaming equals whole-recording detection)
    • scipy: As scipy.signal.find_peaks(distance=…) (may differ at batch edges)
  • --radius-um <RADIUS_UM>: default 150
    Crossings within this radius (and the refractory window) are one spike (µm)
  • --k-neighbors <K_NEIGHBORS>: default 4
    Channels per waveform snippet (the primary and its nearest)
  • --pre-ms <PRE_MS>: default 1
    Snippet window before the trough (ms)
  • --post-ms <POST_MS>: default 2
    Snippet window after the trough (ms)
  • --sinc-shift <SINC_SHIFT>: default true, one of true, false
    Realign snippets to the sub-sample trough
  • --locate <LOCATE>: default true, one of true, false
    Locate every spike (centre of mass of its snippet’s heights over its neighbours)
  • --batch-sec <BATCH_SEC>: default 10
    Length of each processing window (s); memory only, not results
  • --calibration-sec <CALIBRATION_SEC>: default 5
    Total length of the noise calibration (s)
  • --calibration-chunks <CALIBRATION_CHUNKS>: default 5
    Chunks the noise calibration is spread over