Reads an SBML Level 3 file. Requires rjson and reticulate, which
provides a Python with python-libsbml; set the environment variable
DMOD_LIBSBML_PYTHON to the path of a Python interpreter to use that one
instead. Kinetic laws are divided by the volume of their compartment.
Value
A list with components
reactionsThe model as an eqnlist.
parsNamed numeric, the parameter values.
initsNamed character, the initial value of each state.
observablesNamed list of observable formulas, possibly empty.
assignmentRulesNamed list of the formulas of the assignment rules and of the parameter initial assignments that
keepdoes not name, already substituted into rates, initial values and observables.eventsAn eventlist or
NULL, including the rescaling of states when an event changes a compartment volume.eventsSourceAn eventlist or
NULL, the event assignments of the SBML file only.renamedNamed character, the new ids of SBML ids that are no valid R or C++ names, named by the old ids.
Examples
f <- addReaction(eqnlist(), from = "A", to = "B", rate = "k1*A")
f <- addReaction(f, from = "B", to = "", rate = "k2*B")
file <- file.path(tempdir(), "model.xml")
exportSbml(f, parameters = c(k1 = 0.5, k2 = 0.1), inits = c(A = 1, B = 0),
filepath = file)
model <- importSbml(file)
model$reactions
#>
#> Check Educt -> Product Rate Description
#> 1 A -> B 1 * k1 * A 1
#> 2 B -> 1 * k2 * B 2
model$pars
#> k1 k2 defaultComp
#> 0.5 0.1 1.0