Self

Practical 3: Models and their Structural Analysis

Once again, start ScrumPy as described in the installation instructions.

Loading and defining models

   1 >>> m = ScrumPy.Model('toy_model.spy')

   1 Structural() # tells ScrumPy not to bother with kinetics
   2 ElType(Int) #  tells ScrumPy to use integers in the stoichiometry matrix
   3 A_tx:
   4     x_A -> A
   5     ~
   6 R_1:
   7     A -> B
   8     ~
   9 R_2:
  10     B -> C
  11     ~
  12 R_3:
  13     C -> E
  14     ~
  15 R_4:
  16     B -> D
  17     ~
  18 R_5:
  19     D -> E
  20     ~
  21 R_6:
  22     D -> F
  23     ~
  24 E_tx:
  25     E -> x_E
  26     ~

Properties of structural models

The stoichiometry matrix

   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.smx.rnames will be longer
   4 ['D', 'E', 'A', 'F', 'C', 'B']

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

   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)}

Nullspace analysis

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

   1 >>> m.DeadReactions()
   2 ['R_6']

Enzyme subsets

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

Elementary modes

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

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

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

Further Properties of the Stoichiometry Matrix and Null-space

Further information

None: Meetings/Barcelona/Prac3 (last edited 2023-05-29 12:32:12 by mark)