Get chemical formula for mass to charge ratio using the HORIZON algorithm
Source:R/io.R
getformula.RdRapidly decomposes accurate mass-to-charge ratios into candidate chemical formulas using the native HORIZON (Heavy-first Ordered Recursive Inference with Zero-loop Optimal Navigation) engine. Supports chemical plausibility filtering via Double Bond Equivalents (DBE), Nitrogen rule, and Kind & Fiehn Seven Golden Rules.
Arguments
- mz
a vector with mass to charge ratio
- charge
The charge value of the formula, default 0 for autodetect
- window
The window accuracy in the same units as mass
- elements
Elements list to take into account.
- golden_rules
logical, whether to filter by Fiehn Seven Golden Rules (default: TRUE)
- detailed
logical, if TRUE return a list of data.frames with formula, exact mass, error, DBE, H/C ratio, Senior rules, and validation details; if FALSE (default), return a list of character vectors of valid formulas
- resolution
numeric, mass spectrometer resolving power for isotope peak merging (default: 0)
- nthreads
integer, number of OpenMP parallel threads for batch processing (default: 1)