scviva.tools.harreman.tools.compute_gene_pairs#

scviva.tools.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]#

Identify biologically plausible gene pairs.

This includes ligand-receptor (LR) signaling or metabolite transport pairs 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 Union[Literal['use_raw'], str, None]

Specifies the layer or raw data to use for expression filtering.

cell_type_key str | None

Key in adata.obs indicating cell type annotation.

cell_type_pairs list | None

List of tuples specifying cell type pairs to consider. If not provided, all combinations are used.

ct_specific bool | None

If True, restrict gene pair computation to combinations relevant to the given cell type annotations.

fix_ct Union[Literal['all'], str, None]

Whether to restrict the cell type pairs to a particular cell type.

verbose bool | None

Whether to print progress and status messages.

Return type:

None

Returns:

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