cdanielmachado / carveme

CarveMe: genome-scale metabolic model reconstruction
Other
147 stars 50 forks source link

NameError: name 'KeggModel' is not defined #69

Closed MarieBurel closed 4 years ago

MarieBurel commented 4 years ago

Dear Daniel, Running build_universe --thermo requires KeggModel class from component_contribution.kegg_model, but component-contribution python package doesn't seem to implement KeggModel (actually, I can't find kegg_model from source code https://gitlab.com/equilibrator/component-contribution). Thus, I get the following error:

$ build_universe --thermo
Traceback (most recent call last):
  File "/home/marie/.local/bin/build_universe", line 216, in <module>
    outputfile=args.output)
  File "/home/marie/.local/bin/build_universe", line 43, in main
    compute_bigg_gibbs_energy(universe_draft, equilibrator_compounds, bigg_gibbs)
  File "/home/marie/.local/lib/python3.7/site-packages/carveme/universe/thermodynamics.py", line 140, in compute_bigg_gibbs_energy
    dG0, sdG0 = calculate_deltaG0s(model, kegg_compounds, pH=default_pH, I=default_I, T=default_T)
  File "/home/marie/.local/lib/python3.7/site-packages/carveme/universe/thermodynamics.py", line 106, in calculate_deltaG0s
    kmodel = KeggModel.from_formulas(list(kegg_rxns.values()), raise_exception=True)
NameError: name 'KeggModel' is not defined

Thank you for your help!

cdanielmachado commented 4 years ago

This was implemented using a version of component-contribution downloaded in 2017...

There was no official release at the time, but the commit version was probably this one:

https://github.com/eladnoor/component-contribution/commit/ad5b62ecf05530c192a9c12971960e8305004692

I suppose that @eladnoor has restructured the code quite a lot. I need to update CarveMe to catch up with their latest version.

eladnoor commented 4 years ago

Hi,

Indeed a lot has changed since 2017. I will be really happy to help with the update if necessary. From a quick look, it seems that it won't be too difficult, and actually the latest versions make things easier since they support BiGG names directly (no need to convert them to KEGG anymore).

By the way, @cdanielmachado , note that the entire project was moved to GitLab and released on PyPI as equilibrator-api.

cdanielmachado commented 4 years ago

Thanks, I will be happy to upgrade to the latest version, it will make my life easier now that it supports BiGG compounds directly! :)

MarieBurel commented 4 years ago

Hi, Thank you for your help! @cdanielmachado Do you plan to upgrade to the latest version in the next few days, or should I modify locally the script by myself?

cdanielmachado commented 4 years ago

I can only prepare a new release in 1-2 months, at the moment I do not have time to do it. Please feel free to change your own code locally.

MarieBurel commented 4 years ago

Thank you. I'll have a look. Can't wait to see your future updates. (Closing)