YuLab-SMU / clusterProfiler

:bar_chart: A universal enrichment tool for interpreting omics data
https://yulab-smu.top/biomedical-knowledge-mining-book/
1k stars 253 forks source link

emapplot (enrichplot) with compareCluster object results in error #245

Open rmicheroli opened 4 years ago

rmicheroli commented 4 years ago

Dear Mr Yu,

Thank you very much for your wonderfuld codes and functions. The sample - and ones from myself - from https://yulab-smu.github.io/clusterProfiler-book/chapter12.html results in the following:

> library(clusterProfiler)

> data(gcSample)

> xx <- compareCluster(gcSample, fun="enrichKEGG",
+                      organism="hsa", pvalueCutoff=0.05)

> p1 <- emapplot(xx)
Fehler in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function 'emapplot' for signature '"compareClusterResult"'

> p2 <- emapplot(xx,legend_n=2) 
Fehler in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function 'emapplot' for signature '"compareClusterResult"'

> p3 <- emapplot(xx,pie="count")
Fehler in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function 'emapplot' for signature '"compareClusterResult"'

> p4 <- emapplot(xx,pie="count", pie_scale=1.5, layout="kk")
Fehler in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function 'emapplot' for signature '"compareClusterResult"'

> cowplot::plot_grid(p1, p2, p3, p4, ncol=2, labels=LETTERS[1:4])
Fehler in cowplot::plot_grid(p1, p2, p3, p4, ncol = 2, labels = LETTERS[1:4]) : 
  Objekt 'p3' nicht gefunden

> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.2

Is there a solution for this problem?

Thank you in advance.

BW RM

simonewebb commented 4 years ago

Hi, I'm also getting this same error. OP - have you managed to find a solution in the meantime?

Thank you!

Simone

khayer commented 4 years ago

Hi, I am seeing the same error.

Thank you, Kat

rmicheroli commented 4 years ago

In my case, after restarting everything (twice) the problem was solved...

zebasilio commented 4 years ago

I am seeing the same error. Thank you, José

YulongNiu commented 4 years ago

Try to install the latest version:

devtools::install_github('https://github.com/YuLab-SMU/clusterProfiler')

guireiso commented 4 years ago

I'm with the same problem and my version is the newest one!

simonewebb commented 4 years ago

I also see the same issue when I upgrade to the newest version - any advice?

Thanks

Simone

margaridamccferreira commented 4 years ago

Hi! I'm getting the same error, does anyone know how to overcome it?

Thanks a lot! Margarida

rmicheroli commented 4 years ago

It worked in my case after restarting the mac and starting a new session!

margaridamccferreira commented 4 years ago

Hi again!

Thanks rmicheroli for you kind response!

It worked for me after updating R to the newest version (4.0.0) and then installing the github version of clusterProfiler like YulongNiu suggested:

Try to install the latest version:

devtools::install_github('https://github.com/YuLab-SMU/clusterProfiler')

Hope it works for everyone! Margarida