Nothing
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' @title Calculate Exact Mass and Isotope Distribution using the HORIZON Engine
#' @description Computes exact monoisotopic mass, DBE, and theoretical isotopic pattern using the HORIZON engine.
#' @param formula Character string of the molecular formula (e.g. "C6H12O6", "H2O").
#' @param z Integer charge state (default: 0).
#' @param maxisotopes Maximum number of isotopic peaks to return (default: 10).
#' @param resolution Mass resolution (m / FWHM) for merging fine isotope peaks (default: 0).
#' @param fwhm Full width at half maximum in Da for isotope peak merging (default: 0).
#' @return A list compatible with Rdisop::getMolecule.
#' @keywords internal
rcpp_get_molecule <- function(formula, z = 0L, maxisotopes = 10L, resolution = 0.0, fwhm = 0.0) {
.Call(`_enviGCMS_rcpp_get_molecule`, formula, z, maxisotopes, resolution, fwhm)
}
#' @title Check Formula against Fiehn Seven Golden Rules
#' @description Tests molecular formula against Senior's valences, H/C ratio, heteroatom ratios, and DBE.
#' @param formula Character molecular formula string.
#' @param z Charge state (default: 0).
#' @param min_hc Minimum H/C ratio (default: 0.1).
#' @param max_hc Maximum H/C ratio (default: 6.0).
#' @param max_dbe Maximum DBE (default: 40.0).
#' @return A list with rule pass/fail booleans and summary details.
#' @keywords internal
rcpp_check_golden_rules <- function(formula, z = 0L, min_hc = 0.1, max_hc = 6.0, max_dbe = 40.0) {
.Call(`_enviGCMS_rcpp_check_golden_rules`, formula, z, min_hc, max_hc, max_dbe)
}
#' @title Calculate Isotopic Pattern Similarity Scores
#' @description Computes cosine similarity, weighted dot product, and log-likelihood
#' between experimental peaks and theoretical isotopic distribution.
#' @param obs_mz Numeric vector of observed m/z values.
#' @param obs_int Numeric vector of observed peak intensities.
#' @param theo_mz Numeric vector of theoretical isotopic m/z values.
#' @param theo_int Numeric vector of theoretical isotopic abundances.
#' @param tolerance Mass matching tolerance (default: 0.005 Da or 10 ppm).
#' @param ppm Logical indicating if tolerance is in ppm (default: FALSE).
#' @return A list containing cosine score, weighted cosine score, log-likelihood,
#' and matching details.
#' @keywords internal
rcpp_score_isotopes <- function(obs_mz, obs_int, theo_mz, theo_int, tolerance = 0.005, ppm = FALSE) {
.Call(`_enviGCMS_rcpp_score_isotopes`, obs_mz, obs_int, theo_mz, theo_int, tolerance, ppm)
}
#' @title Decompose Mass into Candidate Chemical Formulas using the HORIZON Algorithm
#' @description Finds all combinations of elements matching a mass within given error bounds using the HORIZON (Heavy-first Ordered Recursive Inference with Zero-loop Optimal Navigation) algorithm.
#' @param mass Target mass or m/z value.
#' @param ppm Tolerance in ppm (default: 2.0).
#' @param mzabs Absolute mass deviation in Da (default: 0.0001).
#' @param elements Allowed chemical elements (string or vector).
#' @param minElements Lower bounds on elements (e.g. "C0H0", "C1").
#' @param maxElements Upper bounds on elements (e.g. "C50H50").
#' @param z Charge state (default: 0).
#' @param maxisotopes Maximum number of isotopes to compute (default: 10).
#' @param golden_rules Whether to apply Fiehn Seven Golden Rules (default: TRUE).
#' @param resolution Mass resolution for isotope merging (default: 0).
#' @param fwhm Full width at half maximum in Da for isotope peak merging (default: 0).
#' @return A list compatible with Rdisop::decomposeMass.
#' @keywords internal
rcpp_decompose_mass <- function(mass, ppm = 2.0, mzabs = 0.0001, elements = NULL, minElements = "", maxElements = "", z = 0L, maxisotopes = 10L, golden_rules = TRUE, resolution = 0.0, fwhm = 0.0) {
.Call(`_enviGCMS_rcpp_decompose_mass`, mass, ppm, mzabs, elements, minElements, maxElements, z, maxisotopes, golden_rules, resolution, fwhm)
}
#' @title Decompose a Vector of Masses in Parallel using the HORIZON Algorithm
#' @description Vectorized, multi-threaded chemical formula decomposition across thousands of masses using the HORIZON (Heavy-first Ordered Recursive Inference with Zero-loop Optimal Navigation) algorithm.
#' @param masses Numeric vector of target masses.
#' @param ppm Tolerance in ppm (default: 2.0).
#' @param mzabs Absolute mass deviation in Da (default: 0.0001).
#' @param elements Allowed chemical elements.
#' @param minElements Lower bounds on elements.
#' @param maxElements Upper bounds on elements.
#' @param z Charge state (default: 0).
#' @param maxisotopes Maximum number of isotopes to compute (default: 10).
#' @param golden_rules Whether to apply Fiehn Seven Golden Rules (default: TRUE).
#' @param resolution Mass resolution for isotope merging (default: 0).
#' @param fwhm Full width at half maximum in Da for isotope peak merging (default: 0).
#' @param nthreads Number of OpenMP threads to use (default: 1).
#' @return A list of decomposition results corresponding to each input mass.
#' @keywords internal
rcpp_decompose_masses <- function(masses, ppm = 2.0, mzabs = 0.0001, elements = NULL, minElements = "", maxElements = "", z = 0L, maxisotopes = 10L, golden_rules = TRUE, resolution = 0.0, fwhm = 0.0, nthreads = 1L) {
.Call(`_enviGCMS_rcpp_decompose_masses`, masses, ppm, mzabs, elements, minElements, maxElements, z, maxisotopes, golden_rules, resolution, fwhm, nthreads)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.