getstoichmatrix
Get stoichiometry matrix from model object
The order of species in the output arguments (M and
objSpecies) matches the order of species returned by
modelObj.Species.
Syntax
M = getstoichmatrix(modelObj)
[M,objSpecies]
= getstoichmatrix(modelObj)
[M,objSpecies,objReactions]
= getstoichmatrix(modelObj)
Arguments
M | Stoichiometry matrix for
. |
| Specify the model
object. |
| Return the list of
If the species are in multiple
compartments, species names are qualified with the compartment
name in the form |
| Return the list of
reactions
by the Name property of reactions. |
Description
getstoichmatrix returns a stoichiometry matrix for a model
object.
returns a stoichiometry matrix for a SimBiology® model object (M = getstoichmatrix(modelObj)) to
modelObj.M
A stoichiometry matrix is defined by listing all reactions contained by
column-wise and all
species contained by modelObj row-wise in
a matrix. The species of the reaction are represented in the matrix with the
stoichiometric value at the location of [row of species, column of reaction]. Reactants
have negative values. Products have positive values. All other locations in the matrix
are 0.modelObj
For example, if is a model
object with two reactions with names modelObjR1 and R2 and
Reaction values of 2 A + B -> 3 C and B + 3 D -> 4
A, the stoichiometry matrix would be defined as:
R1 R2 A -2 4 B -1 -1 C 3 0 D 0 -3
[ returns the stoichiometry
matrix to M,objSpecies]
= getstoichmatrix(modelObj) and the species to
M.
objSpecies is defined by listing
all objSpeciesName property values of species contained by
. In the above example,
Obj would be objSpecies{'A',
'B', 'C', 'D'};.
[ returns the stoichiometry
matrix to M,objSpecies,objReactions]
= getstoichmatrix(modelObj) and the reactions to
M.
objReactions is defined by listing
all objReactionsName property values of reactions contained by
. In the above example,
modelObj would be
objReactions{'R1', 'R2'}.
Examples
Get Stoichiometry Matrix of SimBiology Model
Load the lotka model.
m1 = sbmlimport('lotka.xml');Get the stoichiometry matrix of the model.
[M,objSpecies,objReactions] = getstoichmatrix(m1)
M = 4×3 sparse double matrix (5 nonzeros)
(2,1) 1
(2,2) -1
(3,2) 1
(3,3) -1
(4,3) 1
objSpecies = 4×1 cell
{'x' }
{'y1'}
{'y2'}
{'z' }
objReactions = 3×1 cell
{'Reaction1'}
{'Reaction2'}
{'Reaction3'}