schist.plotting

Package Contents

Functions

alluvial(adata[, level_start, level_end, key, gap, ...])

Generate an alluvial plot for NSBM hierarchy

draw_tree(adata[, level, color, color_map, block_key, ...])

Plots NSBM hierarchy using graph-tool capabilities

schist.plotting.alluvial(adata: anndata.AnnData, level_start: int = 1, level_end: int = None, key: str = 'nsbm', gap: float = 0.05, legend_fontsize: Union[int, float, Literal[xx - small, x - small, small, medium, large, x - large, xx - large]] = None, legend_fontweight: Union[int, Literal[light, normal, medium, semibold, bold, heavy, black]] = 'bold', axis_fontsize: Union[int, float, Literal[xx - small, x - small, small, medium, large, x - large, xx - large]] = None, axis_fontweight: Union[int, Literal[light, normal, medium, semibold, bold, heavy, black]] = 'bold')

Generate an alluvial plot for NSBM hierarchy

This plot may be useful to study the hierarchical relations in a Nested Model generated by scnbsm.inference.nested_model. Note that the level_end

adata

The annotated data matrix.

level_start

The deepest level in the hierarchy (i.e. the one with more clusters) Note that this parameter marks the leafs of the tree

level_end

The coarser level in hierarchy. Default value is None, if pruning has not been performed, it may be useful to exclude uninformative levels anyway Note that this parameter marks the root of the tree

key

The key used to group cells. Default is nsbm

gap

The gap between groups in percentage

schist.plotting.draw_tree(adata: anndata.AnnData, level: Union[str, int, None] = None, color: Union[str, None] = None, color_map: Union[matplotlib.colors.Colormap, str, None] = None, block_key: str = 'nsbm', ax: matplotlib.axes.Axes = None, show: bool = True, use_backend: str = None, save: Union[str, None] = None)

Plots NSBM hierarchy using graph-tool capabilities

adata

The annotated data matrix.

level

The NSBM level to be plot.

color

The adata.obs property used to generate color. It is mutually exclusive with level option.

color_map

Th colormap to use for continuous colors

save

Name of the output file. If a non interactive notebook is detected, this parameter is automatically set.

block_key

The key used to perform nsbm