gedi2py.tools.top_pathway_genes

gedi2py.tools.top_pathway_genes(adata, pathway_idx, *, n_genes=20, key='gedi')[source]

Get top genes associated with a pathway.

Returns the genes with the highest association scores for a given pathway, based on the pathway association matrix.

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

  • pathway_idx (int) – Index of the pathway to query.

  • n_genes (int, default: 20) – Number of top genes to return.

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

Return type:

List of gene names with highest pathway associations.

Examples

>>> import gedi2py as gd
>>> gd.tl.pathway_associations(adata)
>>> top_genes = gd.tl.top_pathway_genes(adata, pathway_idx=0, n_genes=10)
>>> print(top_genes)