Last chance! 50% off unlimited learning
Sale ends in
The eqnlist object stores an ODE as a list of stoichiometric matrix, rate expressions, state names and compartment volumes.
Translates a reaction network, e.g. defined by a data.frame, into an equation list object.
eqnlist(smatrix = NULL, states = colnames(smatrix), rates = NULL,
volumes = NULL, description = NULL)as.eqnlist(data, volumes)
# S3 method for data.frame
as.eqnlist(data, volumes = NULL)
is.eqnlist(x)
Matrix of class numeric. The stoichiometric matrix, one row per reaction/process and one column per state.
Character vector. Names of the states.
Character vector. The rate expressions.
Named character, volume parameters for states. Names must be a subset of the states.
Values can be either characters, e.g. "V1", or numeric values for the volume. If volumes
is not
NULL
, missing entries are treated as 1.
Character vector. Description of the single processes.
data.frame with columns Description, Rate, and one colum for each state reflecting the stoichiometric matrix
object of class eqnlist
additional arguments to be passed to or from methods.
An object of class eqnlist
, basically a list.
Object of class eqnlist
If data
is a data.frame
, it must contain columns "Description" (character),
"Rate" (character), and one column per ODE state with the state names.
The state columns correspond to the stoichiometric matrix.
# NOT RUN {
# Generate eqnlist from the constructor
S <- matrix(c(-1, 1, 1, -1),
nrow = 2, ncol = 2,
dimnames = list(NULL, c("A", "B")))
rates <- c("k1*A", "k2*B")
description <- c("forward", "backward")
f <- eqnlist(smatrix = S, rates = rates, description = description)
print(f)
# Convert to data.frame
fdata <- as.data.frame(f)
print(fdata)
# Generate eqnlist from data.frame and add volume parameter
f <- as.eqnlist(fdata, volumes = c(A = "Vcyt", B = "Vnuc"))
print(f)
print(as.eqnvec(f))
print(as.eqnvec(f, type = "amount"))
# }
Run the code above in your browser using DataLab