mantispy.pl.feature_correlation#
- mantispy.pl.feature_correlation(adata, key='selected', groupby='feature_group', max_features=300, ax=None)[source]#
Correlation heatmap with features ordered by their annotation.
Features are sorted by
groupbyand 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
varcolumn.None, or a column the object does not hold, uses every feature.- groupby
str(default:'feature_group') varcolumn 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.
- 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 correlation matrix on a diverging scale fixed to[-1, 1], with a line at each group boundary and one tick per group.- Raises:
KeyError –
varhas nogroupbycolumn, or nochannelcolumn.