geckopy.integration.pytfa¶
Integration layer with pytfa. Pytfa is not installed by default.
Module Contents¶
Classes¶
Derived class to guard LC_vars against rewriting. |
Functions¶
|
Prepare and convert gecko model to pytfa.ThermoModel. |
|
Equal \(\Delta G_f\) of pseudometabolites to their opposite sides. |
|
Add a seed_id annotation to every metabolite. |
|
Deserialize the thermoDB to a compressed file at filename. |
|
Return the number of reactions that were assigned a thermodynamic variable. |
|
Return the set of reactions that were assigned a thermodynamic variable. |
- class geckopy.integration.pytfa.ThermoModel[source]¶
Bases:
pytfa.ThermoModelDerived 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.
- 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
model (geckopy.Model) –
thermodb (Dict) – from pytfa.io.load_thermo. The format is explained at https://pytfa.readthedocs.io/en/latest/thermoDB.html
compartment_data (Dict) – check https://pytfa.readthedocs.io/en/latest/model.html#compartment-data
*args – which will be passed to the pytfa.ThermoModel.__init__
**kwargs – which will be passed to the pytfa.ThermoModel.__init__
- 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