# For a stoichiometric reaction
reaction <- "ADP[c_n] + Phosphoenolpyruvate[c_n] => ATP[c_n] + Pyruvate[c_n]"
# Extract the products
reactants(reaction)
# [1] "ADP[c_n]"
# [2] "Phosphoenolpyruvate[c_n]"
# If stoichiometric reaction is reversible, function returns all metabolites
reactants("ADP[c_a] + ATP[m_a] <=> ADP[m_a] + ATP[c_a]")
# [1] "ADP[c_a]"
# [2] "ATP[m_a]"
# [3] "ADP[m_a]"
# [4] "ATP[c_a]"
Run the code above in your browser using DataLab