stlearn.pl.subcluster_plot¶
- stlearn.pl.subcluster_plot(adata: AnnData, title: str | None = None, figsize: tuple[float, float] | None = None, cmap: str = 'jet', use_label: str | None = None, list_clusters: list | None = None, ax: _AxesSubplot | None = None, show_plot: bool = True, show_axis: bool = False, show_image: bool = True, show_color_bar: bool = True, crop: bool = True, margin: float = 100, size: float = 5, image_alpha: float = 1.0, cell_alpha: float = 1.0, fname: str | None = None, dpi: int = 120, cluster: int = 0, threshold_spots: int = 5, text_box_size: float = 5, bbox_to_anchor: tuple[float, float] | None = (1, 1)) AnnData | None[source]¶
Allows the visualization of a subclustering results as the discretes values of dot points in the Spatial transcriptomics array.
- Parameters:
adata – Annotated data matrix.
title – Title name of the figure.
figsize – Figure size with the format (width,height).
cmap – Color map to use for continous variables or discretes variables (e.g. viridis, Set1,…).
use_label – Key for the label use in adata.obs (e.g. leiden,…).
list_clusters – A set of cluster to be displayed in the figure (e.g. [0,1,2,3]).
ax – A matplotlib axes object.
show_plot – Option to display the figure.
show_image – Option to display the H&E image.
show_color_bar – Option to display color bar.
crop – Option to crop the figure based on the spot locations.
margin – Margin to crop.
size – Spot size to display in figure.
image_alpha – Opacity of H&E image.
cell_alpha – Opacity of spots/cells.
use_raw – Option to use adata.raw data.
fname – Output path to the output if user want to save the figure.
dpi – Dots per inch values for the output.
cluster – Choose cluster to plot the sub-clusters.
text_box_size – The font size in the box of labels.
bbox_to_anchor – Set the position of box of color bar. Default is (1,1)
Examples
>>> import stlearn as st >>> adata = st.datasets.visium_sge(sample_id="V1_Breast_Cancer_Block_A_Section_1") >>> label = "leiden" >>> cluster = 6 >>> st.pl.cluster_plot(adata, use_label = label, cluster = cluster)