
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.
Usage
BuildMZAnnotationIndex(
db,
polarity = NULL,
adducts = NULL,
rules = NULL,
maldi_matrix = NULL,
collapse_isomers = TRUE
)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.