cellcharter.pl.proportion

Contents

cellcharter.pl.proportion#

cellcharter.pl.proportion(adata, group_key, label_key, groups=None, labels=None, rotation_xlabel=45, ncols=1, normalize=True, palette=None, figsize=None, dpi=None, save=None, **kwargs)#

Plot the proportion of y_key in x_key.

Parameters:
  • adata (AnnData) – Annotated data object.

  • group_key (str) – Key in anndata.AnnData.obs where groups are stored.

  • label_key (str) – Key in anndata.AnnData.obs where labels are stored.

  • groups (Optional[list] (default: None)) – List of groups to plot.

  • labels (Optional[list] (default: None)) – List of labels to plot.

  • rotation_xlabel (int (default: 45)) – Rotation in degrees of the ticks of the x axis.

  • ncols (int (default: 1)) – Number of columns for the legend.

  • normalize (bool (default: True)) – If True use relative frequencies, outherwise use counts.

  • palette (Union[str, ListedColormap, None] (default: None)) – Categorical colormap for the clusters. If None, use anndata.AnnData.uns ['{{cluster_key}}_colors'], if available.

  • figsize (Optional[tuple[float, float]] (default: None)) – Size of the figure in inches.

  • dpi (Optional[int] (default: None)) – Dots per inch.

  • save (Union[str, Path, None] (default: None)) – Whether to save the plot.

  • kwargs – Keyword arguments for pandas.DataFrame.plot.bar().

Return type:

None

Returns:

Nothing, just plots the figure and optionally saves the plot.