| HRMF | R Documentation |
Performs high-resolution mass filtering by matching experimental mass spectral peaks against theoretical isotope patterns derived from one or more candidate chemical formulae. Calculates forward HRMF score, reverse (MSP) score, and Figure of Merit (FoM) for each candidate.
HRMF(
msp,
formula,
charge = 1,
adduct = NULL,
mass_accuracy = 5,
intensity_cutoff = 1,
IR_RelAb_cutoff = 1,
detailed = FALSE
)
msp |
list. A single compound entry as returned by |
formula |
character vector. One or more candidate chemical formulae to evaluate. |
charge |
integer. Charge state: 1 for positive, -1 for negative, 0 for neutral.
Default 1 (radical cation in EI). Ignored when |
adduct |
character vector of adduct names for singly-charged ESI ions
(e.g. |
mass_accuracy |
numeric. Mass accuracy in ppm. Default 5. |
intensity_cutoff |
numeric. Minimum absolute intensity to retain a peak. Default 1. |
IR_RelAb_cutoff |
numeric. Relative abundance cutoff (%) for theoretical isotopologues. Default 1. |
detailed |
logical. If TRUE, return detailed list with all_ions, compound, and HRMF_scores for each formula. If FALSE (default), return a summary data.frame. |
The method is based on Kwiecien et al. (2015) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1021/acs.analchem.5b01503")}.
Unlike the original MSxplorer implementation, this version uses Rdisop (already a dependency of enviGCMS) for both formula decomposition and isotope pattern calculation, instead of rcdk/rJava/enviPat, requiring no additional dependencies.
The input msp should be a single entry from the list returned by
getMSP. For batch processing of entire MSP files, see
getHRMF.
For EI (GC-MS) radical ions use the default charge argument. For
ESI (LC-MS/MS) data with even-electron adduct ions such as [M+H]+ or [M-H]-,
supply adduct so that fragment m/z values are converted internally;
the adduct should describe how fragment ions are formed (usually the same
as the precursor adduct for singly-charged fragmentation).
If detailed = FALSE, a data.frame with one row per candidate
formula (and per adduct, if supplied) and columns: Candidate, Adduct,
peak_count_forw, df_theortomsp, HRMF_theor_score, peak_count_rev,
df_msptotheor, HRMF_msp_score, FoM.
If detailed = TRUE, a named list of detailed results per formula/adduct.
getHRMF for batch processing, getMSP for
reading MSP files.
## Not run:
# Read MSP file and run HRMF on the first compound (EI radical cation)
msp_data <- getMSP("spectrum.msp")
result <- HRMF(msp_data[[1]], formula = "C8H11NO")
# Compare multiple candidates
result <- HRMF(msp_data[[1]], formula = c("C8H11NO", "C7H9NO2"))
# LC-MS/MS with protonated fragments
result <- HRMF(msp_data[[1]], formula = "C8H10N4O2", adduct = "[M+H]+")
# Multiple candidate adducts are scored separately
result <- HRMF(msp_data[[1]], formula = "C8H10N4O2",
adduct = c("[M+H]+", "[M+Na]+"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.