Last data update: 2014.03.03

R: Add reaction to reaction table
addReactionR Documentation

Add reaction to reaction table

Description

Add reaction to reaction table

Usage

addReaction(eqnlist, from, to, rate, description = names(rate))

Arguments

eqnlist

equation list, see eqnlist

from

character with the left hand side of the reaction, e.g. "2*A + B"

to

character with the right hand side of the reaction, e.g. "C + 2*D"

rate

character. The rate associated with the reaction. The name is employed as a description of the reaction.

description

Optional description instead of names(rate).

Value

An object of class eqnlist.

Examples

f <- eqnlist()
f <- addReaction(f, "2*A+B", "C + 2*D", "k1*B*A^2")
f <- addReaction(f, "C + A", "B + A", "k2*C*A")


## Generate another equation list
eq <- eqnlist()
eq <- addReaction(eq, "A", "pA", "act_A * A * stimulus", "Phosphorylation of A")
eq <- addReaction(eq, "pA", "A", "deact_A * pA", "Deposphorylation of pA")
eq <- addReaction(eq, "B", "pB", "act_B * B * pA", "Phosphorylation of B")
eq <- addReaction(eq, "pB", "B", "deact_B * pB", "Deposphorylation of pB")

## Extract data.frame of reactions
getReactions(eq)

## Get conserved quantities
conservedQuantities(eq$smatrix)

## Get fluxes
getFluxes(eq)

## Subsetting of equation list
subset(eq, "pB" %in% Product)
subset(eq, grepl("Phosphorylation", Description))

## Time derivatives of observables
observables <- eqnvec(pA_obs = "s1*pA", tA_obs = "s2*(A + pA)")
dobs <- dot(observables, eq)

## Combined equation vector for ODE and observables
f <- c(as.eqnvec(eq), dobs)
print(f)

Results