mantispy.pl.feature_signature

mantispy.pl.feature_signature#

mantispy.pl.feature_signature(adata, groupby=None, top=40, cluster=True, cmap='RdBu_r', figsize=None, ax=None)#

Heatmap of perturbations by feature families.

Parameters:
  • adata (AnnData) – The output of feature_signature().

  • groupby (str | None (default: None)) – obs column to average rows within, instead of showing one row per perturbation. "Metadata_MOA", for example, gives one row per mechanism.

  • top (int | None (default: 40)) – Show only this many rows, those with the largest absolute value. None shows all of them. Ignored when groupby is given.

  • cluster (bool (default: True)) – Order rows and columns by hierarchical clustering, so families that move together are adjacent. Otherwise the object’s order is kept.

  • cmap (str (default: 'RdBu_r')) – Diverging colormap, centered on zero so decreases and increases read equally.

  • figsize (tuple[float, float] | None (default: None)) – Size of the figure, in inches, or None for one that grows with the number of rows and columns. Ignored when ax is given.

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

Return type:

Axes

Returns:

The axes drawn on, holding perturbations against feature families on a scale centered on zero, with a colorbar beside them.

Raises:

KeyErrorgroupby was given and obs has no such column.