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
| Argument | Description |
|---|---|
INPUT_PATH | A single .raw, .mzml, or .mzml.gz file, or a folder containing one supported format |
COMPOUND_LIST | Path to the metabolite CSV (see Prepare Data for the schema) |
OUTPUT_DIR | Directory where LEAF writes result files |
Common flags
| Flag | Default | Description |
|---|---|---|
--polarity {NEG,POS} | NEG | MS polarity for mass calculation. Must match the acquisition. |
--tolerance INT | 5 | m/z tolerance in ppm for EIC extraction. |
--rt-window FLOAT | 0.3 | Retention-time search window in minutes. |
--backend {auto,rust,dotnet} | auto | Input-file reader. rust uses SEED; dotnet uses Thermo's RawFileReader for .raw files. |
--parallel / --no-parallel | off | Use the .NET parallel extraction path when --backend dotnet is selected. |
--max-workers INT | 4 | Parallel extraction threads. |
--skip-blank / --no-skip-blank | on | Skip files whose name contains "blank". |
--organize-name / --no-organize-name | on | Auto-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-correct | off | Apply 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-res | high-res | High-resolution correction mode. Low-resolution mode is rejected in the current correction path. |
--extract-ms2 / --no-extract-ms2 | on | Extract MS² spectra when present. MS² extraction uses the SEED backend. |
--save-extract / --no-save-extract | on | Write 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 5Writes 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-extractThe 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-extractThis 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 dotnetHidden alias
leaf analyze is a hidden alias for leaf targeted. New scripts should use the canonical name.
Next
→ Configuration — backend selection on disk