nichecompass.utils.compute_communication_gp_network

nichecompass.utils.compute_communication_gp_network(gp_list, model, group_key='niche', filter_key=None, filter_cat=None, n_neighbors=90)

Compute a network of category aggregated cell-pair communication strengths.

First, compute cell-cell communication potential scores for each cell. Then dot product them and take into account neighborhoods to compute cell-pair communication strengths. Then, normalize cell-pair communication strengths.

Parameters:
  • gp_list (list) – List of GPs for which the cell-pair communication strengths are computed.

  • model (NicheCompass) – A trained NicheCompass model.

  • group_key (str (default: 'niche')) – Key in ´adata.obs´ where the groups are stored over which the cell-pair communication strengths will be aggregated.

  • filter_key (Optional[str] (default: None)) – Key in ´adata.obs´ that contains the category for which the results are filtered.

  • filter_cat (Optional[str] (default: None)) – Category for which the results are filtered.

  • n_neighbors (int (default: 90)) – Number of neighbors for the gp-specific neighborhood graph.

Returns:

network_df: A pandas dataframe with aggregated, normalized cell-pair communication strengths.