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  9  3  7  7   7
o4 = {-, -, -, -, -, --}
      2  4  4  4  9  10

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              9              3              7             
o6 = {kk       => -, kk       => -, kk       => -, kk       => -, kk       =>
        {0, 1}    2    {1, 0}    4    {2, 3}    4    {3, 2}    4    {3, 4}   
     ------------------------------------------------------------------------
     7               7
     -, kk       => --}
     9    {4, 2}    10

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

      9  2   3          7         9      7       9  2    7               
o7 = {-xx  - -xx xx  + --xx xx  - -xx  + -xx , - -xx  - --xx xx  + 9xx  +
      4  B   4  A  C   10  B  E   2  A   4  D    2  B   10  B  E      A  
     ------------------------------------------------------------------------
     7       3          7         7     3         91        7         7
     -xx , - -xx xx  + --xx xx  + -xx , -xx xx  - --xx , - --xx xx  + -xx }
     9  D    4  A  C   10  B  E   4  D  4  A  C   36  D    10  B  E   9  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'')

       9  2   3          7         9      7       9  2    7               
o13 = {-xx  - -xx xx  + --xx xx  - -xx  + -xx , - -xx  - --xx xx  + 9xx  +
       4  B   4  A  C   10  B  E   2  A   4  D    2  B   10  B  E      A  
      -----------------------------------------------------------------------
      7       3          7         7     3         91        7         7
      -xx , - -xx xx  + --xx xx  + -xx , -xx xx  - --xx , - --xx xx  + -xx ,
      9  D    4  A  C   10  B  E   4  D  4  A  C   36  D    10  B  E   9  D 
      -----------------------------------------------------------------------
      2xx  + xx  - xx  + xx , - 2xx  - xx  + 2xx  + xx }
         A     B     C     D       A     B      C     E

o13 : List
i14 : I = ideal F

             9  2   3          7         9      7       9  2    7        
o14 = ideal (-xx  - -xx xx  + --xx xx  - -xx  + -xx , - -xx  - --xx xx  +
             4  B   4  A  C   10  B  E   2  A   4  D    2  B   10  B  E  
      -----------------------------------------------------------------------
             7       3          7         7     3         91        7        
      9xx  + -xx , - -xx xx  + --xx xx  + -xx , -xx xx  - --xx , - --xx xx  +
         A   9  D    4  A  C   10  B  E   4  D  4  A  C   36  D    10  B  E  
      -----------------------------------------------------------------------
      7
      -xx , 2xx  + xx  - xx  + xx , - 2xx  - xx  + 2xx  + xx )
      9  D     A     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.

Citation

If you have used this package in your research, please cite it as follows:

@misc{ReactionNetworksSource,
  title = {{ReactionNetworks: A \emph{Macaulay2} package. Version~1.0}},
  author = {Cvetelina Hill and Timothy Duff and Kisun Lee and Anton Leykin and Alexandru Iosif and Michael Adamer},
  howpublished = {A \emph{Macaulay2} package available at
    \url{https://github.com/Macaulay2/M2/tree/master/M2/Macaulay2/packages}}
}

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
    • conservationEquations(ReactionNetwork,InexactFieldFamily) (missing documentation)
    • createConcentrationRates(ReactionNetwork) (missing documentation)
    • createInitialValues(ReactionNetwork) (missing documentation)
    • createReactionRates(ReactionNetwork) (missing documentation)
    • 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
    • createRing(ReactionNetwork,InexactFieldFamily) (missing documentation)
    • 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.
    • net(ReactionNetwork) (missing documentation)
    • 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.
    • reactionMatrix(ReactionNetwork) (missing documentation)
    • 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
    • steadyStateEquations(ReactionNetwork,InexactFieldFamily) (missing documentation)
    • 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.
    • subRandomInitVals(ReactionNetwork) (missing documentation)
    • subRandomInitVals(ReactionNetwork,Ring) (missing documentation)
    • subRandomReactionRates(ReactionNetwork) (missing documentation)
    • subRandomReactionRates(ReactionNetwork,Ring) (missing documentation)
    • 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, defined in ReactionNetworks.m2, with auxiliary files in ReactionNetworks/.


The source of this document is in ReactionNetworks/DocReactionNetworks.m2:88:0.