SOAPy_st.pl.show_network

SOAPy_st.pl.show_network(adata: AnnData, sample_key: str | None = 'sample', sample_id: int | str | None = None, cluster_key: str = 'clusters', edge_color: str = 'b', palette: Sequence[str] | ListedColormap | dict | None = None, title: str | None = 'Spatial network', scale: str | float = 'hires', spatial_in_obsm: str = 'spatial', figsize: Tuple[float, float] | None = None, dpi: int = 100, ax: Axes | None = None, spot_size: float = 5, show: bool = True, save: str | PathLike | None = None, legend_kwargs: dict = {}, **kwargs: Any) Axes | None

Show the spatial network.

Parameters

adataanndata.AnnData

An AnnData object containing spatial omics data and spatial information.

figsizeTuple[float, float], optional

(Width, height) of the figure.

dpifloat, optional

The resolution of the figure.

titlestr, optional

The title of shown figure.

axAxes

A matplotlib axes object.

showbool

Show the plot, do not return axis.

saveUnion[str, PathLike], optional

The path where the image is stored.

sample_keystr, optional

Batch’s key in adata.obs.

sample_idUnion[int, str], optional

The sample number which to be shown.

cluster_keystr

Keys for annotations in adata.obs. It can not be None.

edge_colorstr

The color of edges in the network.

paletteUnion[Sequence[str], Cycler, dict], optional

Colors to use for plotting annotation groups.

scaleUnion[str, float]

The scaling factor for distance scaling. 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.

spatial_in_obsmstr

Keyword of coordinate information in obsm.

spot_sizefloat

The size of the spot

legend_kwargsdict, optional

Other params of plt.legend().

kwargsAny, optional

Other params of scipy.spatial.voronoi_plot_2d().

Returns

If show==False, return Axes.