-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimization error with VMH diets #2
Comments
Hmm, I just tried with a model I had laying around and it did work:
The following info would be helpful:
|
Update: |
Yeah, the media are only completed on the genus level. Probably better to do it on the strain level. I will switch to this strategy. This medium is definitely complicated though since it simply does not contain enough carbon sources for Bacteria to grow. I'm also planning to add in mucin to alleviate this a bit. |
|
That doesn't look too bad though. Can you paste the code you are using to complete the strain medium and use it? |
I am starting with the current qiime medium available on this repo. ` from micom.workflows.db_media import complete_db_medium manifest, imports = complete_db_medium("AGORA-with-MUCINS.zip", medium, growth=1e-4, import pandas as pd fluxes = imports.max() from qiime2 import Artifact arti = Artifact.import_data("MicomMedium[Global]", completed) To grow the samples:medium = load_qiime_medium('vmh_high_fat_low_carb_strain.qza') |
I see. It looks like "AGORA-with-MUCINS.zip" is the AGORA file downloaded from VMH. This is by itself not a valid MICOM model database so I'm pretty sure the problem lies there. MICOM model databases are the ones that you can download from https://zenodo.org/record/3755182 or one that was created using The completed medium looks okay though. Hard to say what the problem is without seeing the actual models. This should only happen if the strains in your community are exactly the strains that could not grow in the optimization. How many strains are there for each model? Numerical issues usually get worse the larger the model gets, though we have run a few models with 100+ taxa and it usually worked... |
The "AGORA-with-MUCINS.zip" was built with MICOM's The samples have on average 55 strains (max of 109) in each model. It doesn't look like the number of strains matched in the sample correlates with whether the optimization fails or not. Is there a way I could send a few samples that the optimization is failing? I am unable to attach them here. |
Ah, that makes more sense. Definitely, you can send me the file or a Google drive link to |
Thanks for the models. I checked them and surprisingly some of the AGORA models have demand reactions and since those can't be fulfilled in low nutrient conditions you get the infeasibility. So no numerical issues, the models were indeed infeasible 😅 For instance, for sample 1, the following fixes the issue:
This should be addressed in MICOM by adjusting those bounds. Having growth rate-independent demands is not good practice, This can also trip up complete_medium, so this should also work better after that. Hopefully, I'll find some time to get to this soon. |
Thank you! I am now able to simulate all my samples by looking for reactions with positive lower bounds or negative upper bounds and changing the bounds to 0. |
Awesome, looks like this was the issue then. Now tracked in micom-dev/micom#56 |
Hello,
I've been trying to run simulations with the diets other than the western diet (which runs without any problems) to work with MICOM and the AGORA models. To start I have been focusing on the VMH high fat low carbs diet you have provided that is compatible with MICOM.
The problem arises when I use the grow function with the VMH high fat low carbs diet. The majority of samples no longer are able to grow and I get the following error:
"Could not solve cooperative tradeoff for sample_x. This can often be fixed by enabling
presolve
, choosing more permissive atol and rtol arguments, or by checking that medium fluxes are > atol."As the error suggestions, I tried the same setup with presolve enabled and the same error was returned.
I then found the following issue (micom-dev/paper#5) where you suggest directly running the cooperative_tradeoff function to get more specific error messages.
The following is the output I got from trying cooperative_tradeoff directly:
I am not sure what else to try in order to successfully implement the VMH diets. Any suggestions are greatly appreciated!
Thanks!!
The text was updated successfully, but these errors were encountered: