Modfying Virtual Metabolic Human diets to be suitible for MICOM

Hello!
I am currently using MICOM to observe the changes in the gut microbiota at genus level. I have used the pre-built western diet environment provided but now I am trying to shift to diets provided by VMH (I have adjusted the units from day to hour). However, there were no growth rate for any of the genus. I didn't understand what could be a mistake or how could I modify the VMH diets. Thanks in advance!
@cdiener

1 Like

@seangibbons, Do you have any thoughts for this user?

2 Likes

Hi all,

Diet design is super tricky. If you're designing a new diet, then it's common not to get growth in your models. Custom diets will often lack little things, like cofactors, that are necessary for growth. MICOM has a function called 'try_complete' that attempts to add a minimal set of components to a medium that enable growth of your taxa/taxon (micom.workflows.db_media - version 0.33.1). There's a short tutorial on fixing growth media here: MICOM workflows - version 0.33.1

In addition, @cdiener has built several media, in addition to the VMH media, which are available here: GitHub - micom-dev/media: Environmental growth media for MICOM.

-sean

4 Likes

Thank you so much for your reply @seangibbons!!
I have directly used the diet provided at Virtual Metabolic Human. I converted the flux values from day to hours and used them as inputs. Then, I tried <fix_medium>. I thought that conversion would be enough. However, I realized that, after the converted version of the the western diet I had from AGORA database didn't match with the diets provided at GitHub - micom-dev/media: Environmental growth media for MICOM.. Maybe I am missing a point out.
Thanks again!

Hi, we provide a template to convert VMH diets. Maybe that helps.

Best

2 Likes

Hi @cdiener ,
Thanks for your reply. I checked out the template to convert the diets. When I apply them to my case I encounter such an error thatI couldn't understand. I am using cplex as my solver. I appreciate if you could help me about it.. Kind regards

Traceback (most recent call last):
File "dietconvert.py", line 38, in
manifest, imports = complete_db_medium("agora103.qza", candidate_medium, growth=0.01, threads=4, max_added_import=10, weights='mass')
File "/home/new_env/lib/python3.8/site-packages/micom/workflows/db_media.py", line 219, in complete_db_medium
results = workflow(_try_complete, args, threads)
File "/home/new_env/lib/python3.8/site-packages/micom/workflows/core.py", line 95, in workflow
results = list(it)
File "/home/new_env/lib/python3.8/site-packages/rich/progress.py", line 168, in track
yield from progress.track(
File "/home/new_env/lib/python3.8/site-packages/rich/progress.py", line 1209, in track
for value in sequence:
File "/usr/lib/python3.8/multiprocessing/pool.py", line 868, in next
raise value
multiprocessing.pool.MaybeEncodingError: Error sending result: '<multiprocessing.pool.ExceptionWithTraceback object at 0x7f677d0bafd0>'. Reason: 'TypeError("cannot pickle 'PyCapsule' object")'

Hi, are you using Gurobi by any chance. If yes, you could check out this post. Otherwise I would try to update or rebuild your MICOM conda environment because that can sometimes be caused by outdated packages.

1 Like

Hi! I am using cplex, I also tried pickling the complete_db_medium with dill or other ways but I couldn't do that either.

Hmm, with cplex I have only seen that for people that did have some issues with the license because multiprocessing then tries to pickle the returned error type. Can you run complete_db_medium with threads=1 and paste the full error traceback here?

1 Like

Hi again! Thank you for you time.. I am pasting the error traceback when I used https://github.com/micom-dev/media/blob/main/recipes/vmh_template.ipynb code from this site and modifying the threads from 12 to 1.
Even though I didn't use gurobi, this error popped.

ompleting 227 genus-level models on a medium with 118 components (0 strict).
Running ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0% -:--:--
Traceback (most recent call last):
File "dietconvert.py", line 104, in
a = complete_db_medium("agora103.qza", skeleton, growth=0.01, threads=1, max_added_import=10, weights='mass')
File "/home/new_env/lib/python3.8/site-packages/micom/workflows/db_media.py", line 219, in complete_db_medium
results = workflow(_try_complete, args, threads)
File "/home/new_env/lib/python3.8/site-packages/micom/workflows/core.py", line 84, in workflow
return list(it)
File "/home/new_env/lib/python3.8/site-packages/rich/progress.py", line 168, in track
yield from progress.track(
File "/home/new_env/lib/python3.8/site-packages/rich/progress.py", line 1209, in track
for value in sequence:
File "/home/new_env/lib/python3.8/site-packages/micom/workflows/db_media.py", line 42, in _try_complete
fixed = mm.complete_medium(
File "/home/new_env/lib/python3.8/site-packages/micom/media.py", line 377, in complete_medium
sol = model.optimize(raise_error=True)
File "/home/new_env/lib/python3.8/site-packages/cobra/core/model.py", line 1232, in optimize
self.slim_optimize()
File "/home/new_env/lib/python3.8/site-packages/cobra/core/model.py", line 1194, in slim_optimize
self.solver.optimize()
File "/home/new_env/lib/python3.8/site-packages/optlang/interface.py", line 1515, in optimize
status = self._optimize()
File "/home/new_env/lib/python3.8/site-packages/optlang/gurobi_interface.py", line 677, in _optimize
self.problem.optimize()
File "src/gurobipy/model.pxi", line 878, in gurobipy.Model.optimize
gurobipy.GurobiError: Model too large for size-limited license; visit Free Trial - Gurobi Optimization for a full license
(new_env) @Ubuntuu:~/new_env$

Okay, you are using Gurobi and not CPLEX as can be seen from the last lines. For Gurobi or CPLEX you will need a full license to run the code (there are free academic full lcense but you will need to sign up for them). In your case you could just uninstall Gurobi from your environment with conda remove gurobi if you are sure you have a full CPLEX version installed. Also see here. Hope that helps.

1 Like

Thank you so much for sparing your time! The problem is solved!

1 Like

Nice! How did you fix it? Might be interesting for other people finding this post.

Hi! Sorry for the late reply..
I deleted gurobi and reinstalled cplex. I see no more errors but I am still trying to create the diets
Thanks a lot!