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:
adata (
AnnData) – Annotated data matrix.cell_to_neighbors (
Dict[str,Set[str]]) – A dictionary mapping each cell to its neighbors as calculated bymonkeybread.calc.cell_neighbors()actual_scores (
Dict[Tuple[str,str],float]) – The observed co-expression scores as calculated bymonkeybread.calc.ligand_receptor_score()n_perms (
Optional[int] (default:100)) – Number of permutations to run in the permutation test
- Return type:
- 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.