enrichDGN result can't be visualised by barplot
Entering edit mode
Pahi • 0
Last seen 3 days ago


I'm trying to understand the working of enrichmen analysis, and I wanted to make one. I used the enrichDGN (clusterProfiler) analysis which gives me a result, but than I can't use a barplot to visualise it. Here is a little piece of the dataset I'm working with. de is a sorted dataset.

de <- c("10627"     "283603"    "1892"      "26263"     "349198" )

edo <- enrichDGN(de, readable=TRUE,pvalueCutoff = 0.2,qvalueCutoff = 0.2)

The edo is a Larga enrichResult (71.9 MB). If if look into it:

> edo
# over-representation test
#...@organism    Homo sapiens 
#...@ontology    DisGeNET 
#...@keytype     ENTREZID 
#...@gene    chr [1:1018] "49855" "9880" "8879" "11260" "1292" "55039" "3908" "85415" "10519" "10267" "9107" "890" "57478" ...
#...pvalues adjusted by 'BH' with cutoff <0.2 
#...0 enriched terms found
  Guangchuang Yu, Li-Gen Wang, Yanyan Han and Qing-Yu He.
  clusterProfiler: an R package for comparing biological themes among
  gene clusters. OMICS: A Journal of Integrative Biology
  2012, 16(5):284-287 

When I try

barplot(edo, showCategory=20) 

the following error appears:

Error in ans[ypos] <- rep(yes, length.out = len)[ypos] : 
  replacement has length zero
In addition: Warning message:
In rep(yes, length.out = len) : 'x' is NULL so the result will be NULL

What could be the probelm? Any help would be appreciated! Thank you!

enrichplot • 118 views
Entering edit mode
Guido Hooiveld ★ 3.0k
Last seen 1 day ago
Wageningen University, Wageningen, the …

This is the key info in your post:

#...0 enriched terms found

So there is nothing to plot....

Solution: relax your cutoff parameters.

Entering edit mode

Is it possible, that the cutoff=0,0001 still gives no result?

Entering edit mode

Why not set pvalueCutoff = 1 and qvalueCutoff = 1? That should give results that can be plotted (because effectively you don't apply any filtering).

If that is not the case, then it is a problem with your code.

If it is the case, then it indeed has to do with the cutoff you use.

How strict this cutoff should be, in other words whether the results make any sense, can only be decided by you (the analyst). It may very well be that 'nothing is happening'. This thread may also be of relevance Cluster profiler - KEGG analysis

Entering edit mode

Ahh...silly me.... I was misunderstanding the "relax". You are right. With the cutoff value set to 1 or 0.5 the code still works, and it gives me the results. And barplot works also!

Thank you very much!


Login before adding your answer.

Traffic: 309 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6