Coder Social home page Coder Social logo

media's People

Contributors

cdiener avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jlubin24

media's Issues

Optimization error with VMH diets

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:

from micom import load_pickle
from micom.qiime_formats import load_qiime_medium

com = load_pickle("sample_x_model.pickle")
medium = load_qiime_medium("vmh_high_fat_low_carb_agora.qza")
com.medium = medium['flux']
sol = com.cooperative_tradeoff(fraction=0.5)

[19:38:52] WARNING  I could not find the following exchanges in your model:  community.py:668
                    EX_cellul_m, EX_datp_m, EX_nadp_m, EX_dtmp_m, EX_amet_m,                 
                    EX_tet_m, EX_starch1200_m, EX_cmp_m, EX_gtp_m,                           
                    EX_chsterol_m                                                            
[19:38:53] WARNING  solver encountered an error infeasible                    solution.py:220
           WARNING  solver encountered an error infeasible                    solution.py:220
OptimizationError: could not get community growth rate.
---------------------------------------------------------------------------
OptimizationError                         Traceback (most recent call last)
<ipython-input-27-c2178fd3e951> in <module>
      5 medium = load_qiime_medium("vmh_high_fat_low_carb_agora.qza")
      6 com.medium = medium['flux']
----> 7 sol = com.cooperative_tradeoff(fraction=0.5)

~/miniconda3/envs/qiime2/lib/python3.8/site-packages/micom/community.py in cooperative_tradeoff(self, min_growth, fraction, fluxes, pfba, atol, rtol)
    794             rtol = self.solver.configuration.tolerances.feasibility
    795 
--> 796         return cooperative_tradeoff(
    797             self, min_growth, fraction, fluxes, pfba, atol, rtol
    798         )

~/miniconda3/envs/qiime2/lib/python3.8/site-packages/micom/problems.py in cooperative_tradeoff(community, min_growth, fraction, fluxes, pfba, atol, rtol)
     77         com.objective = com.scale * com.variables.community_objective
     78         min_growth = (
---> 79             optimize_with_retry(com, message="could not get community growth rate.")
     80             / com.scale
     81         )

~/miniconda3/envs/qiime2/lib/python3.8/site-packages/micom/solution.py in optimize_with_retry(com, message)
    244         sol = com.optimize()
    245     if sol is None:
--> 246         raise OptimizationError(message)
    247     else:
    248         return sol.objective_value

OptimizationError: could not get community growth rate.

I am not sure what else to try in order to successfully implement the VMH diets. Any suggestions are greatly appreciated!

Thanks!!

Gapfill media with strain databases

Currently media are gapfilled on the genus level which means that they may not work on the species or strain level. By switching to strain levels this can be avoided. May be very slow for CarveME models though...

Western Diet dilution rates differ from dilution rates decided by vmh_template.ipynb

The dilution rates in the western_diet.qza are different from the dilution rates decided by the line of code in the vmh_template.ipynb, i.e diet.loc[diet.metabolite.isin(exchanges), "dilution"] = 0.2 .

I wanted to conduct an experiment to see the effect of adding 1gm of fennel (seeds) to the western_diet medium on the observed microbial growth rates. Interestingly, some metabolites (e.g. octadecenoate (n-C18:1)) had higher fluxes in 1gm of fennel (metabolites obtained via vmh diet designer) than in the corresponding flux for the western_diet.

Am I doing something wrong in porting the fluxes from vmh to MICOM? Do I have to do some additional diluting or division by hours on top of the vmh output?

can_grow remains False when reusing complete_db_medium results with new medium

Hi there,

I've recently begun using MICOM for microbiome data (can't thank you enough for the clear documentation!), and have been looking into using different diets from the VMH site. I tried rerunning the notebook for the high fat, low carb diet but came across something unusual. I recreated the agora database using the manifest table that we get after complete_db_medium, and saved both the database and the new medium vmh_high_fat_low_carb_agora.qza. However, when I re-ran check_db_medium with the new database and vmh_high_fat_low_carb_agora.qza I got all False for the can_grow column. Is this to be expected, or am I missing something? Any help would be appreciated, and please let me know if anything I've mentioned has been unclear.

Thanks,
Laura

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.