SOAPy_st.tl.domain_from_unsupervised
- SOAPy_st.tl.domain_from_unsupervised(adata: AnnData, domain_method: Literal['stagate', 'graphst', 'scanit'] = 'stagate', graph_model: str | None = None, k_cutoff: int | None = None, rad_cutoff: float | None = None, alpha_n_layer: int | None = None, cluster_method: Literal['m_clust', 'louvain'] = 'm_clust', cluster_number: int = 10, cluster_key: str = 'domain', random_seed: int = 2020, resolution_louvain: float = 0.5, spatial_in_obsm: str = 'spatial', inplace: bool = True, **kwargs) AnnData
Generate spatial domains using unsupervised learning methods. This function supports multiple spatial domain identification algorithms, including STAGATE, GraphST, and ScanIT, and provides two clustering methods (mclust and Louvain) to cluster the spatial domains.
Parameters
- adataanndata.AnnData
An AnnData object containing spatial omics data and spatial information.
- domain_methodLiteral[‘stagate’, ‘graphst’, ‘scanit’], optional (default: ‘stagate’)
The method used to generate spatial domains. Available options are: - ‘stagate’: Use the STAGATE algorithm to generate spatial domains. - ‘graphst’: Use the GraphST algorithm to generate spatial domains. - ‘scanit’: Use the ScanIT algorithm to generate spatial domains.
- graph_modelstr, optional (default: None)
The model used to construct the spatial graph. For STAGATE, options are ‘Radius’ or ‘KNN’; for ScanIT, options are ‘alpha shape’ or ‘knn’.
- k_cutoffOptional[int], optional (default: None)
The number of KNN neighbors used to construct the spatial graph. Only valid when graph_model is ‘KNN’ or ‘knn’.
- rad_cutoffOptional[float], optional (default: None)
The radius cutoff used to construct the spatial graph. Only valid when graph_model is ‘Radius’.
- alpha_n_layerOptional[int], optional (default: None)
The number of alpha layers used in the ScanIT algorithm. Only valid when domain_method is ‘scanit’.
- cluster_methodLiteral[‘m_clust’, ‘louvain’], optional (default: ‘m_clust’)
The clustering algorithm used. Available options are: - ‘m_clust’: Use the mclust algorithm for clustering. - ‘louvain’: Use the Louvain algorithm for clustering.
- cluster_numberint, optional (default: 10)
The number of clusters. Only valid when cluster_method is ‘m_clust’.
- cluster_keystr, optional (default: ‘domain’)
The key in adata.obs where the clustering results will be stored.
- random_seedint, optional (default: 2020)
Random seed for reproducibility.
- resolution_louvainfloat, optional (default: 0.5)
The resolution parameter for the Louvain algorithm. Only valid when cluster_method is ‘louvain’.
- spatial_in_obsmstr, optional (default: ‘spatial’)
The key in adata.obsm where spatial coordinates are stored.
- inplacebool, optional (default: True)
Whether to modify the AnnData object in place. If False, a modified copy is returned.
- **kwargsdict
Additional parameters passed to the specific algorithms.
Returns
anndata.AnnData.obsdomain- The cluster of spatial domain.