adductFormula | R Documentation |
adductFormula
calculates the chemical formulas for the specified adducts
of provided chemical formulas.
adductFormula(formulas, adduct = "[M+H]+", standardize = TRUE)
formulas |
|
adduct |
|
standardize |
|
character
matrix with formula rows and adducts columns
containing all ion formulas. In case an ion can't be generated (eg.
[M-NH3+H]+ in a molecule that doesn't have nitrogen), a NA is returned
instead.
Roger Gine
adductNames()
for a list of all available predefined adducts and
adducts()
for the adduct data.frame
definition style.
# Calculate the ion formulas of glucose with adducts [M+H]+, [M+Na]+ and [M+K]+
adductFormula("C6H12O6", c("[M+H]+", "[M+Na]+", "[M+K]+"))
# > "[C6H13O6]+" "[C6H12O6Na]+" "[C6H12O6K]+"
# Use a custom set of adduct definitions (For instance, a iron (Fe2+) adduct)
custom_ads <- data.frame(name = "[M+Fe]2+", mass_multi = 0.5, charge = 2,
formula_add = "Fe", formula_sub = "C0",
positive = "TRUE")
adductFormula("C6H12O6", custom_ads)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.