cellrank.pl.cluster_fates¶
-
cellrank.pl.
cluster_fates
(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, see [Wolf19].
- Parameters
adata¶ (
anndata.AnnData
) – Annotated data object.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’ - scanpy’s PAGA, one per initial or terminal state, colored in by fate.
’paga_pie’ - scanpy’s 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.
lineages¶ (
Union
[str
,Sequence
[str
],None
]) – Lineages for which to visualize absorption probabilities. If None, use all lineages.cluster_key¶ (
Optional
[str
]) – Key inadata.obs
containing the clusters.clusters¶ (
Union
[str
,Sequence
[str
],None
]) – Clusters to visualize. If None, all clusters will be plotted.basis¶ (
Optional
[str
]) – Basis for scatterplot to use whenmode='paga_pie'
. If None, don’t show the scatterplot.cbar¶ (
bool
) – Whether to show colorbar whenmode='paga_pie'
.ncols¶ (
Optional
[int
]) – Number of columns whenmode='bar'
ormode='paga'
.fmt¶ (
str
) – Format when usingmode='heatmap'
ormode='clustermap'
.figsize¶ (
Optional
[Tuple
[float
,float
]]) – Size of the figure.legend_kwargs¶ (
Mapping
[str
,Any
]) – Keyword arguments formatplotlib.axes.Axes.legend()
, such as ‘loc’ for legend position. Formode='paga_pie'
andbasis='...'
, this controls the placement of the absorption probabilities legend.figsize¶ – Size of the figure.
save¶ (
Union
[Path
,str
,None
]) – Filename where to save the plot.**kwargs¶ – Keyword arguments for
scvelo.pl.paga()
,scanpy.pl.violin()
ormatplotlib.pyplot.bar()
, depending on the value ofmode
.
- Returns
Nothing, just plots the figure. Optionally saves it based on
save
.- Return type