delnx.tl.gseaยถ

delnx.tl.gsea(genes, background=None, gene_sets=None, collection='all', url=None, filepath=None, geneset_key='geneset', genesymbol_key='genesymbol', method='enrichr', return_object=False, min_genes=5, max_genes=500)[source]ยถ

Run enrichment analysis for a single gene list using Enrichr.

Parameters:
  • genes (Sequence[str]) โ€“ List of gene symbols to analyze.

  • background (Sequence[str] | None (default: None)) โ€“ Background gene list to use for enrichment analysis. If None, uses all genes in the gene sets.

  • gene_sets (dict[str, list[str]] | None (default: None)) โ€“ Pre-loaded gene sets as a dictionary where keys are gene set names and values are lists of gene symbols. If None, will load gene sets based on the provided collection, URL, or filepath.

  • collection (str (default: 'all')) โ€“ Name of the collection to load gene sets from. Default is โ€œallโ€.

  • url (str | None (default: None)) โ€“ URL to load the GMT file from. If None, uses the default collection.

  • filepath (str | None (default: None)) โ€“ Local file path to load the GMT file from. If None, uses the default collection.

  • geneset_key (str (default: 'geneset')) โ€“ Column name for the gene set name in the output dictionary. Default is โ€œgenesetโ€.

  • genesymbol_key (str (default: 'genesymbol')) โ€“ Column name for the gene symbol in the output dictionary. Default is โ€œgenesymbolโ€.

  • method (str (default: 'enrichr')) โ€“ Method to use for enrichment analysis. Currently only โ€œenrichrโ€ is supported.

  • return_object (bool (default: False)) โ€“ If True, returns the gseapy Enrichr object. If False, returns a pandas DataFrame with results.

  • min_genes (int (default: 5)) โ€“ Minimum number of genes in a gene set to include in the analysis. Default is 5.

  • max_genes (int (default: 500)) โ€“ Maximum number of genes in a gene set to include in the analysis. Default is 500.

Return type:

DataFrame | Any