cdanielmachado / carveme

CarveMe: genome-scale metabolic model reconstruction
Other
145 stars 49 forks source link

Example of how to specify hard constraints? #107

Closed afvrbanac closed 3 years ago

afvrbanac commented 3 years ago

I'm working with genomes from obligate anaerobes which absolutely do not grow in the presence of oxygen. However, the models I generated do not reflect this, in fact, they have no growth when I set o2 to zero :(

As per the documentation I wanted to specify the hard constraint that oxygen uptake is zero. Is there an example of the data.tsv file that is referenced? I've tried EX_o2_e, o2_e, o2 in the first column and 0, 0 for the upper and lower bounds, but I just get the error:

UserWarning: Hard constraints contain reactions not in the model: EX_o2_e

cdanielmachado commented 3 years ago

It should be R_EX_o2_e :)

Please let me know if it doesn't work.

afvrbanac commented 3 years ago

Thanks for answering my dumb question! I'm new to this.

So it does work, except I now get this error after completing the diamond alignment step:

AttributeError: 'CplexSolver' object has no attribute 'set_bounds'

Full error message is:

File "/Users/avrbanac/miniconda3/envs/carveme/bin/carve", line 8, in sys.exit(main()) File "/Users/avrbanac/miniconda3/envs/carveme/lib/python3.7/site-packages/carveme/cli/carve.py", line 377, in main ref_score=args.reference_score File "/Users/avrbanac/miniconda3/envs/carveme/lib/python3.7/site-packages/carveme/cli/carve.py", line 212, in maincall debug_output=debug_output) File "/Users/avrbanac/miniconda3/envs/carveme/lib/python3.7/site-packages/carveme/reconstruction/carving.py", line 234, in carve_model ref_reactions=ref_reactions, ref_score=ref_score, debug_output=debug_output) File "/Users/avrbanac/miniconda3/envs/carveme/lib/python3.7/site-packages/carveme/reconstruction/carving.py", line 82, in minmax_reduction solver.set_bounds(hard_constraints) AttributeError: 'CplexSolver' object has no attribute 'set_bounds'

cdanielmachado commented 3 years ago

I am afraid this is a bug, I will have to fix in in the next release. Sorry for that.