Skip to contents

Annotate TRACE seed network candidates and finalize TRACE result

Usage

TRACE_annotate(
  object,
  i.pol,
  cpdb = "d:/data/2025.12.26.PAVE2/trace.cp.db.xlsx",
  pave_like = FALSE,
  rt_tol_lib = 60
)

Arguments

object

MSdev object.

i.pol

Polarity index. `0` for negative and `1` for positive.

cpdb

Path to compound table xlsx used for candidate assignment.

pave_like

Logical. If `TRUE`, assign library hits like PAVE: prefer the protonated adduct (`[M-H]-` / `[M+H]+`), score candidates by RT without requiring agreement with MS-network adduct edges, and inherit seed-metabolite library assignments for adduct nodes with no hits at their own m/z.

rt_tol_lib

RT tolerance in seconds for matching cpdb library entries. Candidates with |feature_rt - compound_rt| > rt_tol_lib are excluded before assignment. Use Inf for no RT cutoff.

Value

Updated MSdev object with `object@advancedAna$TRACE[[pol]]`, including `TRACE_cor`, `TRACE_net_score`, `TRACE_anno_score`, `TRACE_fragment`, and `TRACE_isotope` columns when available.