Learn R Programming

MetaDBparse (version 2.0.0)

getFormula: Find possible formulas for a given m/z

Description

Using m/z and isotope distributions for each element, find possible molecular formulas within allowed error margin

Usage

getFormula(
  mz,
  add_name,
  adducts,
  ppm,
  elements = c("C", "H", "N", "O", "P", "S")
)

Arguments

mz

M/z of interest

add_name

Which adducts to consider

adducts

Full adduct table (data(adducts) loads it into memory)

ppm

Allowed error margin in parts per million

elements

Considered elements in formula generation, Default: c("C", "H", "N", "O", "P", "S")

Value

Table with found formulas, their adduct and isotope percentage.

See Also

str_match initializeCHNOPS

Examples

Run this code
# NOT RUN {
getFormula(170, "[M+H]1+", adducts, 3)
# }

Run the code above in your browser using DataLab