cdanielmachado / carveme

CarveMe: genome-scale metabolic model reconstruction
Other
149 stars 51 forks source link

Gapfill fails to load sbml: VMH models #54

Closed arvindjs closed 5 years ago

arvindjs commented 5 years ago

Converted VMH (https://www.vmh.life) matlab models(The xml ones have extra metabolite identifiers) into mostly bigg compliant identifiers except when there was no metabolite equivalent. I try gap filling on custom media using the gapfill carveme because, faster and considers entire bigg universe and Cobrapy's gapfilling is not as good and reports infeasible if the search space is big, but will gapfill if you give a targetted set of reactions you know contains the solution. Anyway I am unable to load the model with --fbc2 or --cobra. (gapfill fails while loading, Everything however works without a hitch on embl gems created using carveme) I might have made an error with the parsing(converting agora matlab to bigg sbml), posting here incase anyone has some specific insights into the issue or has faced something similar can help me out.

When I use --fbc2

Loading model... Traceback (most recent call last): File "/usr/local/bin/gapfill", line 118, in verbose=args.verbose) File "/usr/local/bin/gapfill", line 19, in main model = load_cbmodel(inputfile, flavor=flavor) File "/usr/local/lib/python3.6/dist-packages/framed/io/sbml.py", line 146, in load_cbmodel load_gprs=load_gprs, load_metadata=load_metadata) File "/usr/local/lib/python3.6/dist-packages/framed/io/sbml.py", line 104, in load_sbml_model load_gprs=load_gprs, load_metadata=load_metadata) File "/usr/local/lib/python3.6/dist-packages/framed/io/sbml.py", line 315, in _load_cbmodel _load_fbc2_bounds(sbml_model, model) File "/usr/local/lib/python3.6/dist-packages/framed/io/sbml.py", line 436, in _load_fbc2_bounds model.set_flux_bounds(reaction.getId(), params[lb], params[ub]) KeyError: ''

When i use --cobra

Loading model... Traceback (most recent call last): File "/usr/local/bin/gapfill", line 118, in verbose=args.verbose) File "/usr/local/bin/gapfill", line 19, in main model = load_cbmodel(inputfile, flavor=flavor) File "/usr/local/lib/python3.6/dist-packages/framed/io/sbml.py", line 148, in load_cbmodel fix_cb_model(model, flavor=flavor) File "/usr/local/lib/python3.6/dist-packages/framed/model/fixes.py", line 24, in fix_cb_model default_fixes(model) File "/usr/local/lib/python3.6/dist-packages/framed/model/fixes.py", line 36, in default_fixes clean_bounds(model) File "/usr/local/lib/python3.6/dist-packages/framed/model/fixes.py", line 104, in clean_bounds if reaction.lb <= -threshold: TypeError: '<=' not supported between instances of 'NoneType' and 'int'

Attaching the AGORA1.03 matlab model converted to sbml cobrapy ver0.14.2, carveme ver1.2.1, framed ver0.5.1 Abiotrophia_defectiva_ATCC_49176.xml.txt

Thanks in advance

cdanielmachado commented 5 years ago

Hi @arvindjs

This is caused by a bug in framed that was fixed but is not yet in the pypi respository.

Can you please update your version of framed using:

pip install -U https://github.com/cdanielmachado/framed/archive/master.zip

Also, for this model you should use --fbc2.

Let me know if this works.

arvindjs commented 5 years ago

Yes, That seems to have fixed it. Thank you @cdanielmachado Also, I found some reaction identifiers were not changed correctly. (Demand and sink reactions: They still had parentheses to denote compartments, do not know if that anything to do with the error though)