Skip to content
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

CarveMe Models without Gap Filling for Smetana #39

Open
pbelmann opened this issue Mar 22, 2023 · 8 comments
Open

CarveMe Models without Gap Filling for Smetana #39

pbelmann opened this issue Mar 22, 2023 · 8 comments

Comments

@pbelmann
Copy link

Thank you for developing smetana!
I just have a general question. I'm currently building models with carveme by using the default command (carve genome.faa) without
specifying any media via --gapfill. I use these models then as input for smetana (smetana -g --flavor bigg), again without specifying any media with -m. My question is now, how reliable are the MRO and MIP metrics if I can not specify the media at all?

@franciscozorrilla
Copy link

Gapfilling the models prior to running SMETANA global metrics should result in some changes to the calculated scores (depending on how much metabolism was gapfilled), but you cannot actually specify media when running the global metrics due to the way they are implemented. You can only specify the media when running SMETANA detailed interactions, whch should indeed result in different metabolic exchanges.

@CODRbio
Copy link

CODRbio commented Jun 30, 2024

Gapfilling the models prior to running SMETANA global metrics should result in some changes to the calculated scores (depending on how much metabolism was gapfilled), but you cannot actually specify media when running the global metrics due to the way they are implemented. You can only specify the media when running SMETANA detailed interactions, whch should indeed result in different metabolic exchanges.

does that mean even I provide -m parameter, it will not influence the results of the global mip?

@franciscozorrilla
Copy link

franciscozorrilla commented Jul 1, 2024

This is a good question. The idea of the global metrics is that they are inherent to the community, please have a look at the original SMETANA paper for implementation details, as well as this more recent study:

The MIP indicates the number of metabolites that can be exchanged among the community members to decrease their dependency on the abiotic environment. In this work, we use the MIP value as a proxy measure for cooperative metabolism. MRO and MIP estimate the respective interaction metrics at their theoretical limit and therefore do not require information on the resources actually available in the habitat. The operating degree of competition and cooperation in a given community will therefore be habitat dependent. The context-independent nature of MRO and MIP makes them suitable for application to co-occurring communities spanning multiple and diverse habitats. Furthermore, the presence of several co-occurring groups of species in diverse habitats suggests that these communities are to some extent independent of their abiotic environment. We also evaluated the ability of MIP to capture biologically meaningful interactions from a systematic screen of pairwise cultures of Escherichia coli mutants with engineered amino acid auxotrophies28. We observe that the MIP score is positively associated with higher co-culture growth yields (Supplementary Fig. 1). This result, together with the previous comparisons of experimental data15,29, support the relevance of the SMETANA simulations.

However, based on the actual code, it looks like the function to calculate scores can indeed take in a medium composition. Like I mentioned in my other response, I have not used the global metrics too much in my research compared to the detailed metrics, so I would recommend you to try out small experiments with media specification vs not, to see how it may affect your results.

smetana/smetana/smetana.py

Lines 234 to 251 in d2b1043

def mip_score(community, environment=None, min_mol_weight=False, min_growth=0.1, direction=-1, max_uptake=10,
validate=False, verbose=True, use_lp=False, exclude=None):
"""
Implements the metabolic interaction potential (MIP) score as defined in (Zelezniak et al, 2015).
Args:
community (Community): microbial community model
environment (Environment): Metabolic environment in which the SMETANA score is calculated
direction (int): direction of uptake reactions (negative or positive, default: -1)
extracellular_id (str): extracellular compartment id
min_mol_weight (bool): minimize by molecular weight of nutrients (default: False)
min_growth (float): minimum growth rate (default: 0.1)
max_uptake (float): maximum uptake rate (default: 10)
validate (bool): validate solution using FBA (for debugging purposes, default: False)
Returns:
float: MIP score
"""

I would also recommend you to keep an eye on this newly developed tool SteadierCom, still unpublished, but will be a drop-in replacement for SMETANA, developed by Daniel Machado (CarveMe, SMETANA dev).

@CODRbio
Copy link

CODRbio commented Jul 1, 2024

Thanks! I'll try to go through all the papers and try the new toolkit.

@ABU789456
Copy link

Thank you for developing smetana!
I used carveme to create a metabolic model of the genome with the following code:
carve --dna OceanDNA-b14820.fasta --solver scip
Use smetana to calculate mip and mro simultaneously, the code is as follows:
*smetana xml -c community.tsv -o final_result
The following warning appears:
/project/wujp/miniconda3/envs/cplex/lib/python3.8/site-packages/smetana/smetana.py:351: UserWarning: MRO: Failed to find a valid solution for: OceanDNA-b27576
warn('MRO: Failed to find a valid solution for: ' + org_id)
/project/wujp/miniconda3/envs/cplex/lib/python3.8/site-packages/smetana/smetana.py:351: UserWarning: MRO: Failed to find a valid solution for: OceanDNA-b27519
warn('MRO: Failed to find a valid solution for: ' + org_id)
/project/wujp/miniconda3/envs/cplex/lib/python3.8/site-packages/smetana/smetana.py:351: UserWarning: MRO: Failed to find a valid solution for: OceanDNA-b27518
warn('MRO: Failed to find a valid solution for: ' + org_id)

mip showed a lot of n/a, but mro calculated normally.
I also tried to add --flavor bigg and fbc2, --molweight, mip still shows n/a, and --mediadb is not specified.I would appreciate it if you could give me a solution. Thank you!

@ABU789456
Copy link

Use this code, which says there is a problem: smetana *xml-c community.tsv-o final_result

@CODRbio
Copy link

CODRbio commented Jul 3, 2024

However, based on the actual code, it looks like the function to calculate scores can indeed take in a medium composition. Like I mentioned in my franciscozorrilla/metaGEM#163 (comment), I have not used the global metrics too much in my research compared to the detailed metrics, so I would recommend you to try out small experiments with media specification vs not, to see how it may affect your results.

After conducting some experiments, I suggest not using the -m option during stimulation when you only need global MIP and MRO. Including this parameter prompts the solver to verify whether the microbiome can survive on the given media, and it will terminate if the species fails this check. However, what we require is a statistical analysis.
For gapping, it might be reasonable to use full media gapping for MAGs without manual adjustment. As franciscozorrilla mentioned, higher mips will be generated with poorer media.

@ABU789456
Copy link

Thank you for your suggestion, I did not add the -m option, but the result of mip is n/a, how should I solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants