harreman.tools.compute_gene_pairs

harreman.tools.compute_gene_pairs#

harreman.tools.compute_gene_pairs(adata, layer_key=None, cell_type_key=None, cell_type_pairs=None, ct_specific=True, fix_ct=None, verbose=False)[source]#

Identifies biologically plausible gene pairs involved in ligand-receptor (LR) signaling or metabolite transport based on annotated interaction databases and filtered expression data.

Parameters:
  • adata (AnnData) –

    Annotated data object (AnnData). Must include:
    • varm[“database”]: DataFrame indicating gene involvement in interactions.

    • uns[“database”]: ‘LR’, ‘transporter’, or ‘both’.

    • uns[“ligand”], uns[“receptor”] for LR pairs if applicable.

    • uns[“metabolite_database”] and/or uns[“LR_database”] for pair categorization.

    • obsp[“weights”]: spatial proximity weights.

  • layer_key (str or "use_raw", optional) – Specifies the layer or raw data to use for expression filtering.

  • cell_type_key (str, optional) – Key in adata.obs indicating cell type annotation.

  • cell_type_pairs (list of tuple, optional) – List of tuples specifying cell type pairs to consider. If not provided, all combinations are used.

  • ct_specific (bool, optional (default: True)) – If True, restrict gene pair computation to combinations relevant to the given cell type annotations.

  • fix_ct (str, optional) – Whether to restrict the cell type pairs to a particular cell type.

  • verbose (bool, optional (default: False)) – Whether to print progress and status messages.

Returns:

Results are stored in the following keys in adata.uns: lcs, lc_zs, lc_z_pvals, and lc_z_FDR.

Return type:

None