Macaulay2 » Documentation
Packages » ReactionNetworks :: ReactionNetworks
next | previous | forward | backward | up | index | toc

ReactionNetworks -- create chemical reaction networks and corresponding steady-state and conservation equations

Description

The ReactionNetworks package provides functions for creating the steady-state and conservation equations corresponding to a given reaction network. Included are some basic building-block motifs, which can be joined together to create specific reaction network. Examples are provided illustrating elimination and degeneration with removal of a species or a reaction and the corresponding effect on the solutions of the system.

Basic Functions: reactionNetwork, isDeficient, isWeaklyReversible, steadyStateEquations conservationEquations, glue

Motifs: oneSiteModificationA, oneSiteModificationB, oneSiteModificationC, oneSiteModificationD, twoSiteModificationE, twoSiteModificationF, twoSiteModificationG, modificationOfTwoSubstratesH, modificationOfTwoSubstratesI, twoLayerCascadeJ, twoLayerCascadeK, twoLayerCascadeL, crossLinkingModelCelldeath (missing documentation) , clusterModelCellDeath, wnt, nSiteProcessiveModification, nSiteDistributiveModification, nSiteImmuneReaction, nSiteDiffusion, nSitePoreForming, nSiteSequestration, nSiteAutocatalytic

Examples

The following example demonstrates how to compute the degree and dimension of the ideal cut out by the steady-state and conservation equations.

i1 : N = reactionNetwork "A <--> 2B, A + C <--> D, B + E --> A + C, D --> B+E"

o1 = A-->2B
     2B-->A
     A+C-->D
     D-->A+C
     D-->B+E
     B+E-->A+C

o1 : ReactionNetwork
i2 : R = createRing(N, QQ)

o2 = R

o2 : PolynomialRing

After creating the reaction network and the corresponding ring, we create the steady state equations and substitute random values for the reaction rates; this will allows us to compute the degree of the ideal.

i3 : SS = flatten entries steadyStateEquations N

        2                                                                   
o3 = {xx kk       - xx xx kk       + xx xx kk       - xx kk       + xx kk   
        B  {1, 0}     A  C  {2, 3}     B  E  {4, 2}     A  {0, 1}     D  {3,
     ------------------------------------------------------------------------
              2
       , - 2xx kk       - xx xx kk       + 2xx kk       + xx kk      , -
     2}       B  {1, 0}     B  E  {4, 2}      A  {0, 1}     D  {3, 4}   
     ------------------------------------------------------------------------
     xx xx kk       + xx xx kk       + xx kk      , xx xx kk       - xx kk   
       A  C  {2, 3}     B  E  {4, 2}     D  {3, 2}    A  C  {2, 3}     D  {3,
     ------------------------------------------------------------------------
        - xx kk      , - xx xx kk       + xx kk      }
     2}     D  {3, 4}      B  E  {4, 2}     D  {3, 4}

o3 : List
i4 : K = apply(#N.ReactionRates, i->random QQ)

      9  1  9  1     3
o4 = {-, -, -, -, 1, -}
      2  2  4  2     4

o4 : List
i5 : Rr = N.ReactionRates/value

o5 = {kk      , kk      , kk      , kk      , kk      , kk      }
        {0, 1}    {1, 0}    {2, 3}    {3, 2}    {3, 4}    {4, 2}

o5 : List
i6 : P = apply(#Rr, i->Rr#i=>sub(K#i,R))

                  9              1              9              1             
o6 = {kk       => -, kk       => -, kk       => -, kk       => -, kk       =>
        {0, 1}    2    {1, 0}    2    {2, 3}    4    {3, 2}    2    {3, 4}   
     ------------------------------------------------------------------------
                    3
     1, kk       => -}
          {4, 2}    4

o6 : List
i7 : F' = apply(SS, s-> sub(s,P))

      1  2   9         3         9      1         2   3                      
o7 = {-xx  - -xx xx  + -xx xx  - -xx  + -xx , - xx  - -xx xx  + 9xx  + xx , -
      2  B   4  A  C   4  B  E   2  A   2  D      B   4  B  E      A     D   
     ------------------------------------------------------------------------
     9         3         1     9         3       3
     -xx xx  + -xx xx  + -xx , -xx xx  - -xx , - -xx xx  + xx }
     4  A  C   4  B  E   2  D  4  A  C   2  D    4  B  E     D

o7 : List

Next, we create the conservation equations and assume there is no translation, i.e., the initial conditions are all zero.

i8 : C = conservationEquations N

o8 = {2xx  + xx  - xx  + xx  - 2cc  - cc  + cc  - cc , - 2xx  - xx  + 2xx  +
         A     B     C     D      A     B     C     D       A     B      C  
     ------------------------------------------------------------------------
     xx  + 2cc  + cc  - 2cc  - cc }
       E      A     B      C     E

o8 : List
i9 : L = {0,0,0,0,0}

o9 = {0, 0, 0, 0, 0}

o9 : List
i10 : Iv = N.InitialValues

o10 = {cc , cc , cc , cc , cc }
         A    B    C    D    E

o10 : List
i11 : S = apply(#Iv, i->R_(Iv#i)=>L#i)

o11 = {cc  => 0, cc  => 0, cc  => 0, cc  => 0, cc  => 0}
         A         B         C         D         E

o11 : List
i12 : F'' = apply(C, c->sub(c,S))

o12 = {2xx  + xx  - xx  + xx , - 2xx  - xx  + 2xx  + xx }
          A     B     C     D       A     B      C     E

o12 : List

Finally, we join the two sets of equations and create an ideal. Thus, the degree and dimension can be computed.

i13 : F = join(F',F'')

       1  2   9         3         9      1         2   3                    
o13 = {-xx  - -xx xx  + -xx xx  - -xx  + -xx , - xx  - -xx xx  + 9xx  + xx ,
       2  B   4  A  C   4  B  E   2  A   2  D      B   4  B  E      A     D 
      -----------------------------------------------------------------------
        9         3         1     9         3       3
      - -xx xx  + -xx xx  + -xx , -xx xx  - -xx , - -xx xx  + xx , 2xx  + xx 
        4  A  C   4  B  E   2  D  4  A  C   2  D    4  B  E     D     A     B
      -----------------------------------------------------------------------
      - xx  + xx , - 2xx  - xx  + 2xx  + xx }
          C     D       A     B      C     E

o13 : List
i14 : I = ideal F

             1  2   9         3         9      1         2   3               
o14 = ideal (-xx  - -xx xx  + -xx xx  - -xx  + -xx , - xx  - -xx xx  + 9xx  +
             2  B   4  A  C   4  B  E   2  A   2  D      B   4  B  E      A  
      -----------------------------------------------------------------------
             9         3         1     9         3       3
      xx , - -xx xx  + -xx xx  + -xx , -xx xx  - -xx , - -xx xx  + xx , 2xx 
        D    4  A  C   4  B  E   2  D  4  A  C   2  D    4  B  E     D     A
      -----------------------------------------------------------------------
      + xx  - xx  + xx , - 2xx  - xx  + 2xx  + xx )
          B     C     D       A     B      C     E

o14 : Ideal of R
i15 : degree I

o15 = 5
i16 : dim I

o16 = 11

Authors

Version

This documentation describes version 1.0 of ReactionNetworks.

Source code

The source code from which this documentation is derived is in the file ReactionNetworks.m2. The auxiliary files accompanying it are in the directory ReactionNetworks/.

Exports

  • Types
    • ReactionNetwork -- a mutable hash table, stores information about a reaction network
  • Functions and commands
  • Methods
    • conservationEquations(ReactionNetwork) -- see conservationEquations -- creates the conservation equations of a reaction network
    • conservationEquations(ReactionNetwork,Ring) -- see conservationEquations -- creates the conservation equations of a reaction network
    • createRing(ReactionNetwork) -- see createRing -- creates a ring with generators species concentrations, reaction rates, initial values
    • createRing(ReactionNetwork,Ring) -- see createRing -- creates a ring with generators species concentrations, reaction rates, initial values
    • glue(List,ReactionNetwork) -- see glue -- combine two networks
    • glue(ReactionNetwork,List) -- see glue -- combine two networks
    • glue(ReactionNetwork,ReactionNetwork) -- see glue -- combine two networks
    • negativeLaplacian(ReactionNetwork) -- see negativeLaplacian -- Computes the negative of the Laplacian matrix of a Reaction Network.
    • negativeUndirectedLaplacian(ReactionNetwork) -- see negativeUndirectedLaplacian -- Computes the negative of the Laplacian matrix of an undirected graph associated with a Reaction Network.
    • negativeWeightedLaplacian(ReactionNetwork) -- see negativeWeightedLaplacian -- Computes the negative of the weighted Laplacian matrix of a Reaction Network.
    • nSiteAutocatalytic(ZZ) -- see nSiteAutocatalytic -- A motif for autocatalytic networks
    • nSiteDiffusion(ZZ) -- see nSiteDiffusion -- an example for a diffusion network
    • nSiteDistributiveModification(ZZ) -- see nSiteDistributiveModification -- A motif for purely distributive phosphorylation
    • nSiteImmuneReaction(ZZ) -- see nSiteImmuneReaction -- A motif for an immune response network
    • nSitePoreForming(ZZ) -- see nSitePoreForming -- an example for a pore forming network
    • nSiteProcessiveModification(ZZ) -- see nSiteProcessiveModification -- A motif for purely processive phosphorylation
    • nSiteSequestration(ZZ) -- see nSiteSequestration -- A motif for sequestration networks
    • reactantMatrix(ReactionNetwork) -- see reactantMatrix -- Computes the reactants matrix of a Reaction Network.
    • reactionNetwork(Ideal) -- see reactionNetwork -- creates a reaction network
    • reactionNetwork(List) -- see reactionNetwork -- creates a reaction network
    • reactionNetwork(String) -- see reactionNetwork -- creates a reaction network
    • steadyStateEquations(ReactionNetwork) -- see steadyStateEquations -- creates steady-state equations of a reaction network
    • steadyStateEquations(ReactionNetwork,Ring) -- see steadyStateEquations -- creates steady-state equations of a reaction network
    • stoichiometricConeKer(ReactionNetwork) -- see stoichiometricConeKer -- Computes a matrix whose columns are the rays of the cone non-negative kernel of the stoichiometric matrix of a Reaction Network.
    • stoichiometricMatrix(ReactionNetwork) -- see stoichiometricMatrix -- Computes the stoichiometric matrix of a Reaction Network.
    • stoichiometricSubspace(ReactionNetwork) -- see stoichiometricSubspace -- Computes the stoichiometric space of a Reaction Network.
    • stoichSubspaceKer(ReactionNetwork) -- see stoichSubspaceKer -- Computes the kernel of the stoichiometric matrix of a Reaction Network.
    • substitute(ReactionNetwork,List) -- substitute species names in reaction network
  • Symbols
    • FullEdges (missing documentation)
    • Input (missing documentation)
    • NullEdges (missing documentation)
    • Complexes -- see ReactionNetwork -- a mutable hash table, stores information about a reaction network
    • ConcentrationRates -- see ReactionNetwork -- a mutable hash table, stores information about a reaction network
    • InitialValues -- see ReactionNetwork -- a mutable hash table, stores information about a reaction network
    • NullIndex -- see ReactionNetwork -- a mutable hash table, stores information about a reaction network
    • NullSymbol -- see ReactionNetwork -- a mutable hash table, stores information about a reaction network
    • ReactionGraph -- see ReactionNetwork -- a mutable hash table, stores information about a reaction network
    • ReactionRates -- see ReactionNetwork -- a mutable hash table, stores information about a reaction network
    • ReactionRing -- see ReactionNetwork -- a mutable hash table, stores information about a reaction network
    • Species -- see ReactionNetwork -- a mutable hash table, stores information about a reaction network

For the programmer

The object ReactionNetworks is a package.