to.limits.rcdk: Convert formula to Rcdk limits

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/formulaCalculator.R

Description

Converts a molecular formula e.g. C15H20 into an upper limit appropriate for use with Rcdk's generate.formula function's element argument.

Usage

1

Arguments

formula

A molecular formula in string or list representation ("C6H6" or list(C=6,H=6)).

Details

This helper function is used to make the upper limits for generate.formula when finding subformulas to match to a MS2 fragment peak.

Value

An array in the form c( c("C", "0", "12"), c("H", "0", "12")) (for input of "C12H12").

Author(s)

Michael Stravs

See Also

generate.formula, add.formula

Examples

1
2
3
#
to.limits.rcdk("C6H6")
to.limits.rcdk(add.formula("C6H12O6", "H"))

sneumann/RMassBank documentation built on Oct. 20, 2020, 3:19 p.m.