scatrans.simplify_enrichment

scatrans.simplify_enrichment#

scatrans.simplify_enrichment(enrich_df, similarity_cutoff=0.5, by=None, ascending=True, min_count=3, gene_col=None, method='jaccard', obo_file=None, verbose=True, gene_sets=None, organism='mouse', to_test_threshold=0.0, pval_threshold=0.05, term_size_limit=0, show_excluded=False)[source]#

Redundancy reduction for enrichment results.

Parameters:
  • method ({"jaccard", "pathway_denester", "goatools"}, default "jaccard") –

    • jaccard: greedy filtering by Jaccard overlap of enriched gene sets.

    • pathway_denester: combinatorial nested-pathway test from PathwayDenester. Requires full pathway gene memberships via gene_sets (or resolvable from enrich_df.attrs['gene_set_info']).

    • goatools: not implemented.

  • gene_sets (dict, GMT path, or bundled library name, optional) – Full pathway definitions used only for method="pathway_denester". If omitted, the function tries to reload the library recorded in enrich_df.attrs['gene_set_info'].

  • to_test_threshold (float, default 0.0) – PathwayDenester only. Minimum fraction of shared DEGs (relative to the smaller pathway) before testing nested enrichment.

  • pval_threshold (float, default 0.05) – PathwayDenester only. Independence p-value cutoff for excluding a term.

  • term_size_limit (int, default 0) – PathwayDenester only. Drop pathways larger than this size before testing. 0 or negative values keep all pathways.

  • show_excluded (bool, default False) – PathwayDenester only. If True, return all terms with diagnostic Denester_* columns; otherwise return only kept terms.

  • enrich_df (DataFrame)

  • similarity_cutoff (float)

  • by (str | None)

  • ascending (bool)

  • min_count (int)

  • gene_col (str | None)

  • obo_file (str | None)

  • verbose (bool)

  • organism (str)

Return type:

DataFrame