Learn R Programming

minval (version 0.4)

chebi.formula: Returns the molecular formula associated to a ChEBI compound name

Description

This function takes a compound or a set of compounds names as an input and returns a list with molecular formulas.

Usage

chebi.formula(metabolite)

Arguments

metabolite
A compound or a set of compounds names

Examples

Run this code
## For a specific metabolite
chebi.formula("ATP")
# [1] "C10H16N5O13P3"

## For a set of metabolites
mets<-metabolites(glugln[1:3],woCompartment = TRUE)
sapply(mets,chebi.formula,simplify = FALSE)

# $`alpha-D-glucose 1-phosphate`
# [1] "C6H13O9P"

# $`alpha-D-Glucose 6-phosphate`
# [1] "C6H13O9P"

# $water
# [1] "H2O"

# $ATP
# [1] "C10H16N5O13P3"

# $`alpha-D-Glucose`
# [1] "C6H12O6"

# $ADP
# [1] "C10H15N5O10P2"

# $`phosphate(3-)`
# [1] "O4P"

Run the code above in your browser using DataLab