HoloNet.tools.cluster_lr_based_on_ce#
- HoloNet.tools.cluster_lr_based_on_ce(ce_tensor, adata, lr_df, w_best, n_clusters=4, cluster_based='node_centrality_euclidean', centrality_measure='Eigenvector', cell_cci_centrality=None, **kwargs)#
Cluster the LR pairs using the CE network.
- Parameters
- ce_tensor
Tensor A CE tensor (LR_pair_num * cell_num * cell_num)
- adata
AnnData Annotated data matrix.
- lr_df
DataFrame A preprocessed LR-gene dataframe. must contain three columns: ‘Ligand_gene_symbol’, ‘Receptor_gene_symbol’ and ‘LR_pair’.
- w_best
float A distance parameter in edge weighting function controlling the covering region of ligands. ‘default_w_visium’ function provides a recommended value of w_best.
- n_clusters
int(default:4) Number of clusters
- cluster_based
str(default:'node_centrality_euclidean') Cluster methods, selected in ‘node_centrality_euclidean’, ‘node_centrality_physical’, and ‘edge_overlap’
- centrality_measure
str(default:'Eigenvector') Compute methods
- cell_cci_centrality
tensor|NoneOptional[tensor] (default:None) Provided centrality tensor can save time. A tensor (LR_num * cell_num) for the centrality of each cell according to each LR pair.
- kwargs
- Parameters for compute centrality, see in ‘compute_ce_network_degree_centrality’ and
’compute_ce_network_eigenvector_centrality’ function
- ce_tensor
- Return type
- Returns
: A LR-gene dataframe added the ‘cluster’ column. And a trained hierarchical clustering model