This PR implements support for heavy isotopes as requested in #53 (resolves #53). Unfortunately it increase the complexity of some functions namely .load_isotopes() (added some additional sorting steps), countElements() (test for valid isotopes/element names) and .pasteElements (additional gsub call to surround heavy isotopes with brackets).
library("MetaboCoreUtils")
countElements(c("C6H12O6", "[13C3]C3H12O6"))
#> $C6H12O6
#> C H O
#> 6 12 6
#>
#> $`[13C3]C3H12O6`
#> 13C C H O
#> 3 3 12 6
standardizeFormula("O6[13C3]H12C3")
#> O6[13C3]H12C3
#> "[13C3]C3H12O6"
calculateMass(c("C6H12O6", "[13C3]C3H12O6"))
#> C6H12O6 [13C3]C3H12O6
#> 180.0634 183.0735
This PR implements support for heavy isotopes as requested in #53 (resolves #53). Unfortunately it increase the complexity of some functions namely
.load_isotopes()
(added some additional sorting steps),countElements()
(test for valid isotopes/element names) and.pasteElements
(additionalgsub
call to surround heavy isotopes with brackets).Created on 2022-03-11 by the reprex package (v2.0.1)
EDIT: All isotopes listed in isotope_definition.txt are supported.