Advance Plotting

Alluvial Plots

schist provides an interface to graph-tool to infer Nested Stochastic Block Models from single cell data in scanpy. Once models are built, data are partitioned in multiple groups, linked together in hierarchical way. In order to represent a hierarchy, schist implements a simple plot function that represents data using alluvial plots:

adata ='adata')
alternate text

This function will plot all levels in hierarchy by default. As many level are uninformative, they can be excluded from the plot

adata ='adata'), level_end=5)
alternate text

Leaf levels can be also excluded

adata ='adata'), level_end=5, level_start=2)
alternate text


graph-tools has built-in functionalities to plot graphs. Some of these have been implemented into schist using a syntax compatibile with scanpy’s functions. Note that Fruchterman-Reingold spring-block layout is already implemented into scanpy, and it gives the same output.

adata ='adata'), layout='fr'), layout='fr', color='nsbm_level_2', legend_loc='on data')
alternate text

However, schist allows to seed the plot using the graph tree.

adata ='adata'), layout='fr', use_tree=True), layout='fr', color='nsbm_level_2')
alternate text

Default layout is SFDP spring-block layout

adata ='adata'), layout='sfdp', color='nsbm_level_2', legend_loc='on data')
alternate text

With tree information

adata ='adata'), use_tree=True), layout='sfdp', color='nsbm_level_2')
alternate text