scatrans.run_go

Contents

scatrans.run_go#

scatrans.run_go(gene_list, ontology='BP', organism='mouse', universe=None, background=None, adata=None, pval_cutoff=None, padj_cutoff=None, min_size=5, max_size=500, restrict_background_to_gene_sets=True, force_universe=False, return_all=False, verbose=True, gene_case=None, gene_set_source='scatrans', include_gene_list=False, adjust_across_all=False, **kwargs)[source]#

GO enrichment (BP / CC / MF) wrapper around run_enrichment.

Similar to clusterProfiler::enrichGO(ont = “BP”).

Parameters:
  • ontology ({"BP", "CC", "MF", "ALL"}, default "BP") – Which GO subtree to test. - “BP”: Biological Process (default; also the only one with bundled 2026 sets) - “CC”: Cellular Component - “MF”: Molecular Function - “ALL”: run BP + CC + MF and concatenate results (adds an “Ontology” column)

  • adjust_across_all (bool, default False) –

    Only relevant for ontology=”ALL”. - False (default): p.adjust is the one computed within each ontology separately

    (each sub-run does its own BH correction). Documented behavior for most users.

    • True: After concatenating BP+CC+MF, recompute a single BH correction across all tested GO terms using their raw pvalues. This is stricter/more conservative for cross-ontology multiple testing. Recommended when you want a single family-wise error control across the entire GO.

  • built-in (Only organism + ontology are usually required when using the)

  • (universe/background/adata (libraries. Other parameters)

  • cutoffs

  • etc.)

  • run_enrichment. (are forwarded to)

  • ontology="ALL" (When)

  • column (results are concatenated and an "Ontology")

  • disambiguation. (("BP"/"CC"/"MF") is prepended for)

  • diagnostics (The returned DataFrame.attrs contains rich) –

    • method, ontology=”ALL”, organism, gene_case, pval_cutoff, adjust_across_all

    • per_ontology_attrs: dict mapping “BP”/”CC”/”MF” -> the full .attrs from each sub-run (includes each ontology’s own gene_set_info, universe_info, analysis_info etc.)

    • analysis_info (package/timestamp/version)

    • If adjust_across_all=True, the main “p.adjust” is the cross-GO BH; the column “p.adjust.within_ontology” preserves the original per-ontology adjusted values.

  • "ALL" (Note on p.adjust for) – For ontology=”ALL”, p.adjust is computed within each ontology separately before concatenation (unless adjust_across_all=True). Use per_ontology_attrs or the within_ontology column for full transparency.

  • gene_list (Iterable[Any])

  • organism (str)

  • universe (Iterable[Any] | None)

  • background (Iterable[Any] | None)

  • adata (Any | None)

  • pval_cutoff (float | None)

  • padj_cutoff (float | None)

  • min_size (int)

  • max_size (int)

  • restrict_background_to_gene_sets (bool)

  • force_universe (bool)

  • return_all (bool)

  • verbose (bool)

  • gene_case (str | None)

  • gene_set_source (str)

  • include_gene_list (bool)

  • kwargs (Any)

Return type:

DataFrame

Examples

>>> # Basic BP with bundled sets
>>> res = run_go(markers, ontology="BP", organism="mouse", return_all=True)
>>> # ALL ontologies + cross-ontology correction + full provenance in attrs
>>> res = run_go(markers, ontology="ALL", organism="mouse",
...              universe=background, return_all=True, adjust_across_all=True)
>>> print(res.attrs["per_ontology_attrs"]["BP"]["actual_source"])  # or gene_set_info etc.