SOAPy_st.pl.show_celltype_niche_heatmap

SOAPy_st.pl.show_celltype_niche_heatmap(adata: AnnData, norm_method: Literal['normalization', 'z_score', 'proportion'] = 'normalization', niche_bar: bool = True, niche_bar_kwargs: Mapping[str, Any] = mappingproxy({}), title: str | None = None, figsize: Tuple[float, float] | None = None, dpi: int = 100, cmap: LinearSegmentedColormap | None = None, show: bool = True, save: str | PathLike | None = None, **kwargs) Tuple[Figure, list[Axes]] | None

The heatmap shows the cell composition of each niche, and the bar plot graph shows the number of each niche in all samples.

Parameters

adataanndata.AnnData

An AnnData object containing spatial omics data and spatial information.

niche_barbool

Whether to show a bar plot of the cell number of each niche.

niche_bar_kwargsAny

Other parameters in sns.countplot() of cell type’s bar plot.

norm_methodLiteral[‘normalization’, ‘z_score’, ‘proportion’]

Methods of standardization ‘normalization’: x^ = (x - min(x)) / (max(x) - min(x)) ‘z_score’: x^ = (x - mean(x)) / std(x) ‘proportion’: x^ = x / sum(x)

figsizeTuple[float, float], optional

(Width, height) of the figure.

dpifloat, optional

The resolution of the figure.

titlestr, optional

The title of shown figure.

showbool

Show the plot, do not return axis.

saveUnion[str, PathLike], optional

The path where the image is stored.

cmap

Color map to use for continous variables.

kwargsAny

Other params of sns.heatmap()

Returns

If show==False, return Tuple[Figure, list[Axes]]