Comments (2)
This has to do with tolerances in the solver. A numerical solver is bound by floating point accuracy, thus it will never return the exact "true" solution of the problem but rather a solution within a certain tolerance. This is usually managed by a relative and absolute tolerance. What you are seeing here is the effect of the relative tolerance eps_rel
. The solver usually will only guarantee that your solutions will be within eps_rel * ||v||*
where ||.||*
is the infinity norm (maximum absolute value). The default value for eps_rel
with cplex is 1e-6 and you have at least one flux with a value of around 20, so your solution will be within a 1e-4 to 1e-6 of the real solution. All of those impossible imports are thus not distinguishable from zero for the solver.
I am working on an updated version that lets you define the threshold for returning imports. For now minimal_media
returns any import flux > 1e-6 but you will be able to change this cutoff soon. To alleviate this you can either drop imports below a certain threshold or decrease the solver tolerance with com.tolerance = 1e-8
, for instance. However, this will affect performance and may affect convergence. To put it into perspective, single bacteria have fL volumes and the default flux unit of micom is mmol/h. So that corresponds to less than a single molecule imported per cell and hour. This is unlikely to have a large impact on downstream analyses.
P.S.: I would also set min_growth=0.95*sol.members.growth_rate.drop("medium")
in minimal_media
. Otherwise you are loosing all the advantages from the cooperative tradeoff.
from micom.
Hi @cdiener,
Thank you for your answer, that makes perfect sense. Indeed I have very large values for my fluxes (hence very large error tolerance), this is because I don't use mmol/gDW/h but rather mmol/human/day. The reasoning was that, since AGORA models do not have any internal constraints, this should be transparent for the community model (the outputs should just be in the same units than the inputs, with no unintended consequences on the flux distribution). Since the goal was to compare results with other community modeling approaches that use mmol/human/day, but also to compare different literature diets that are reported in mmol/human/day (the VMH diets for instance), I wanted to avoid unnecessary conversions.
From your answer, I now realize though that MICOM might have some default thresholds that do expect fluxes in the range of mmol/gDW/h. Maybe I should change my workflow and actually convert my diets before running MICOM, and convert back my outputs after if I want to compare with other methods.
P.S.: I would also set min_growth=0.95*sol.members.growth_rate.drop("medium") in minimal_media. Otherwise you are loosing all the advantages from the cooperative tradeoff.
Indeed, I checked back the documentation and it's there. I think months ago I initially adapted what you did in the original MICOM paper https://github.com/micom-dev/paper/blob/master/workflows/media_and_gcs.py#L19-L41, which does not use the min_growth
parameter. I guess this functionality has been added later and I didn't notice. I'm really grateful for the tip, and will adapt my scripts.
Thank you again for your help.
Nils
from micom.
Related Issues (20)
- Documentation and default parameters do not match for micom.workflows.grow.grow HOT 1
- keyerror: '_gpr' when using 'load_pickle' HOT 2
- Support the `.sbml` extensions for SBML files
- Increase the number of threads for grow for a single model HOT 2
- Analyse sample growth on multiple media (multi threading) HOT 3
- "build" step stalling at 99% complete HOT 4
- Switch the multiprocessing default method to spawn
- Possible Bug in `com.knockout_taxa()` HOT 4
- UnboundLocalError when running minimal_media with `summarize=False` HOT 1
- saving intermediate output from "grow" HOT 1
- Issue: No Rendered Output When Following MICOM Documentation for Constraint-Based Modeling HOT 5
- [MICOM 1.0 API] Proposed new format for fluxes HOT 2
- Support for GTDB taxonomy? HOT 8
- Give the option to increase the compresslvl of model databases HOT 1
- interpretation of plot_exchanges_per_sample default behavior HOT 6
- Update and fix the docs
- Adjust active demands when loading models HOT 3
- Improve the warning for media metabolites with a missing transport reaction HOT 1
- Error while copying model using model.copy() HOT 2
- Adding coupling constraint to a coupling model
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micom.