SOAPy_st.pl.show_celltype_sample_heatmap
- SOAPy_st.pl.show_celltype_sample_heatmap(adata: AnnData, norm_axis: Literal['celltype', 'sample', None] | None = None, norm_method: Literal['normalization', 'z_score', 'proportion'] = 'normalization', celltype_bar: bool = True, sample_bar: bool = True, 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, celltype_bar_kwargs: dict = {}, sample_bar_kwargs: dict = {}, **kwargs) Tuple[Figure, list[Axes]] | None
Heatmap show the cell composition of each sample. Bar plot can be added to show the overall cell types distribution 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.
- celltype_bar
Whether to show a bar plot of the cell number of each cell type.
- sample_bar
Whether to show a bar plot of the cell number of each sample.
- celltype_bar_kwargsAny
Other parameters in sns.countplot() of cell type’s bar plot.
- sample_bar_kwargsAny
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]]