Nothing
#' @title get_exactmass.
#'
#' @description Get the exact mass for chemical formulas.
#'
#' @param x Vector of chemical formulas.
#'
#' @return A named vector of exact masses.
#'
#' @export
#'
#' @examples
#' InterpretMSSpectrum:::get_exactmass(c("C6H12O6", "Na", "H1"))
#'
get_exactmass <- function(x) {
ce <- InterpretMSSpectrum::chemical_elements
ce <- stats::setNames(ce$mass,ce$name)
sapply(x, function(fml) {
fml <- CountChemicalElements(x = fml)
return(sum(ce[names(fml)]*fml))
})
}
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.