Learn R Programming

dMod (version 0.1)

generateEquations: Generate equations from data.frame(s)

Description

Generate equations from data.frame(s)

Usage

generateEquations(..., volumes = NULL)

Arguments

...
one or more data.frames with columns "Description" (character), "Rate" (character), and one column per ODE state with the state names. The state columns correspond to the stoichiometric matrix.
volumes
Named character, volume parameters for species. Names must be a subset of the species. Values can be either characters, e.g. "V1", or numeric values for the volume. If volumes is not NULL, missing species are treated like 1.

Value

  • An object of class eqnList, a named vector with the equations. Contains attributes "SMatrix" (the stoichiometric matrix), "species" (the state names), "rates" (the rate expressions) and "description".

Details

This function is supposed to translate a reaction network as being defined in a csv file into the raw equations.

Examples

Run this code
#######################################
# Example 1
#######################################
reactions <- data.frame(Description = c("Activation", "Deactivation"),
                        Rate = c("act*A", "deact*pA"), A=c(-1,1), pA=c(1, -1) )
f <- generateEquations(reactions)
f

#######################################
# Example 2
#######################################
reactions <- data.frame(Description = c("Activation", "Deactivation", "Production", "Degradation"),
                        Rate = c("act*A", "deact*pA", "prod", "degrad*pA"),
                        A=c(-1,1, 1, NA),
                        pA=c(1, -1, NA, -1))
volumes <- c(A = "V1", pA = "V2")
f <- generateEquations(reactions, volumes = volumes)
f[1:length(f)]

Run the code above in your browser using DataLab