micom-dev / micom

Python package to study microbial communities using metabolic modeling.
https://micom-dev.github.io/micom
Apache License 2.0
89 stars 18 forks source link

interpretation of plot_exchanges_per_sample default behavior #38

Closed mmp3 closed 3 years ago

mmp3 commented 3 years ago

The "Plotting consumed metabolites" section of the documentation describes the function plot_exchanges_per_sample with default parameter direction='import' as plotting the metabolites consumed by the microbial community.

In the source code for plot_exchanges_per_sample, the subset with taxon='medium' is selected. But isn't the "import" for the 'medium' actually the export for the microbial community? This seems at odds with the description of plot_exchanges_per_sample(direction='import') as plotting the consumption patterns of the microbes.

Perhaps I am misinterpreting the direction of the fluxes for the 'medium' in the output of the grow function?

cdiener commented 3 years ago

Metabolites can enter the extracellular space either via (1) production by microbes or by (2) coming into the extracellular space from the environment (from food components or the host). plot_exchanges_per_sample(..., direction='import') denotes (2). Case (1) is called "production flux" in MICOM and is used for the phenotype prediction for instance. Due to the involved optimizations (2) is usually minimized and thus is equal to the required influx of a metabolite from the environment to maintain the observed growth rates (under the constraints put in place by the medium).

mmp3 commented 3 years ago

Very helpful, thank you. Is Case (2) the interpretation of plot_exchanges_per_sample(..., direction='export') ?

cdiener commented 3 years ago

Case 2 is direction="import". Here import just means things coming into the system. Maybe not the best term since it makes it sound like an active process and not the passive diffusion that it is.

direction="export" denotes fluxes leaving the system, so compounds that are produced by microbes and not consumed by any other microbe and therefore diffuse out of the system.

mmp3 commented 3 years ago

Pardon my typo, I meant to ask if Case (1) is the interpretation of plot_exchanges_per_sample(..., direction='export'), which from your response I take to be 'yes'?

cdiener commented 3 years ago

Yep pretty much, direction="export" gives you production_by_microbes - readsorption_by_microbes. When we talk about "production fluxes" in MICOM we mean only the production_by_microbes part regardless of the readsorption.

cdiener commented 3 years ago

Closing for now. Feel free to open a discussion topic if there are more questions :+1: