Differences between revisions 2 and 3
Revision 2 as of 2012-12-10 16:19:47
Size: 2325
Editor: mark
Comment:
Revision 3 as of 2013-11-06 15:53:29
Size: 7685
Editor: david
Comment: Used some material from the first Delhi workshop to expand the structural modelling section. Still needs a bit of work.
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#pragma section-numbers 2
Line 3: Line 4:
== Methods acting on the model == <<TableOfContents>>
Line 5: Line 6:
All structural modelling analyses can be implemented by actions on the model's stoichiometry matrices. A number of common analyses are provided as methods of the model itself: == Introduction ==
Line 7: Line 8:
=== Orphan Metabolites ===  The class {{{Model}}} has a range of methods, of which some are only useful for kinetic models (which are also structural models, though the opposite is not true). Among the structurally relevant methods we find {{{ConsMoieties()}}} - which prints a list of conserved moieties; {{{DeadReactions()}}} - which returns a list of reactions that cannot carry steady state flux; {{{FindIsoforms()}}} - which identifies reactions from the model that are redundant, i.e. a set of reactions have identical stoichiometry; {{{ElModes()}}} - which returns an elementary modes object; {{{Externals()}}} - which returns a list of external metabolites. These are all described further below.
Line 9: Line 10:
An orphan metabolite is one that cannot be balanced at steady-state because it is involved with only one reaction, and can therefore be only consumed or produced. These are identified by the {{{OrphanMets()}}} method.  All structural modelling analyses are in fact implemented by actions on the model's stoichiometry matrices, which can be accessed as described in the next section.
Line 11: Line 12:
{{{#!highlight python == The stoichiometry matrix ==

 The fields {{{Model.sm}}} and {{{Model.smexterns}}} are the two stoichiometry matrices assocciated with a model - the former is the internal matrix, the latter the external. The external matrix contains infomation about external metabolites, whereas the internal does not. All instances of {{{ScrumPy}}} matrices (subclasses of {{{DynMatrix}}}) have the fields {{{cnames}}} - column names and {{{rnames}}} - row names.

 {{{#!python
>>> m.sm.cnames
['R_1', 'R_2', 'R_3', 'R_4', 'R_5', 'R_6', 'E_tx', 'A_tx']
>>> m.sm.rnames #but m.smexterns.rnames will be longer
['A', 'B', 'C', 'E', 'D', 'F']
}}}

 Useful methods of {{{sm}}} (and {{{smexterns}}}) include {{{ReacToStr(reac)}}},
 {{{#!python
>>> print m.sm.ReacToStr('R_2')
R_2:
 1/1 B -> 1/1 C
 ~

}}}

 and {{{InvolvedWith(name)}}},
 {{{#!python
>>> m.sm.InvolvedWith('R_2')
{'C': mpq(1,1), 'B': mpq(-1,1)}
>>> m.sm.InvolvedWith('C')
{'R_2': mpq(1,1), 'R_3': mpq(-1,1)}
}}}

== Reaction reversibility ==

 {{{ScrumPy}}} accepts three reversibility symbols: {{{"->"}}} - left to right irreversible, {{{"<-"}}} - right to left irreversible, and {{{<>}}} - reversible. Reaction reversibility is handled by the stoichiometry matrix.

 {{{#!python
>>> m.sm.GetIrrevs()
['R_1', 'R_2', 'R_3', 'R_4', 'R_5', 'R_6', 'E_tx', 'A_tx']
>>> m.sm.MakeRevers('R_2')
>>> m.sm.GetIrrevs()
['R_1', 'R_3', 'R_4', 'R_5', 'R_6', 'E_tx', 'A_tx']
>>> m.Reload()

>>> m.sm.GetIrrevs()
['R_1', 'R_2', 'R_3', 'R_4', 'R_5', 'R_6', 'E_tx', 'A_tx']
}}}


== Orphan Metabolites ==

 An orphan metabolite is one that cannot be balanced at steady-state because it is involved with only one reaction, and can therefore be only consumed or produced. These are identified by the {{{OrphanMets()}}} method.

 {{{#!highlight python
Line 20: Line 70:
Here the model has 7 orphan metabolites, but, as denoted by the x_ prefix, they are all external metabolites, and so this does not indicate a problem with model. In general, when practical , it is desirable to associate external metabolites with exactly one transport reaction, as it can considerably simplify subsequent analys of results obtained from the model.  Here the model has 7 orphan metabolites, but, as denoted by the x_ prefix, they are all external metabolites, and so this does not indicate a problem with model. In general, when practical , it is desirable to associate external metabolites with exactly one transport reaction, as it can considerably simplify subsequent analysis of results obtained from the model.
Line 22: Line 72:
== Nullspace analysis ==

 The kernel of the stoichiometry matrix can be calculated using the {{{sm.NullSpace()}}} method ({{{smexterns}}} also has the method, but the kernel of the external matrix is only related to the futile cycles of the model, not possible steady-state solutions).

 {{{#!python
>>> k = m.sm.NullSpace()
>>> k
    c_0 c_1

 R_1 -1/1 0/1
 R_2 -1/1 1/1
 R_3 -1/1 1/1
 R_4 0/1 -1/1
 R_5 0/1 -1/1
 R_6 0/1 0/1
 E_tx -1/1 0/1
 A_tx -1/1 0/1
}}}

 Even if the signs of some of the coeffients indicate thermodynamically infeasible solutions (e.g. all active reactions in the first column have negative coefficients, even though they are irreversible) a lot of useful information can be obtained form {{{k}}}. For instance, we see that the row associated with {{{R_6}}} is a null-vector, indicating that there is no steady-state solution involving {{{R_6}}}. In fact this is how {{{ScrumPy}}} detects dead reactions, as follows:
Line 25: Line 95:
A dead reaction is one which can carry no flux at steady-state. This is usually, but not always, caused by the presence of internal orphan metabolites. The inability to carry flux applies to ''any'' further analysis of the model - for example, a dead reaction will nver be present as part of an LP solution, will never show up in an elementary mode and will always carry zero flux (within machine prescision) in any kinetic steady-state determination. They are identified by the {{{DeadReactions()}}} method:  A dead reaction is one which can carry no flux at steady-state. This is usually, but not always, caused by the presence of internal orphan metabolites. The inability to carry flux applies to ''any'' further analysis of the model - for example, a dead reaction will never be present as part of an LP solution, will never show up in an elementary mode and will always carry zero flux (within machine precision) in any kinetic steady-state determination. They are identified by the {{{DeadReactions()}}} method, e.g.:
Line 27: Line 97:
{{{#!highlight python  {{{#!highlight python
Line 35: Line 105:
Here we see that a glucose 6 phosphate transporter is dead, despite the fact that in this case the internal substrate, G6P, is not an orphan metabolite.  In this case a glucose 6 phosphate transporter was dead, despite the fact that in this case the internal substrate, G6P, was not an orphan metabolite.
Line 37: Line 107:
{{{#!highlight python  {{{#!highlight python
Line 43: Line 113:
The reason that the reaction is dead is that phosphate (in this model) is a conserved moiety, and the transporter cannot carry steady-state flux unless an external phosphate is exchanged for the internal G6P.  The reason was that phosphate (in this model) was a conserved moiety, and the transporter could not carry steady-state flux unless a phosphate could leave the system for each G6P that entered.


=== Enzyme (reaction) subsets ===

 In the null-space reported above, note that some of the row-vectors are proportional to each other - {{{R_2}}}, {{{R_3}}}; {{{R_4}}}, {{{R_5}}}; and {{{E_tx}}}, {{{A_tx}}}, {{{R_1}}}. This implies that these sets must carry flux in a coordinated fashion, e.g. any flux solution involving {{{R_4}}} must also involve {{{R_5}}}. These sets of coordinated reactions are referred to as ''enzyme subsets'' and can be determined using the {{{Model}}} method {{{EnzSubsets()}}}. This method returns a dictionary object where keys are subset names (or reaction name if a reaction is in a singleton set) and values are nested dictionaries where keys are reaction names and values are the flux ratios of the reactions. The key {{{DeadReacs}}} maps to a list of dead reactions, since all dead reactions satisfy the definition of a subset (if rather trivially).

 {{{#!python
>>> ess=m.EnzSubsets()
>>> ess
{'Ess_3': {'R_4': mpq(-1,1), 'R_5': mpq(-1,1)}, 'Ess_2': {'R_2': mpq(1,1), 'R_3': mpq(1,1)}, 'Ess_1': {'E_tx': mpq(1,1), 'R_1': mpq(1,1), 'A_tx': mpq(1,1)}, 'DeadReacs': {'R_6': mpq(1,1)}}
}}}
Line 47: Line 128:
=== Enzyme (reaction) subsets ===
== Elementary Modes Analysis ==
 The elementary modes of a model can be analysed using the method {{{Model.ElModes()}}}. The field {{{mo}}} is a matrix similar to {{{k}}}.
 {{{#!python
>>> elmo = m.ElModes()
>>> elmo.mo
    ElMo_0 ElMo_1

 R_1 1/1 1/1
 R_2 1/1 0/1
 R_3 1/1 0/1
 R_4 0/1 1/1
 R_5 0/1 1/1
 R_6 0/1 0/1
 E_tx 1/1 1/1
 A_tx 1/1 1/1
}}}

 The relationship between modes and metabolites is stored in the {{{sto}}} matrix.
 {{{#!python
>>> elmo.sto
    ElMo_0 ElMo_1

 x_A -1/1 -1/1
 A 0/1 0/1
 B 0/1 0/1
 C 0/1 0/1
 E 0/1 0/1
 D 0/1 0/1
 F 0/1 0/1
 x_E 1/1 1/1
}}}

 The methods {{{Modes()}}} and {{{Stos()}}} returns a string with with same information as the matrices above.
 {{{#!python
>>> print elmo.Modes()
ElMo_0, 1/1 E_tx, 1/1 R_1, 1/1 R_2, 1/1 R_3, 1/1 A_tx

ElMo_1, 1/1 E_tx, 1/1 R_1, 1/1 A_tx, 1/1 R_4, 1/1 R_5

>>> print elmo.Stos()
ElMo_0:
 1/1 x_A -> 1/1 x_E
 ~
ElMo_1:
 1/1 x_A -> 1/1 x_E
 ~
}}}
Line 50: Line 178:


=
== The Matrix Class ===
== The Matrix Class ==

Structural Modelling

1. Introduction

  • The class Model has a range of methods, of which some are only useful for kinetic models (which are also structural models, though the opposite is not true). Among the structurally relevant methods we find ConsMoieties() - which prints a list of conserved moieties; DeadReactions() - which returns a list of reactions that cannot carry steady state flux; FindIsoforms() - which identifies reactions from the model that are redundant, i.e. a set of reactions have identical stoichiometry; ElModes() - which returns an elementary modes object; Externals() - which returns a list of external metabolites. These are all described further below. All structural modelling analyses are in fact implemented by actions on the model's stoichiometry matrices, which can be accessed as described in the next section.

2. The stoichiometry matrix

  • The fields Model.sm and Model.smexterns are the two stoichiometry matrices assocciated with a model - the former is the internal matrix, the latter the external. The external matrix contains infomation about external metabolites, whereas the internal does not. All instances of ScrumPy matrices (subclasses of DynMatrix) have the fields cnames - column names and rnames - row names.

       1 >>> m.sm.cnames
       2 ['R_1', 'R_2', 'R_3', 'R_4', 'R_5', 'R_6', 'E_tx', 'A_tx']
       3 >>> m.sm.rnames                #but m.smexterns.rnames will be longer
       4 ['A', 'B', 'C', 'E', 'D', 'F']
    

    Useful methods of sm (and smexterns) include ReacToStr(reac),

       1 >>> print m.sm.ReacToStr('R_2')
       2 R_2:
       3         1/1 B -> 1/1 C
       4         ~
    

    and InvolvedWith(name),

       1 >>> m.sm.InvolvedWith('R_2')
       2 {'C': mpq(1,1), 'B': mpq(-1,1)}
       3 >>> m.sm.InvolvedWith('C')
       4 {'R_2': mpq(1,1), 'R_3': mpq(-1,1)}
    

3. Reaction reversibility

  • ScrumPy accepts three reversibility symbols: "->" - left to right irreversible, "<-" - right to left irreversible, and <> - reversible. Reaction reversibility is handled by the stoichiometry matrix.

       1 >>> m.sm.GetIrrevs()
       2 ['R_1', 'R_2', 'R_3', 'R_4', 'R_5', 'R_6', 'E_tx', 'A_tx']
       3 >>> m.sm.MakeRevers('R_2')      
       4 >>> m.sm.GetIrrevs()
       5 ['R_1', 'R_3', 'R_4', 'R_5', 'R_6', 'E_tx', 'A_tx']
       6 >>> m.Reload()
       7 
       8 >>> m.sm.GetIrrevs()
       9 ['R_1', 'R_2', 'R_3', 'R_4', 'R_5', 'R_6', 'E_tx', 'A_tx']
    

4. Orphan Metabolites

  • An orphan metabolite is one that cannot be balanced at steady-state because it is involved with only one reaction, and can therefore be only consumed or produced. These are identified by the OrphanMets() method.

       1 >>> orphans = m.OrphanMets()
       2 >>> len(orphans)
       3 7
       4 >>> print orphans
       5 ['x_CO2', 'x_NADPH_ch', 'x_Proton_ch', 'x_NADP_ch', 'x_PGA_cyt', 'x_GAP_cyt', 'x_DHAP_cyt']
       6 >>> 
    
    Here the model has 7 orphan metabolites, but, as denoted by the x_ prefix, they are all external metabolites, and so this does not indicate a problem with model. In general, when practical , it is desirable to associate external metabolites with exactly one transport reaction, as it can considerably simplify subsequent analysis of results obtained from the model.

5. Nullspace analysis

  • The kernel of the stoichiometry matrix can be calculated using the sm.NullSpace() method (smexterns also has the method, but the kernel of the external matrix is only related to the futile cycles of the model, not possible steady-state solutions).

       1 >>> k = m.sm.NullSpace()
       2 >>> k
       3     c_0 c_1 
       4 
       5  R_1 -1/1  0/1 
       6  R_2 -1/1  1/1 
       7  R_3 -1/1  1/1 
       8  R_4 0/1  -1/1 
       9  R_5 0/1  -1/1 
      10  R_6 0/1  0/1 
      11  E_tx -1/1  0/1 
      12  A_tx -1/1  0/1 
    

    Even if the signs of some of the coeffients indicate thermodynamically infeasible solutions (e.g. all active reactions in the first column have negative coefficients, even though they are irreversible) a lot of useful information can be obtained form k. For instance, we see that the row associated with R_6 is a null-vector, indicating that there is no steady-state solution involving R_6. In fact this is how ScrumPy detects dead reactions, as follows:

5.1. Dead Reactions

  • A dead reaction is one which can carry no flux at steady-state. This is usually, but not always, caused by the presence of internal orphan metabolites. The inability to carry flux applies to any further analysis of the model - for example, a dead reaction will never be present as part of an LP solution, will never show up in an elementary mode and will always carry zero flux (within machine precision) in any kinetic steady-state determination. They are identified by the DeadReactions() method, e.g.:

       1 >>> dead = m.DeadReactions()
       2 >>> len(dead)
       3 1
       4 >>> print dead
       5 ['GlcTx']
    
    In this case a glucose 6 phosphate transporter was dead, despite the fact that in this case the internal substrate, G6P, was not an orphan metabolite.
       1 GlcTx:
       2          x_G6P <>  G6P
       3         ~
    
    The reason was that phosphate (in this model) was a conserved moiety, and the transporter could not carry steady-state flux unless a phosphate could leave the system for each G6P that entered.

5.2. Enzyme (reaction) subsets

  • In the null-space reported above, note that some of the row-vectors are proportional to each other - R_2, R_3; R_4, R_5; and E_tx, A_tx, R_1. This implies that these sets must carry flux in a coordinated fashion, e.g. any flux solution involving R_4 must also involve R_5. These sets of coordinated reactions are referred to as enzyme subsets and can be determined using the Model method EnzSubsets(). This method returns a dictionary object where keys are subset names (or reaction name if a reaction is in a singleton set) and values are nested dictionaries where keys are reaction names and values are the flux ratios of the reactions. The key DeadReacs maps to a list of dead reactions, since all dead reactions satisfy the definition of a subset (if rather trivially).

       1 >>> ess=m.EnzSubsets()
       2 >>> ess
       3 {'Ess_3': {'R_4': mpq(-1,1), 'R_5': mpq(-1,1)}, 'Ess_2': {'R_2': mpq(1,1), 'R_3': mpq(1,1)}, 'Ess_1': {'E_tx': mpq(1,1), 'R_1': mpq(1,1), 'A_tx': mpq(1,1)}, 'DeadReacs': {'R_6': mpq(1,1)}}
    

5.3. Conserved Moieties

6. Elementary Modes Analysis

  • The elementary modes of a model can be analysed using the method Model.ElModes(). The field mo is a matrix similar to k.

       1 >>> elmo = m.ElModes()
       2 >>> elmo.mo
       3     ElMo_0 ElMo_1 
       4 
       5  R_1 1/1  1/1 
       6  R_2 1/1  0/1 
       7  R_3 1/1  0/1 
       8  R_4 0/1  1/1 
       9  R_5 0/1  1/1 
      10  R_6 0/1  0/1 
      11  E_tx 1/1  1/1 
      12  A_tx 1/1  1/1 
    

    The relationship between modes and metabolites is stored in the sto matrix.

       1 >>> elmo.sto
       2     ElMo_0 ElMo_1 
       3 
       4  x_A -1/1  -1/1 
       5  A 0/1  0/1 
       6  B 0/1  0/1 
       7  C 0/1  0/1 
       8  E 0/1  0/1 
       9  D 0/1  0/1 
      10  F 0/1  0/1 
      11  x_E 1/1  1/1 
    

    The methods Modes() and Stos() returns a string with with same information as the matrices above.

       1 >>> print elmo.Modes()
       2 ElMo_0, 1/1 E_tx, 1/1 R_1, 1/1 R_2, 1/1 R_3, 1/1 A_tx
       3 
       4 ElMo_1, 1/1 E_tx, 1/1 R_1, 1/1 A_tx, 1/1 R_4, 1/1 R_5
       5 
       6 >>> print elmo.Stos()
       7 ElMo_0:
       8         1/1 x_A -> 1/1 x_E
       9         ~
      10 ElMo_1:
      11         1/1 x_A -> 1/1 x_E
      12         ~
    

7. The Matrix Class

Fully described in utility section - enough here to understand SMs, datasets and monitors.

None: ScrumPy/Doc/StruMod (last edited 2013-11-06 15:53:29 by david)