Entering edit mode
Hi,
I am running the generic version of enricher supplying my own GO mappings. When I create a dotplot from this object, I get a dotplot with less genes than the total amount of significant genes I supplied in the first place. Here's my code:
library(clusterProfiler)
library(GO.db)
aga_genes <- read.csv("treat_vs_control_aga.csv", header = TRUE)
aga_genes <- aga_genes$X
aga_genes <- as.character(aga_genes)
go_mappings <- read.delim("C:/Users/Lucía/Desktop/term2gene", header = FALSE)
go_terms <- go_mappings
goterms <- Term(GOTERM)
term2name <- data.frame("GOID"=names(goterms),"term"=goterms )
ego_bp_aga <- enricher(gene = aga_genes,
TERM2GENE = go_terms,
TERM2NAME = term2name)
dotplot(ego_bp_aga, showCategory=30) + ggtitle("dotplot for ORA")
where treat_vs_control_aga.csv contains my DEGs from DESeq2 and go_mappings are the gene and respective GO term that I'm supplying.
My total number of DEGs is about 500, and the dotplot shows about 100 if I add up all the categories. (Is there a way to include my image?)
Why is this? Thanks
It is difficult to guess without exactly knowing your data objects, but realize that by default GO categories containing less than 10 genes are excluded from the analyses. See the argument
minGSSize = 10
. Related to this, the result ofsort( table(go_terms[,1]) )
will show you the number of genes per category. Also realize that only significant categories are plotted in the dotplot. See argumentspvalueCutoff
,pAdjustMethod
andqvalueCutoff
. Set the 1st and 3rd argument to1
, andminGSSize = 2
, to be most permissive.