makeLaw {SBMLR}R Documentation

Generate an R function for the reaction rate law

Description

This function creates an R function for a rate law given three arguments, the inputs variable, the parameters, and the rate law as an R expression.

Usage

makeLaw(r,p,e)

Arguments

r A vector of the reactant and modulator names.
p A named numeric vector of the function's local parameters.
e An R expression (i.e. nested calls and tokens) of the reaction rate law.

Value

An R function that returns the value of e given r and p, e.g. a rate law.

Note

This function is also used for rules with p=NULL. It is used by readSBML and readSBMLR.

Author(s)

Tomas Radivoyevitch (radivot@hal.cwru.edu)

Examples

library(SBMLR)  
curto=readSBMLR(file.path(system.file(package="SBMLR"), "models/curto.r"))  
curto$reactions[["ada"]]
e=curto$reactions[["ada"]]$exprLaw;e
r=curto$reactions[["ada"]]$reactants;r
m=curto$reactions[["ada"]]$modifiers;m
r=c(r,m)
p=curto$reactions[["ada"]]$parameters;p
makeLaw(r,p,e)

## compare to 

curto$reactions[["ada"]]$law

## indeed, above is how $law functions are now made, and in part why readSBMLR has replaced source.


[Package SBMLR version 1.36.0 Index]