emapplot (enrichplot) with compareCluster object does not work
1
0
Entering edit mode
rapmic • 0
@rapmic-20844
Last seen 4.1 years ago

Dear All

The sample 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

emapplot enrichplot clusterProfiler compareCluster • 2.0k views
ADD COMMENT
0
Entering edit mode
Guido Hooiveld ★ 3.9k
@guido-hooiveld-2020
Last seen 1 day ago
Wageningen University, Wageningen, the …

The outcome of the compareCluster() function is an object with class "compareClusterResult". The current release version of emapplot (i.e. v1.6.1) does apparently not yet support these type of objects.

However, 'upgrading' both the libraries emapplot AND DOSE to the development versions will do the trick! See sessionInfo. Please note that I did this within the release version of Bioconductor (and not dev), which in principle is NOT recommended!

devtools::install_github("GuangchuangYu/DOSE")
devtools::install_github("GuangchuangYu/enrichplot")
library(clusterProfiler)
data(gcSample)
xx <- compareCluster(gcSample, fun="enrichKEGG", organism="hsa", pvalueCutoff=0.05)
p1 <- emapplot(xx)
p3 <- emapplot(xx,pie="count")
p4 <- emapplot(xx,pie="count", pie_scale=1.5, layout="kk")
cowplot::plot_grid(p1, p2, p3, p4, ncol=2, labels=LETTERS[1:4])

> sessionInfo()
R version 3.6.1 Patched (2019-09-14 r77192)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] clusterProfiler_3.14.3

loaded via a namespace (and not attached):
  [1] fs_1.3.1             usethis_1.5.1        enrichplot_1.7.1    
  [4] devtools_2.2.1       bit64_0.9-7          progress_1.2.2      
  [7] httr_1.4.1           RColorBrewer_1.1-2   rprojroot_1.3-2     
 [10] tools_3.6.1          backports_1.1.5      R6_2.4.1            
 [13] DBI_1.1.0            lazyeval_0.2.2       BiocGenerics_0.32.0 
 [16] colorspace_1.4-1     withr_2.1.2          tidyselect_1.0.0    
 [19] gridExtra_2.3        prettyunits_1.1.1    processx_3.4.1      
 [22] bit_1.1-15.1         curl_4.3             compiler_3.6.1      
 [25] cli_2.0.1            Biobase_2.46.0       scatterpie_0.1.4    
 [28] xml2_1.2.2           desc_1.2.0           labeling_0.3        
 [31] triebeard_0.3.0      scales_1.1.0         ggridges_0.5.2      
 [34] callr_3.4.1          stringr_1.4.0        digest_0.6.23       
 [37] DOSE_3.13.1          pkgconfig_2.0.3      sessioninfo_1.1.1   
 [40] rlang_0.4.4          RSQLite_2.2.0        gridGraphics_0.4-1  
 [43] farver_2.0.3         jsonlite_1.6         BiocParallel_1.20.1 
 [46] GOSemSim_2.12.0      dplyr_0.8.3          magrittr_1.5        
 [49] ggplotify_0.0.4      GO.db_3.10.0         Matrix_1.2-18       
 [52] Rcpp_1.0.3           munsell_0.5.0        S4Vectors_0.24.3    
 [55] fansi_0.4.1          viridis_0.5.1        lifecycle_0.1.0     
 [58] stringi_1.4.5        ggraph_2.0.0         MASS_7.3-51.5       
 [61] pkgbuild_1.0.6       plyr_1.8.5           qvalue_2.18.0       
 [64] grid_3.6.1           blob_1.2.1           parallel_3.6.1      
 [67] ggrepel_0.8.1        DO.db_2.9            crayon_1.3.4        
 [70] lattice_0.20-38      cowplot_1.0.0        graphlayouts_0.5.0  
 [73] splines_3.6.1        hms_0.5.3            ps_1.3.0            
 [76] pillar_1.4.3         fgsea_1.12.0         igraph_1.2.4.2      
 [79] reshape2_1.4.3       stats4_3.6.1         pkgload_1.0.2       
 [82] fastmatch_1.1-0      glue_1.3.1           BiocManager_1.30.10 
 [85] data.table_1.12.8    remotes_2.1.0        urltools_1.7.3      
 [88] vctrs_0.2.2          tweenr_1.0.1         testthat_2.3.1      
 [91] gtable_0.3.0         purrr_0.3.3          polyclip_1.10-0     
 [94] tidyr_1.0.2          assertthat_0.2.1     ggplot2_3.2.1       
 [97] ggforce_0.3.1        europepmc_0.3        tidygraph_1.1.2     
[100] viridisLite_0.3.0    tibble_2.1.3         rvcheck_0.1.7       
[103] AnnotationDbi_1.48.0 memoise_1.1.0        IRanges_2.20.2      
[106] ellipsis_0.3.0      
>
ADD COMMENT

Login before adding your answer.

Traffic: 773 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6