spared.plotting.plot_clusters
- spared.plotting.plot_clusters(dataset: str, param_dict: dict, processed_adata: AnnData, from_layer: str, path: str, split_names: dict) None[source]
Plot clusters spatially
This function generates a plot that visualizes Leiden clusters spatially in the slides in param_dict[‘plotting_slides’]. The slides can be specified in param_dict[‘plotting_slides’] or chosen randomly.
- It plots:
The spatial distribution of the Leiden clusters in the slides.
UMAP embeddings of each slide colored by Leiden clusters.
General UMAP embedding of the complete dataset colored by Leiden clusters and the batch correction key.
PCA embeddings of the complete dataset colored by the batch correction key.
- Parameters:
dataset – Name of the dataset
param_dict – Dictionary of dataset parameters
processed_adata (ad.AnnData) – Processed and filtered data ready to use by the model.
from_layer (str) – The key in adata.layers where the expression matrix is stored.
path (str) – Path to save the image
split_names (dict) – dictionary containing split names