Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No n_reactions_thermo in TFA results when building thermodb from cobra model #58

Open
ElderMedic opened this issue Nov 13, 2024 · 5 comments

Comments

@ElderMedic
Copy link

No description provided.

@ElderMedic
Copy link
Author

Hey, I tried to run your tutorial script in dockerized pytfa environment: https://github.com/EPFL-LCSB/pytfa/blob/master/tutorials/tutorial_equilibrator.py And trying to build thermo db based on cobra model glycolysis.mat and also the reduced e-coli model.

As the result shows I have 0 reaction in the model that have thermodynamic constraints applied to them.

`
2024-11-13 16:55:56,318 - thermomodel_new - INFO - # Model preparation done.
2024-11-13 16:55:56,319 - thermomodel_new - INFO - # Model conversion starting...
2024-11-13 16:55:57,290 - thermomodel_new - INFO - # Model conversion done.
2024-11-13 16:55:57,292 - thermomodel_new - INFO - # Updating cobra_model variables...
2024-11-13 16:55:57,299 - thermomodel_new - INFO - # cobra_model variables are up-to-date
value
key
name new
description new
num constraints 1019
num variables 1287
num metabolites 215
num reactions 268
value
key
num metabolites(thermo) 215
num reactions(thermo) 0
pct metabolites(thermo) 100
pct reactions(thermo) 0
Some fluxes
DM_4CRSOL 0.000118
DM_5DRIB 0.000122
DM_AMOB 0.000001
DM_MTHTHF 0.000709
Ec_biomass_iJO1366_WT_53p95M 0.529469
Name: fluxes, dtype: float64

Onjective solution: 0.5294692065760227

Total sum of fluxes: 160.31493578399147
`

Is this expected? Does it mean the result/model is not reliable/feasible?

@ElderMedic ElderMedic changed the title No n_reactions_thermo in TFa results No n_reactions_thermo in TFA results when building thermodb from cobra model Nov 13, 2024
@ElderMedic
Copy link
Author

I also have many "2024-11-13 17:39:56,907 - eQuilibrator_formation - DEBUG - 248 : thermo data NOT created, error : 'ComponentContribution' object has no attribute 'dG0_prime'" such error in the equilibrator logs.

@ElderMedic
Copy link
Author

ElderMedic commented Nov 13, 2024

def compute_dGf(compound, cc):
    """Get ΔGf from equilibrator `compound`."""
    dG0_prime, dG0_uncertainty = cc.dG0_prime(
        PhasedReaction(sparse={compound: 1}, rid="tmp_"+compound.id)
    )
    return dG0_prime, dG0_uncertainty

I don't find cc.dG0_prime() method in equilibrator_api.ComponentContribution, so consider this a bug.
Change it to standard_dg_prime instead does not immediately fix everything and got me a lot of new issues, so the input is not correct now...

@ElderMedic
Copy link
Author

and why is charge_std=None in the returned dict of equilibrator.compound_to_entry?

> /src/pytfa/pytfa/thermo/utils.py(67)check_reaction_balance()
-> sum_charge += metCharge * metCoeff
(Pdb) p metCharge
None

This will no doubt cause following process to fail...

@ElderMedic
Copy link
Author

Please dear dev, share your docker container that you did all your testing. I can't even build and run your dockerfile without hardcoding each package's version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant