micom.viz.exchanges =================== .. py:module:: micom.viz.exchanges .. autoapi-nested-parse:: Visualization for exchanges. Functions --------- .. autoapisummary:: micom.viz.exchanges.plot_exchanges_per_sample micom.viz.exchanges.plot_exchanges_per_taxon Module Contents --------------- .. py:function:: 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 Plot the per sample exchange fluxes. :param results: The results returned by the `grow` workflow. :type results: micom.workflows.GrowthResults :param filename: The HTML file where the visualization will be saved. :type filename: str :param direction: The direction of fluxes to plot. :type direction: str either "import" or "export" :param cluster: Whether to reorder samples so that samples with similar exchange fluxes are close to another. :type cluster: bool :returns: A MICOM visualization. Can be served with `viz.serve`. :rtype: Visualization .. py:function:: 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 Plot the exchange fluxes per taxon. :param results: The exchanges returned by the `grow` workflow. :type results: micom.workflows.GrowthResults :param filename: The HTML file where the visualization will be saved. :type filename: str :param direction: The direction of fluxes to plot. :type direction: str either "import" or "export" :param groups: 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. :type groups: pandas.Series :param use_total_fluxes: Whether to use fluxes normalized to 1gDW of bacteria or the total flux. :type use_total_fluxes: bool :param tsne_args: Additional arguments passed to TSNE. :type tsne_args: dict :returns: A MICOM visualization. Can be served with `viz.serve`. :rtype: Visualization