mantispy.pl.similarity#
- mantispy.pl.similarity(adata, key='similarity', groupby='Metadata_Perturbation', max_obs=500, ax=None)[source]#
Profile-by-profile similarity, ordered by
groupbyso blocks are visible.Subsamples to
max_obsrows with a fixed seed when the object is larger, because the matrix is quadratic.- Parameters:
- adata
AnnData Object holding the matrix
similarity()wrote inobsp.- key
str(default:'similarity') Name of that matrix in
obsp.- groupby
str|None(default:'Metadata_Perturbation') obscolumn to order the rows and columns by, orNoneto 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
Nonefor a new figure.
- adata
- Return type:
- Returns:
The axes when the caller passed
ax, elseNonebecause the plot then owns the figure it created. When returned they hold the ordered matrix on a diverging scale fixed to[-1, 1]with a colorbar beside it.- Raises:
KeyError –
obspholds nothing underkey.