riverplot_2categories

besca.pl.riverplot_2categories(adata: AnnData, categories: list, palette: Optional[dict] = None, threshold: Optional[int] = None, figsize=None) <module 'plotly.graph_objects' from '/Users/kohlem13/micromamba/envs/besca_create_docu/lib/python3.8/site-packages/plotly/graph_objects/__init__.py'>[source]

Generate a riverplot/sanker diagram between two categories. :param adata: anndata object containing data that is to be visualized :type adata: AnnData :param categories: list of strings identifying the columns that are to be plotted (should be in adata.obs) :type categories: [‘str’] :param palette: optional, dict where keys should be keys of the adata.obs[[categories]] and values colors of the node :type palette: dict : :param threshold: optional, threshold value, links below threshold will not be display :type threshold: int :param figsize: optional parameter to define the figure size of the plot that is to be generated :type figsize: (width, height) or None | default = None

Returns:

A matplotlib figure element containing the generated plot. To save the figure this plot will need to be passed to a parameter and saved in a second step through the fig.savefig() function call.

Return type:

Figure

Examples

>>> # import libraries and dataset
>>> import besca as bc
>>> adata = bc.datasets.simulated_Baron2016_processed()
>>> fig = bc.pl.riverplot_2categories(adata,  [ 'assigned_cluster', 'celltype2'])