micom.viz.exchanges¶
Visualization for exchanges.
Functions¶
|
Plot the per sample exchange fluxes. |
|
Plot the exchange fluxes per taxon. |
Module Contents¶
- micom.viz.exchanges.plot_exchanges_per_sample(results: micom.workflows.results.GrowthResults, filename: str = 'sample_exchanges_%s.html' % datetime.now().strftime('%Y%m%d'), direction: str = 'import', cluster: bool = True) None [source]¶
Plot the per sample exchange fluxes.
- Parameters:
results (micom.workflows.GrowthResults) – The results returned by the grow workflow.
filename (str) – The HTML file where the visualization will be saved.
direction (str either "import" or "export") – The direction of fluxes to plot.
cluster (bool) – Whether to reorder samples so that samples with similar exchange fluxes are close to another.
- Returns:
A MICOM visualization. Can be served with viz.serve.
- Return type:
- micom.viz.exchanges.plot_exchanges_per_taxon(results: micom.workflows.results.GrowthResults, filename: str = 'taxon_exchanges_%s.html' % datetime.now().strftime('%Y%m%d'), direction: str = 'import', groups: pandas.Series = None, use_total_flux: bool = False, **tsne_args) None [source]¶
Plot the exchange fluxes per taxon.
- Parameters:
results (micom.workflows.GrowthResults) – The exchanges returned by the grow workflow.
filename (str) – The HTML file where the visualization will be saved.
direction (str either "import" or "export") – The direction of fluxes to plot.
groups (pandas.Series) – Additional metadata to color exchanges. The index must correspond to the sample_id in the results and values must be categorical. The .name attribute will be used to name the groups. If not provided will color by taxon.
use_total_fluxes (bool) – Whether to use fluxes normalized to 1gDW of bacteria or the total flux.
tsne_args (dict) – Additional arguments passed to TSNE.
- Returns:
A MICOM visualization. Can be served with viz.serve.
- Return type: