Calculate mass and isotope information for a molecule given as sum formula
Source:R/getMolecule.R
getMolecule.Rd
Parse the sum formula and calculate the theoretical exact mass and the isotope distribution for an approximate MS resolution of 20,000 (i.e. not providing the isotopic fine structure).
Usage
getMolecule(formula, elements = NULL, z = 0, maxisotopes = 10)
getMass(molecule)
getMonoisotopic(molecule)
getIsotope(molecule, index)
getFormula(molecule)
getScore(molecule)
getValid(molecule)
Arguments
- formula
Sum formula.
- elements
List of allowed chemical elements, defaults to full periodic system of elements. See
initializeElements
.- z
Charge z of molecule for exact mass calculation.
- maxisotopes
Maximum number of isotopes shown for the resulting molecule.
- molecule
An initialized molecule as returned by getMolecule() or the decomposeMass() and decomposeIsotope() functions.
- index
Return the n-th isotope mass/abundance pair(s) of the molecule
Value
A list containing the elements `formula` (repeated sum formula), `mass` exact mass of molecule, `score` probability, for given molecules a dummy value which is always 1.0, `valid` result of neutrogen rule check, `isotopes` a list of isotope masses and abundances.
Details
getMolecule()
will parse the sum formula and calculate the
exact mass and the isotope distribution.
The exact mass is the mass of the most abundant isotope and is not
identical with the monoisotopic mass. The latter can be extracted using
the function `getMonoisotopic()`. This function can also be supplied with
a vector of chemical formulas directly (in case that the isotopic
distribution is of no interest).
Since of version 1-65-3, if a charge is specified, the exact mass of the
molecule will be reduced or increased by n-times the electron mass
(depending on the sign). Also, isotopic masses will additionally be
divided by the charge specified to reflect what would be measured in HR-MS.
Examples
# Ethanol
getMolecule("C2H6O")
#> $formula
#> [1] "C2H6O"
#>
#> $score
#> [1] 1
#>
#> $exactmass
#> [1] 46.04186
#>
#> $charge
#> [1] 0
#>
#> $parity
#> [1] "e"
#>
#> $valid
#> [1] "Valid"
#>
#> $DBE
#> [1] 0
#>
#> $isotopes
#> $isotopes[[1]]
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 46.0418648 47.04534542 48.04631711 4.904960e+01 5.005324e+01 5.105929e+01
#> [2,] 0.9749152 0.02293559 0.00210353 4.540559e-05 2.816635e-07 2.324709e-10
#> [,7] [,8] [,9] [,10]
#> [1,] 5.206548e+01 5.307171e+01 5.407796e+01 5.508422e+01
#> [2,] 8.458096e-14 1.665930e-17 1.857005e-21 1.107409e-25
#>
#>