mantispy.pl.similarity

Contents

mantispy.pl.similarity#

mantispy.pl.similarity(adata, key='similarity', groupby='Metadata_Perturbation', max_obs=500, ax=None)#

Profile-by-profile similarity, ordered by groupby so blocks are visible.

Subsamples to max_obs rows with a fixed seed when the object is larger, because the matrix is quadratic.

Parameters:
  • adata (AnnData) – Object holding the matrix similarity() wrote in obsp.

  • key (str (default: 'similarity')) – Name of that matrix in obsp.

  • groupby (str | None (default: 'Metadata_Perturbation')) – obs column to order the rows and columns by, or None to keep the object’s own order.

  • max_obs (int (default: 500)) – Draw at most this many profiles, sampled from the ordering rather than from the rows.

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

Return type:

Axes

Returns:

The axes drawn on, holding the ordered matrix on a diverging scale fixed to [-1, 1] with a colorbar beside it.

Raises:

KeyErrorobsp holds nothing under key.