spac.visualization.sankey_plot(adata: AnnData, source_annotation: str, target_annotation: str, source_color_map: str = 'tab20', target_color_map: str = 'tab20c', sankey_font: float = 12.0, prefix: bool = True)[source]

Generates a Sankey plot from the given AnnData object. The color map refers to matplotlib color maps, default is tab20 for source annotation, and tab20c for target annotation. For more information on colormaps, see: https://matplotlib.org/stable/users/explain/colors/colormaps.html

Parameters:
  • adata (anndata.AnnData) – The annotated data matrix.

  • source_annotation (str) – The source annotation to use for the Sankey plot.

  • target_annotation (str) – The target annotation to use for the Sankey plot.

  • source_color_map (str) – The color map to use for the source nodes. Default is tab20.

  • target_color_map (str) – The color map to use for the target nodes. Default is tab20c.

  • sankey_font (float, optional) – The font size to use for the Sankey plot. Defaults to 12.0.

  • prefix (bool, optional) – Whether to prefix the target labels with the source labels. Defaults to True.

Returns:

The generated Sankey plot.

Return type:

plotly.graph_objs._figure.Figure