mantispy.pl.cluster_composition

mantispy.pl.cluster_composition#

mantispy.pl.cluster_composition(composition, groupby='Metadata_Perturbation', ax=None)#

Stacked bars of cell-state fractions, averaged within each group.

Takes the object cluster_composition() returns.

Parameters:
  • composition (AnnData) – The well-level object cluster_composition() returns, holding one cluster per feature.

  • groupby (str (default: 'Metadata_Perturbation')) – obs column whose groups become the bars.

  • ax (Axes | None (default: None)) – Axes to draw on, or None for a new figure.

Return type:

Axes

Returns:

The axes drawn on, with one bar per group of groupby in the order the groups first appear and one stacked segment per cluster.

Raises:

KeyErrorobs has no groupby column.