Skip to Main Content Skip to Search
Product Documentation

Determining the Stoichiometry Matrix for a Model

What Is a Stoichiometry Matrix?

A stoichiometry matrix lets you easily determine:

A stoichiometry matrix is an M-by-N matrix, where M equals the total number of reactions in a model, and N equals the total number of species in a model. Each row corresponds to a species, and each column corresponds to a reaction.

The matrix indicates which species and reactions are involved as reactants and products:

For example, consider a model object containing two reactions. One reaction (named R1) is equal to 2 A + B -> 3 C, and the other reaction (named R2) is equal to B + 3 D -> 4 A. The stoichiometry matrix is:

      R1   R2
A     -2    4
B     -1   -1
C      3    0
D      0   -3

Example — Retrieving a Stoichiometry Matrix for a Model

Retrieve a stoichiometry matrix for a model by passing the model object as an input argument to the getstoichmatrix method.

  1. Read in m1, a model object, using sbmlimport:

    m1 = sbmlimport('lotka.xml');
  2. Get the stoichiometry matrix for m1:

    [M,objSpecies,objReactions] = getstoichmatrix(m1)
    
    M =
    
       (2,1)        1
       (2,2)       -1
       (3,2)        1
       (3,3)       -1
       (4,3)        1
    
    
    objSpecies = 
    
        'x'
        'y1'
        'y2'
        'z'
    
    
    objReactions = 
    
        'Reaction1'
        'Reaction2'
        'Reaction3'
  3. Convert the stoichiometry matrix from a sparse matrix to a full matrix to more easily see the relationships between species and reactions:

    M_full = full(M)
    M_full =
    
         0     0     0
         1    -1     0
         0     1    -1
         0     0     1

  


Free Computational Biology Interactive Kit

See how to analyze, visualize, and model biological data and systems using MathWorks products.

Get free kit

Trials Available

Try the latest computational biology products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS