cellrank.pl.aggregate_fate_probabilities¶
- cellrank.pl.aggregate_fate_probabilities(adata, mode='paga_pie', backward=False, lineages=None, cluster_key='clusters', clusters=None, basis=None, cbar=True, ncols=None, sharey=False, fmt='0.2f', xrot=90, legend_kwargs=mappingproxy({'loc': 'best'}), figsize=None, dpi=None, save=None, **kwargs)[source]¶
Plot aggregate lineage probabilities at a cluster level.
This can be used to investigate how likely a certain cluster is to go to the terminal states, or in turn to have descended from the initial states. For mode ‘paga’ and ‘paga_pie’, we use PAGA [Wolf et al., 2019].
- Parameters:
adata (
AnnData) – Annotated data object.mode (
Literal['bar','paga','paga_pie','violin','heatmap','clustermap']) –Type of plot to show. Valid options are:
'bar'- barplot, one panel per cluster. The whiskers correspond to the standard error of the mean.'paga'-paga(), one per initial or terminal state, colored in by fate.'paga_pie'-paga()with pie charts indicating aggregated fates.'violin'- violin plots, one per initial or terminal state.'heatmap'- a heatmap, showing average fates per cluster.'clustermap'- same as a heatmap, but with a dendrogram.
backward (
bool) – Direction of the process.lineages (
str|Sequence[str] |None) – Lineages for which to visualize the fate probabilities. IfNone, use all lineages.cluster_key (
str|None) – Key inobscontaining the clusters.clusters (
str|Sequence[str] |None) – Clusters to visualize. IfNone, all clusters will be plotted.basis (
str|None) – Basis for scatterplot to use whenmode = 'paga_pie'. IfNone, don’t show the scatterplot.cbar (
bool) – Whether to show colorbar whenmode = 'paga_pie'.ncols (
int|None) – Number of columns whenmode = 'bar'ormode = 'paga'.sharey (
bool) – Whether to share y-axis whenmode = 'bar'.fmt (
str) – Format when usingmode = 'heatmap'ormode = 'clustermap'.xrot (
float) – Rotation of the labels on the x-axis.legend_kwargs (
Mapping[str,Any]) – Keyword arguments forlegend(). Formode = 'paga_pie'andbasis = '...', this controls the placement of the fate probabilities legend.figsize – Size of the figure.
kwargs (
Any) – Keyword arguments forpaga(),violin()orbar(), depending on themode.
- Return type:
- Returns:
: Nothing, just plots the figure. Optionally saves it based on
save.
Notes
For
mode = 'paga_pie', directed edges are shown only whenadata.uns['paga']['transitions_confidence']is present. This key is produced by scVelo’s PAGA extension (paga()), which augments the standard scanpy PAGA graph with directed transition confidences. When only scanpy’spaga()has been run, edges are undirected.