geckopy.integration.pytfa

Integration layer with pytfa. Pytfa is not installed by default.

Module Contents

Classes

ThermoModel

Derived class to guard LC_vars against rewriting.

Functions

adapt_gecko_to_thermo(ec_model: geckopy.Model, thermodb: Dict, compartment_data: Dict, solver: Optional[str] = None, *args, **kwargs) → pytfa.ThermoModel

Prepare and convert gecko model to pytfa.ThermoModel.

_prepare_pseudometabolites_dfg(model: geckopy.Model, thermodb: Dict)

Equal \(\Delta G_f\) of pseudometabolites to their opposite sides.

translate_model_mnx_to_seed(model: cobra.Model, thermodb: Dict, mnx_file: str)

Add a seed_id annotation to every metabolite.

write_thermodb(thermodb: Dict, filename: str)

Deserialize the thermoDB to a compressed file at filename.

get_thermo_coverage(model: pytfa.thermo.ThermoModel, total=True)

Return the number of reactions that were assigned a thermodynamic variable.

get_thermo_reactions(model: pytfa.thermo.ThermoModel)

Return the set of reactions that were assigned a thermodynamic variable.

geckopy.integration.pytfa.LOGGER[source]
geckopy.integration.pytfa.PROT_DATA[source]
geckopy.integration.pytfa.PROT_CUE_DATA[source]
class geckopy.integration.pytfa.ThermoModel[source]

Bases: pytfa.ThermoModel

Derived class to guard LC_vars against rewriting.

This is required because we need to include LC_vars about proteins before calling .convert(), but convert reassigns it to an empty dictionary.

_LC_vars :Dict[cobra.Metabolite, GenericVariable][source]
property LC_vars(self)[source]

Get dict LogConcentration variables to use in dGr constraints.

geckopy.integration.pytfa.adapt_gecko_to_thermo(ec_model: geckopy.Model, thermodb: Dict, compartment_data: Dict, solver: Optional[str] = None, *args, **kwargs)pytfa.ThermoModel[source]

Prepare and convert gecko model to pytfa.ThermoModel.

It modifies the model and the thermodb in place.

The ‘seed_id’ annotation is hardcoded in pytfa so the metabolites and the database must have that annotation to be used.

If proteins were added without dG energy, they would be treated as missing metabolites so the reactions with enzymes would be ignored. Adding 0 formation energy results in ignoring proteins for dG, since catalyzers do not affect dG.

Parameters
geckopy.integration.pytfa._prepare_pseudometabolites_dfg(model: geckopy.Model, thermodb: Dict)[source]

Equal \(\Delta G_f\) of pseudometabolites to their opposite sides.

geckopy.integration.pytfa.translate_model_mnx_to_seed(model: cobra.Model, thermodb: Dict, mnx_file: str)[source]

Add a seed_id annotation to every metabolite.

geckopy.integration.pytfa.write_thermodb(thermodb: Dict, filename: str)[source]

Deserialize the thermoDB to a compressed file at filename.

geckopy.integration.pytfa.get_thermo_coverage(model: pytfa.thermo.ThermoModel, total=True)[source]

Return the number of reactions that were assigned a thermodynamic variable.

Parameters
  • model (pytfa.ThermoModel) –

  • total (bool) – whether to report the total number of reactions covered or the percentage. Default: True

geckopy.integration.pytfa.get_thermo_reactions(model: pytfa.thermo.ThermoModel)[source]

Return the set of reactions that were assigned a thermodynamic variable.

In pytfa, a reaction will have thermodynamic constraints if and only if all of the metabolites in the reaction have the \(\Delta G_f\).