SOAPy_st.pl.show_niche_environment
- SOAPy_st.pl.show_niche_environment(adata: AnnData, niche: int | str, celltype_key: str = 'clusters', niche_key: str = 'C_niche', sample_key: str = 'sample', sample_id: int | str | None = None, scale: str | float = 'hires', palette: Sequence[str] | ListedColormap | None = None, title: str | None = None, ax: Axes | None = None, sig_niche_line_color: str = '#000000', other_niche_line_color: str = '#999999', spatial_in_obsm: str = 'spatial', show: bool = True, save: str | PathLike | None = None, **kwargs) Axes | None
Show the environment composition of a niche. The cell boundaries belonging to this niche will be highlighted (the color is regulated by the sig_niche_line_color parameter), and the cell boundaries’ color of other cells are regulated by the other_niche_line_color parameter. Cells labeled with cell type color indicate participation in this niche calculation.
Parameters
- adataanndata.AnnData
An AnnData object containing spatial omics data and spatial information.
niche
- celltype_keystr
The label of cell type in adata.obs.
- niche_keystr
The label of niche in adata.obs.
- sample_keystr
The label of sample in adata.obs.
- sampleUnion[str, int]
Sample number to be shown.
- scaleUnion[str, float]
Scale used in subsequent analyses. If it’s Visium data it can also be HE image labels (hires or lower). Most of the time you don’t need to change this.
color
- titlestr
The title of this figure.
- sig_niche_line_colorstr
The color of the outline of cells in selected niche.
- other_niche_line_colorstr
The color of the outline of cells in other niches.
- spatial_in_obsmstr
Keyword of coordinate information in obsm.
- showbool
Show the plot, do not return axis.
- saveUnion[str, PathLike]
The path where the image is stored.
- kwargsAny
Other params of voronoi_plot_2d()
Returns
If show==False, return Axes.