
Build a reusable indexed metabolite annotation search space
Source:R/MZAnnotationEngine.R
BuildMZAnnotationIndex.RdExpected adduct m/z values are generated once, sorted, and queried by binary interval search. This is the one-dimensional equivalent of an interval tree and avoids scanning every database row for every observed peak.
Arguments
- db
Metabolite database. Both the legacy SpaMTP five-column/wide database and the RaMP
chem_propsschema are supported.- polarity
"positive","negative", or"neutral". WhenNULL, use the matrix-profile default, or positive mode when no profile is given.- adducts
Optional character vector of adduct names or bracketed notations. When
NULL, use the complete automatically selected rule space; this is a filter, not a compulsory input.- rules
Optional custom rule table. See
AdductRules().- maldi_matrix
Optional MALDI matrix or derivatization reagent profile. When supplied and
rulesisNULL,MALDIMatrixRules()automatically selects standard and validated matrix-specific rules.adductsremains an optional filter on that selected rule space.- collapse_isomers
Collapse records sharing formula, exact mass, and proton bound before indexing.
- infer_structure
"auto"joins bundled precomputed features or derives them for at mostgetOption("SpaMTP.max_runtime_smiles", 5000)unique SMILES,"never"disables inference, and"always"forces runtime parsing and replaces precomputed structural fields.- structure_backend
SMILES parser used by
DeconvolveSMILES().- structure_workers
Number of workers used for runtime SMILES parsing.
- min_structure_score
Minimum rule-specific structural prior retained before m/z indexing. Set to zero to rank without structure-based pruning.
Examples
utils::str(formals(BuildMZAnnotationIndex))
#> Dotted pair list of 10
#> $ db : symbol
#> $ polarity : NULL
#> $ adducts : NULL
#> $ rules : NULL
#> $ maldi_matrix : NULL
#> $ collapse_isomers : logi TRUE
#> $ infer_structure : language c("auto", "never", "always")
#> $ structure_backend : language c("auto", "native")
#> $ structure_workers : language getOption("SpaMTP.smiles_workers", 1L)
#> $ min_structure_score: num 0.05