monkeybread.calc.ligand_receptor_score

monkeybread.calc.ligand_receptor_score(adata, cell_to_neighbors, lr_pairs=None)

Calculates an average co-expression score of a ligand-receptor pair between neighboring cells..

Statistical test is as described in [HBB+22] (See Figure 4).

Calculates scores for ligand-receptor pairs in neighboring cells.

Parameters:
  • adata (AnnData) – Annotated data matrix.

  • cell_to_neighbors (Dict[str, Set[str]]) – A mapping of cells to their neighbors, as calculated by monkeybread.calc.cell_neighbors().

  • lr_pairs (Union[Tuple[str, str], List[Tuple[str, str]], None] (default: None)) – One or multiple tuples corresponding to (ligand, receptor). If None then ligand/receptor pairs will be downloaded from Omnipath via the omnipath.interactions.import_intercell_network().

Return type:

Dict[Tuple[str, str], float]

Returns:

: A mapping from ligand-receptor tuple pairs to pair scores.