mantispy.pl.feature_correlation

mantispy.pl.feature_correlation#

mantispy.pl.feature_correlation(adata, key='selected', groupby='feature_group', max_features=300, ax=None)#

Correlation heatmap with features ordered by their annotation.

Features are sorted by groupby and then by channel, with a line at each group boundary. Ordering by annotation instead of clustering shows directly whether correlated features fall within the same measurement family.

Parameters:
  • adata (AnnData) – Object to draw. Usually well-level profiles.

  • key (str | None (default: 'selected')) – Restrict to features flagged by this boolean var column. None, or a column the object does not hold, uses every feature.

  • groupby (str (default: 'feature_group')) – var column to order and delimit by.

  • max_features (int (default: 300)) – Draw at most this many features, taken in the sorted order.

  • ax (Axes | None (default: None)) – Axes to draw into.

Return type:

Axes

Returns:

The axes drawn on, holding the correlation matrix on a diverging scale fixed to [-1, 1], with a line at each group boundary and one tick per group.

Raises:

KeyErrorvar has no groupby column, or no channel column.