This is a test version of Biostars. For the public version, visit https://www.biostars.org.
What to choose as background genes in GO enrichment analysis

I tried both clusterprofiler and goseq for GO enrichment analysis. However, I got 4-5 times more GO terms enriched in goseq than in clusterprofiler since p-values calculated in goseq are generally smaller. This is because I used all genes in the genome as background genes so the background ratio is small and p is also smaller. Then what genes I should use as background genes? here are some of my options:

  1. All genes in the genome
  2. All genes with GO terms in the genome
  3. Genes detected in my samples
  4. Genes detected in my samples with GO terms
rna-seq go enrichment goseq clusterprofiler

I would use 3 or 4 depending on your input list, if it contains only genes with GO term then 4, if not (which is the correct way IMHO) then 3.

I personally use the genes that were actually used in the DE analysis, so in my case all genes that survive the FilerByExpr step of edgeR.

I have the exact opposite : more significant terms with clusterprofiler than goseq.

1 answer

I would use all of the genes that were analyzed in your experiment: these are those on which you performed the differential expression analyses (you maybe previously filtered them to remove low-expression genes, etc.), because (under assumption of independence) those are the ones which had a chance of appearing as DEGs.

Regarding filtering out genes which do not map to GO terms, you can control for this at the GO enrichment step: the goseq function can control this with its use_genes_without_cat argument. And by default (most recent version) these genes are ignored in the enrichment testing.

Thank you for your answer! Very helpful

Log in to answer this question.