Skip to contents

Reading a model

Everything except convertReactions() works in two phases: read the file once, then query the pointer that comes back.

getModel()
Read an SBML model

Querying components

These return R objects. Note that a query for a component the model does not have raises an error rather than returning an empty result.

getSpeciesTable()
Table of the species in a model
getParameterTable()
Table of the parameters in a model
getReactionTable()
Table of the reactions in a model
getSpeciesNames()
Names of the species in a model
getSpeciesIC()
Initial values of the species in a model
getNumSpecies()
Number of species in a model
getCmtNames()
Names of the compartments in a model
getCmtSizes()
Sizes of the compartments in a model

Printing the mathematics

These write to the console and return 0 invisibly, so capture them with capture.output() rather than assigning them.

getRuleMath()
Print the rules of a model
getReactionMath()
Print the rate laws of a model
getFunctionDefinition()
Print the function definitions of a model
getEventMath()
Print the events of a model

Printing the document

The exception to the two-phase rule: these take a filename, not a model pointer.

printSBML()
Summarise an SBML file
echoSBML()
Check an SBML file for errors

Exporting mass balances

Writes ready-to-simulate code for one of six ODE targets. Reads the SBML file itself, so it takes no model pointer.

convertReactions()
Convert an SBML model to simulation code