:mod:`geckopy.integration.pytfa` ================================ .. py:module:: geckopy.integration.pytfa .. autoapi-nested-parse:: Integration layer with pytfa. Pytfa is not installed by default. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: geckopy.integration.pytfa.ThermoModel Functions ~~~~~~~~~ .. autoapisummary:: geckopy.integration.pytfa.adapt_gecko_to_thermo geckopy.integration.pytfa._prepare_pseudometabolites_dfg geckopy.integration.pytfa.translate_model_mnx_to_seed geckopy.integration.pytfa.write_thermodb geckopy.integration.pytfa.get_thermo_coverage geckopy.integration.pytfa.get_thermo_reactions .. data:: LOGGER .. data:: PROT_DATA .. data:: PROT_CUE_DATA .. class:: ThermoModel Bases: :class:`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. .. attribute:: _LC_vars :annotation: :Dict[cobra.Metabolite, GenericVariable] .. method:: LC_vars(self) :property: Get dict LogConcentration variables to use in dGr constraints. .. function:: 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`. 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. :param model: :type model: geckopy.Model :param thermodb: from pytfa.io.load_thermo. The format is explained at https://pytfa.readthedocs.io/en/latest/thermoDB.html :type thermodb: Dict :param compartment_data: check https://pytfa.readthedocs.io/en/latest/model.html#compartment-data :type compartment_data: Dict :param \*args: which will be passed to the pytfa.ThermoModel.__init__ :param \*\*kwargs: which will be passed to the pytfa.ThermoModel.__init__ .. function:: _prepare_pseudometabolites_dfg(model: geckopy.Model, thermodb: Dict) Equal :math:`\Delta G_f` of pseudometabolites to their opposite sides. .. function:: translate_model_mnx_to_seed(model: cobra.Model, thermodb: Dict, mnx_file: str) Add a seed_id annotation to every metabolite. .. function:: write_thermodb(thermodb: Dict, filename: str) Deserialize the `thermoDB` to a compressed file at `filename`. .. function:: get_thermo_coverage(model: pytfa.thermo.ThermoModel, total=True) Return the number of reactions that were assigned a thermodynamic variable. :param model: :type model: pytfa.ThermoModel :param total: whether to report the total number of reactions covered or the percentage. Default: True :type total: bool .. function:: get_thermo_reactions(model: pytfa.thermo.ThermoModel) 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 :math:`\Delta G_f`.