micom-dev / micom

Python package to study microbial communities using metabolic modeling.
https://micom-dev.github.io/micom
Apache License 2.0
82 stars 17 forks source link

Fraction variation influences "status" #29

Closed arianccbasile closed 3 years ago

arianccbasile commented 3 years ago

Hi! I have a question about the flag "status" which comes as an output when "cooperative_tradeoff" is run. In particular, sometimes I get as a result "optimal" but most of times I get "numeric". What does it mean?

Sincerely, Arianna Basile

cdiener commented 3 years ago

Just to clarify, do you mean if you run something like sol = com.cooperative_tradeoff(...) and look at sol.status? In this case, it means that the model has some numerical instabilities that prevent the solver from getting an optimal feasible solution in the target tolerance (1e-6 by default) but there is an optimal feasible solution when relaxing the tolerance a bit. Models that large can easily become unstable, mostly when either including taxa in very small abundances (relative abundances < 1e-4) or when having medium components with very small flux bounds (like 1e-6) that have large stoichiometries in reactions. For instance, starches are present in low molar fluxes but can yield 1000s of glucose molecules and that can make the problem harder to solve. It usually is still a fairly accurate solution up to a tolerance of 1e-5 or 1e-4.

The other situation where "status" can pop up is when you set the logging level to INFO, In that case, you might see reports of the status, however that is often fixed with the automatic crossover. QP solvers are usually less accurate so it is possible to get a numeric status in the QP step that is converted into an optimal solution by the crossover.

arianccbasile commented 3 years ago

Yes! Thank you a lot for all the information and to have offered some ideas to solve it. May I ask one more thing, did you consider to implement the usage of Harvey and Harvetta (ref. https://www.embopress.org/doi/full/10.15252/msb.20198982 ) in your pipeline? Is it already possible to use them within micom workflow?

cdiener commented 3 years ago

Yes that is somebody we are working on. Right now it would require some adjustments to make it work with micom since you have to connect the external medium of your community with the gut lumen in Harvetta/Harvey. What already works is using the exchanges from Harvetta/Harvey a medium input for MICOM (at least when using AGORA that has a comp[atible ID system).

arianccbasile commented 3 years ago

Awesome sauce!! Looking forward for that 🥇

cdiener commented 3 years ago

Great, closing for now. For general questions also feel free to use the Discussions.