Skip to content

leaf watch

Real-time folder monitoring runs targeted extraction as new .raw, .mzml, or .mzml.gz files arrive in a folder. This is useful on acquisition computers where samples are written continuously.

Synopsis

bash
leaf watch run    FOLDER [OPTIONS]   # foreground
leaf watch start  FOLDER [OPTIONS]   # detached daemon
leaf watch stop                       # terminate the daemon
leaf watch status                     # show daemon state

Required argument

ArgumentDescription
FOLDERFolder to monitor for new .raw, .mzml, or .mzml.gz files

Common flags

FlagDefaultDescription
--list-path PATH(auto-discovered if omitted)Compound list CSV — same schema as leaf targeted.
-o, --output PATH(sibling of FOLDER)Where to write per-file .msd archives.
--polarity {NEG,POS}NEGMS polarity.
--tolerance INT5m/z tolerance in ppm.
--rt-window FLOAT0.3Retention-time search window.
--idle-timeout FLOAT60Stop watching after N minutes with no new files.
--poll-interval FLOAT10Seconds between filesystem polls.
--stability-time FLOAT10Wait N seconds after a file stops growing before processing (avoids partial reads).
--multi / --no-multioffWatch multiple sub-folders concurrently.

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

Recipe — foreground watch

bash
leaf watch run /path/to/inbox --list-path ./compounds.csv -o /path/to/outputs

Stops with Ctrl+C.

Recipe — daemon

bash
leaf watch start /path/to/inbox --list-path ./compounds.csv -o /path/to/outputs
leaf watch status
leaf watch stop

The daemon survives terminal close. Use leaf watch status to verify it is running and to see the last-processed file.

Legacy shim

leaf-watch is a console-script shim equivalent to leaf watch run.

Next

leaf targeted — same extraction pipeline, one-shot

LEAF is developed by the Morscher Lab.