HoloNet.tools.compute_ce_tensor#
- HoloNet.tools.compute_ce_tensor(used_interaction_db, w_best, elements_expr_df_dict, adata, distinguish=True, anno_col='annotation', two_class={'global': ['Secreted Signaling'], 'local': ['Cell-Cell Contact', 'ECM-Receptor']}, dist_factor_secreted=None)#
Calculate CE matrix for measuring the strength of communication between any pairs of cells, according to the edge weighting function.
- Parameters
- used_interaction_db
DataFrame A preprocessed LR-gene dataframe.
- 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.
- elements_expr_df_dict
dict Metadata from ‘elements_expr_df_calculate’ function.
- adata
AnnData Annotated data matrix.
- distinguish
bool(default:True) If True, set the different w_best for secreted ligands and plasma-membrane-binding ligands.
- anno_col
str(default:'annotation') The column in used_interaction_db containing the proportion of ligand.
- two_class
dict(default:{'local': ['Cell-Cell Contact', 'ECM-Receptor'], 'global': ['Secreted Signaling']}) Divide the LR pair into two class. The two class uses different w paramater.
- dist_factor_secreted
bool|NoneOptional[bool] (default:None) Calculated dist factor matrix for secreted LR pairs.
- used_interaction_db
- Return type
Tensor- Returns
: A CE tensor (LR_pair_num * cell_num * cell_num)