monkeybread.stat.ligand_receptor_score

monkeybread.stat.ligand_receptor_score(adata, cell_to_neighbors, actual_scores, n_perms=100)

Calculates statistical significance of the co-expression of ligand-receptor pairs between neighboring cells.

Statistical test is as described in [HBB+22] (See Figure 4). This function runs this test separately on each ligand-receptor pair among a set of pairs provided by the user.

Parameters:
Return type:

Dict[Tuple[str, str], Tuple[ndarray, float]]

Returns:

: A mapping from ligand-receptor tuple pairs to a tuple containing the distribution of co-expression scores under permutation (i.e., null distribution) with the associated p-value of the observed co-expression score.