Getting started =============== Enzyme Constraint (gecko) models work as regular cobra models with: - Proteins as additional metabolites. - Protein pseudorreactions, which simulate the production of the protein by the cell. - (Optional) Pool constraint: all proteins must be below the total quantified proteome. The interface mirrors and depends on the `cobrapy `__ API. .. code:: ipython3 from os.path import join, pardir import geckopy ROOT = pardir DATA = join(ROOT, "tests", "data") Import models ------------- The models can be imported directly from SBML. Check the `design chapter `__ for more information on how proteins are identified. .. code:: ipython3 ec_model = geckopy.io.read_sbml_ec_model(join(DATA, "eciML1515.xml.gz")) :class:`~geckopy.Model` derives from :doc:`cobrapy:autoapi/cobra/core/model/index`. .. code:: ipython3 print(f"Model has {len(ec_model.reactions)} reactions and {len(ec_model.metabolites)} metabolites.") .. parsed-literal:: Model has 4824 reactions and 2333 metabolites. Models can also be written to the SBML file. .. code:: ipython3 geckopy.io.write_sbml_ec_model(ec_model, join(DATA, "model_copy.xml")) Python API: Protein isolation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Proteins are separated from metabolites and reactions in a different container, :attr:`~geckopy.model.Model.proteins`. .. code:: ipython3 ec_model.slim_optimize() .. parsed-literal:: 0.876997313396373 .. code:: ipython3 ec_model.proteins.prot_P0A796 .. raw:: html
Protein identifierprot_P0A796
Nameprot_P0A796 [cytosol]
Memory address 0x0%x140634108785232
Concentrationnan
Upper bound1000.0
Mw0.0
In 3 reaction(s) PFKNo1 (62.00), PFK_2No1 (62.00), PFK_3No1 (62.00)
Reactions are aware of their proteins. .. code:: ipython3 ec_model.reactions.PFKNo1.proteins .. parsed-literal:: {: -4.4803e-06} Proteins are aware of their reactions. .. code:: ipython3 ec_model.proteins.prot_P0A796.reactions .. parsed-literal:: frozenset({, , }) Analogous to :ref:`cobrapy:autoapi/cobra/index.html#cobra.Reaction.flux`. .. code:: ipython3 ec_model.proteins.prot_P0A796.contribution .. parsed-literal:: 2.7670111370232322e-05 Fluxes are separated in the solution dataframe to avoid regexing: .. code:: ipython3 # Fluxes are separated in the solution dataframe to avoid regexing: solution_rxn, solution_prot = ec_model.optimize() .. code:: ipython3 solution_rxn .. raw:: html Optimal solution with objective value 0.877
fluxes reduced_costs
EX_acgam_e 0.000000 -2.821258e-01
EX_cellb_e 0.000000 -3.630018e-01
EX_chol_e 0.000000 -2.633174e-02
EX_pi_e 0.000000 0.000000e+00
EX_h_e 8.058201 0.000000e+00
... ... ...
PUACGAMS_REVNo1 0.000000 0.000000e+00
ARHGDx_REVNo1 0.000000 5.312591e-17
UDPGPT_REVNo1 0.000000 -5.551115e-17
4HTHRA_REVNo1 0.000587 0.000000e+00
RHMND_REVNo1 0.000000 0.000000e+00

4824 rows × 2 columns

.. code:: ipython3 solution_prot .. raw:: html Optimal solution with objective value 0.877
fluxes reduced_costs
prot_P0A825 4.246198e-07 0.0
prot_P75823 0.000000e+00 -0.0
prot_P0AEA8 0.000000e+00 -0.0
prot_P36553 3.195620e-06 0.0
prot_P06715 1.642762e-07 0.0
... ... ...
prot_P77215 0.000000e+00 -0.0
prot_P0A8Y8 0.000000e+00 -0.0
prot_P76290 0.000000e+00 -0.0
prot_P16691 0.000000e+00 -0.0
prot_P32138 0.000000e+00 -0.0

1259 rows × 2 columns

Kcats ----- The kcats can be inspected and manipulated from the :class:`~geckopy.protein.Protein` object, as a regular dictionary. These kcats are individual for every protein-reaction pair and correspond to the stoichiometric coefficient of the protein pseudometabolite in the reaction. - The units of the input are in :math:`\frac{1}{s}`. - This input is translated to :math:`h` in the stoichiometric coefficient. .. code:: ipython3 ec_model.proteins.prot_P0A796.kcats .. parsed-literal:: {: 61.99981648054322, : 61.99981648054322, : 61.99981648054322} .. code:: ipython3 ec_model.proteins.prot_P0A796.kcats["PFKNo1"] .. parsed-literal:: 61.99981648054322 .. code:: ipython3 ec_model.reactions.PFKNo1.metabolites[ec_model.proteins.prot_P0A796] .. parsed-literal:: -4.4803e-06 .. code:: ipython3 ec_model.proteins.prot_P0A796.kcats["PFKNo1"] = 120 .. code:: ipython3 ec_model.reactions.PFKNo1.metabolites[ec_model.proteins.prot_P0A796] .. parsed-literal:: -2.3148148148148148e-06