Skip to content

leaf targeted

Headless targeted extraction runs the same processing path as the Extract page without opening a browser. It writes a result CSV and, by default, a .msd archive for reopening in LEAF.

Synopsis

bash
leaf targeted INPUT_PATH COMPOUND_LIST OUTPUT_DIR [OPTIONS]

Required arguments

ArgumentDescription
INPUT_PATHA single .raw, .mzml, or .mzml.gz file, or a folder containing one supported format
COMPOUND_LISTPath to the metabolite CSV (see Prepare Data for the schema)
OUTPUT_DIRDirectory where LEAF writes result files

Common flags

FlagDefaultDescription
--polarity {NEG,POS}NEGMS polarity for mass calculation. Must match the acquisition.
--tolerance INT5m/z tolerance in ppm for EIC extraction.
--rt-window FLOAT0.3Retention-time search window in minutes.
--backend {auto,rust,dotnet}autoInput-file reader. rust uses SEED; dotnet uses Thermo's RawFileReader for .raw files.
--parallel / --no-paralleloffUse the .NET parallel extraction path when --backend dotnet is selected.
--max-workers INT4Parallel extraction threads.
--skip-blank / --no-skip-blankonSkip files whose name contains "blank".
--organize-name / --no-organize-nameonAuto-parse clean sample names from file names.
--tracing-path PATH(none)Path to a JSON tracing config (export from the web UI's Tracing Editor). See Isotope tracing.
--correct / --no-correctoffApply natural-abundance isotope correction after scoring.
--tracer ELEMENT:PURITY(none)Tracer element and purity for correction, repeatable. Example: --tracer 13C:0.99. Current correction allowlist: C, H, N.
--high-res / --low-reshigh-resHigh-resolution correction mode. Low-resolution mode is rejected in the current correction path.
--extract-ms2 / --no-extract-ms2onExtract MS² spectra when present. MS² extraction uses the SEED backend.
--save-extract / --no-save-extractonWrite the extracted .msd bundle.

For the full flag set, run leaf targeted --help.

Recipe — minimal targeted run

bash
leaf targeted ./samples ./compounds.csv ./outputs --polarity NEG --tolerance 5

Writes a result CSV and .msd archive into ./outputs. Use --no-save-extract only when the archive is not required.

Recipe — tracing run

bash
leaf targeted ./samples ./compounds.csv ./outputs \
  --polarity NEG --tolerance 5 \
  --tracing-path ./tracing-13C.json \
  --save-extract

The tracing JSON is produced by the web UI's Tracing Editor (Export button) or hand-written — see Isotope tracing.

Recipe — natural-abundance corrected tracing output

bash
leaf targeted ./samples ./compounds.csv ./outputs \
  --polarity NEG --tolerance 5 \
  --tracing-path ./tracing-13C.json \
  --correct --tracer 13C:0.99 \
  --save-extract

This writes the standard result CSV plus a corrected CSV. When correction is enabled, LEAF also saves an .msd archive carrying the tracer configuration.

Recipe — overriding the backend

bash
# Force the Thermo .NET reader on Windows when SEED cannot decode a file:
leaf targeted ./samples ./compounds.csv ./outputs --backend dotnet

Hidden alias

leaf analyze is a hidden alias for leaf targeted. New scripts should use the canonical name.

Next

Configuration — backend selection on disk

LEAF is developed by the Morscher Lab.