Skip to contents

Performs GO enrichment analysis for each cluster-specific DEG list using clusterProfiler::enrichGO. Produces a QC summary table of tested versus retained gene sets per cluster.

Usage

run_go_ora(
  de_list,
  org_db,
  universe = universe,
  keyType = "SYMBOL",
  qvalueCutoff = 0.1,
  ont = "bp",
  outputDir = NULL,
  outname = "GO_ORA_QC_summary.csv"
)

Arguments

de_list

A named list of data frames, each containing at least a column gene with gene symbols. Typically the output of run_cluster_de.

org_db

An OrgDb annotation object (e.g., org.Mm.eg.db::org.Mm.eg.db for mouse, org.Hs.eg.db::org.Hs.eg.db for human).

universe

Character vector of background gene symbols representing all genes tested in the differential expression analysis. Defines the enrichment universe.

keyType

Character string specifying the gene identifier type. Default "SYMBOL".

qvalueCutoff

Numeric. q-value (BH-adjusted p-value) threshold for retaining enriched terms. Default 0.1.

ont

Character string specifying the GO sub-ontology to test: "BP" (Biological Process), "MF" (Molecular Function), "CC" (Cellular Component), or "all". Default "bp".

outputDir

Character path to the directory where the QC summary CSV is written. Created if it does not exist.

outname

Character filename for the QC summary CSV. Default "GO_ORA_QC_summary.csv".

Value

A named list of enrichResult objects (one per cluster). Elements are NULL for clusters with no DEGs. A QC summary CSV is also written to <outputDir>/<outname>.

Details

For each cluster, the function:

  1. Extracts unique gene symbols from the DE data frame.

  2. Calls clusterProfiler::enrichGO with minGSSize = 5, maxGSSize = 300, BH adjustment, and readable = TRUE.

  3. Annotates the result with the cluster name.

  4. Prints a per-cluster summary of tested/retained gene sets.