ehrapy.plot.clustermap#
- ehrapy.plot.clustermap(adata, obs_keys=None, use_raw=None, show=None, save=None, **kwds)[source]#
Hierarchically-clustered heatmap.
Wraps
seaborn.clustermap()
forAnnData
.- Parameters:
adata (
AnnData
) –AnnData
object object containing all observations.obs_keys (
Optional
[str
]) – Categorical annotation to plot with a different color map. Currently, only a single key is supported.use_raw (
Optional
[bool
]) – Whether to use raw attribute of adata. Defaults to True if .raw is present.show (
Optional
[bool
]) – Whether to display the figure or return axis.save (
Union
[bool
,str
,None
]) – If True or a str, save the figure. A string is appended to the default filename. Infer the filetype if ending on {‘.pdf’, ‘.png’, ‘.svg’}.ax – A matplotlib axes object. Only works if plotting a single component.
**kwds – Keyword arguments passed to
clustermap()
.
- Returns:
If show is False, a
ClusterGrid
object (seeclustermap()
).
Example
import ehrapy as ep adata = ep.data.mimic_2(encoded=True) ep.pp.knn_impute(adata) ep.pp.log_norm(adata, offset=1) ep.pp.neighbors(adata) ep.tl.leiden(adata, resolution=0.5, key_added="leiden_0_5") ep.pl.clustermap(adata)
- Preview: