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:
  1. The spatial distribution of the Leiden clusters in the slides.

  2. UMAP embeddings of each slide colored by Leiden clusters.

  3. General UMAP embedding of the complete dataset colored by Leiden clusters and the batch correction key.

  4. 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