mz_calculate: Calculate the exact mass or m/_z_ of a molecule

Description Usage Arguments Value Examples

View source: R/mz_calculate.R

Description

mz_calculate returns the exact mass of a molecule based on the molecular formula or it will return the expected m/z based on the gain or loss of a proton if provided an argument for scan polarity. Other adducts should be specifically annotated in the molecular formula.

Usage

1
mz_calculate(molecule, polarity = "neutral")

Arguments

molecule

A string containing a molecular formula (e.g., "C2H7NO3S"). Structural formulas containing parentheses are not acceptable. Charges may be included, but the charge count should follow the sign (e.g., "C10H16N5O13P3-3").

polarity

Type of m/z to return. Accepts one of "neutral", which returns the monoisotopic mass; "positive", which returns the [M+H]+ mass; or "negative", which returns the [M-H]- mass.

Value

A numeric vector length 1.

Examples

1
2
3
mz_calculate("C5H8O5-")
mz_calculate("C2H7NO3S")
mz_calculate("C10H16N5O13P3-3")

wmoldham/mzrtools documentation built on Oct. 26, 2020, 2:40 p.m.