cellflow.plotting.plot_condition_embedding

cellflow.plotting.plot_condition_embedding(df, embedding, dimensions=(0, 1), hue=None, key='condition_embedding', labels=None, col_dict=None, title=None, show_lines=False, return_fig=True, embedding_kwargs=mappingproxy({}), **kwargs)[source]

Plot embedding of the conditions.

Parameters:
  • df (DataFrame) – A pandas.DataFrame with embedding and metadata. Column names of embedding dimensions should be consecutive integers starting from 0, e.g. as output from get_condition_embedding(), and metadata should be in columns with strings.

  • embedding (Literal['raw_embedding', 'UMAP', 'PCA', 'Kernel_PCA']) – Embedding to plot. Options are “raw_embedding”, “UMAP”, “PCA”, “Kernel_PCA”.

  • dimensions (tuple[int, int]) – Dimensions of the embedding to plot.

  • hue (str | None) – Covariate to color by.

  • key (str) – Key where the embedding is stored.

  • labels (list[str]) – Column in 'df' with labels to plot. If None, doesn’t plot labels.

  • col_dict (dict[str, str] | None) – TODO

  • title (str | None) – Title of the plot.

  • show_lines (bool) – Whether to show lines connecting points.

  • return_fig (bool) – Whether to return the figure.

  • embedding_kwargs (dict[str, Any]) – Additional keyword arguments for the embedding method.

  • kwargs (Any) – Additional keyword arguments for plotting.

Return type:

Figure

Returns:

: None or matplotlib.figure.Figure, depending on return_fig.