SOAPy_st.pl.show_niche_sample_heatmap
- SOAPy_st.pl.show_niche_sample_heatmap(adata: AnnData, norm_axis: Literal['niche', 'sample', None] | None = None, norm_method: Literal['normalization', 'z_score', 'proportion'] = 'normalization', niche_bar: bool = True, sample_bar: bool = True, niche_bar_kwargs: Any | None = None, sample_bar_kwargs: Any | None = None, 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 niche composition in each sample, and the bar plot shows the total number of each niche and the total number of cells in each sample, respectively.
Parameters
- adataanndata.AnnData
An AnnData object containing spatial omics data and spatial information.
- norm_axisLiteral[‘celltype’, ‘sample’]
The direction of standardization. ‘celltype’: Standardization was performed for each cell type. ‘sample’: Standardization was performed for each sample. None: No standardization.
- niche_barbool
Whether to show a bar plot of the cell number of each niche.
- sample_barbool
Whether to show a bar plot of the cell number of each sample.
- niche_bar_kwargs
Other parameters in sns.countplot() of cell niche’s bar plot.
- sample_bar_kwargs
Other parameters in sns.countplot() of sample’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]]