gedi2py.tools.pathway_scores

gedi2py.tools.pathway_scores(adata, *, key='gedi', key_added=None, copy=False)[source]

Compute per-cell pathway activity scores.

Uses the ADB projection (pathway activity) to compute pathway scores for each cell.

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

  • key (str, default: 'gedi') – Key in adata.uns where GEDI results are stored.

  • key_added (str | None, default: None) – Key to store results in adata.obsm. Defaults to X_{key}_pathway_scores.

  • copy (bool, default: False) – If True, return the score matrix instead of storing in adata.

Return type:

AnnData | ndarray | None

Returns:

  • If ``copy=True``, returns pathway score matrix (n_cells, n_pathways).

  • Otherwise, stores in ``adata.obsm[key_added]`` and returns ``None`.`

Examples

>>> import gedi2py as gd
>>> gd.tl.gedi(adata, batch_key="sample", C=pathway_matrix)
>>> gd.tl.pathway_scores(adata)
>>> adata.obsm["X_gedi_pathway_scores"]  # (n_cells, n_pathways)