R/subtract_proton.R

Defines functions subtract_proton

Documented in subtract_proton

#' subtract_proton
#'
#' This function subtracts the mass of a proton from a monoisotopic mass (e.g., from a protonated m/z value to obtain its neutral analogue).
#'
#' @param mass a numeric containing a monoisotopic mass
#'
#' @return a numeric containing the monoisotopic mass after proton subtraction
#' @export
#'
#' @examples
#' mz <- 414.9814                ## protonated PFOA with small error
#' subtract_proton(mz)
subtract_proton <- function(mass) {
  mass_proton <- 1.007277
  mass - mass_proton
}
robertyoung3/PFCdetective documentation built on June 5, 2020, 2:37 p.m.