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 inadata.unswhere GEDI results are stored.key_added (
str|None, default:None) – Key to store results inadata.obsm. Defaults toX_{key}_pathway_scores.copy (
bool, default:False) – IfTrue, return the score matrix instead of storing inadata.
- Return type:
- Returns:
If ``copy=True``,returns pathway score matrix (n_cells,n_pathways).Otherwise,stores in ``adata.obsm[key_added]``andreturns ``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)