Skip to contents

Exhaustive molecular formula generation for a specified molecular mass.

Usage

generateMF(
  mass,
  ppm = 1,
  charge = 0,
  element_ranges = suitableElementRanges(mass)
)

Arguments

mass

molecular mass

ppm

parts per million error tolerance

charge

total charge

element_ranges

named list of element ranges

Value

A tibble containing the generated molecular formulas, their theoretical mass and their PPM error.

Examples

generateMF(342.11621,
           element_ranges = list(C = c(0,12),
                                 H = c(0,22),
                                 O = c(0,11)))
#> # A tibble: 1 × 3
#>   MF         Mass `PPM error`
#>   <chr>     <dbl>       <dbl>
#> 1 C12H22O11  342.           0