mmcci.an.lr_interaction_clustering
- mmcci.an.lr_interaction_clustering(sample, resolution=0.5, cluster_palette='Dark2_r', cell_type_palette='tab20', cell_colors=None, spot_size=1.5, spatial_plot=True, proportion_plot=True, return_adata=False, **kwargs)[source]
Clustering of spatial LR interaction scores on AnnData objects processed through stLearn.
- Parameters:
sample (AnnData) – An AnnData object that has been run through stLearn.
resolution (float) (optional) – The resolution to use for the clustering. Defaults to 0.5.
cluster_palette (str) (optional) – Name of matplotlib colormap to use for clusters. Defaults to ‘Dark2_r’.
cell_type_palette (str) (optional) – Name of matplotlib colormap to use for cell types. Defaults to ‘tab20’.
cell_colors (dict) (optional) – Dictionary mapping cell types to colors. If not provided, colors will be generated from cell_type_palette. Defaults to None.
spot_size (float) (optional) – The size of the spots in the spatial plot. Defaults to 1.5.
spatial_plot (bool) (optional) – Whether to show the spatial plot. Defaults to True.
proportion_plot (bool) (optional) – Whether to show the proportion plot. Defaults to True.
return_adata (bool) (optional) – Whether to return the AnnData object with the clustering results. Defaults to False.
**kwargs – Additional keyword arguments to pass to the scanpy spatial plot function.
- Returns:
An AnnData object with the clustering results.
- Return type:
AnnData