Error in UseMethod("rescale")
0
0
Entering edit mode
vvelagal • 0
@2528ae94
Last seen 2.0 years ago
United States

While using cnetplot to plot enrichGo results, I am getting the following error. It used to work before, but now I am constantly getting this error. I am using clusterprofiler package

gse <- enrichGO(gene = deGenes, ont = "BP",
                   OrgDb ="org.Dm.eg.db",
                   universe = geneUniverse,
                   readable=TRUE,
                   pvalueCutoff = 0.05)

 cnetplot(gse, categorySize="pvalue", foldChange=gene_list, showCategory =20, font.size=12,label_format=30,cex_line =1,colorEdge = TRUE)

Error in UseMethod("rescale") : no applicable method for 'rescale' applied to an object of class "AsIs"

Session info ()

Matrix products: default



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

other attached packages:
 [1] DOSE_3.20.1           enrichplot_1.14.2     clusterProfiler_4.2.2 org.Dm.eg.db_3.14.0   AnnotationDbi_1.56.2 
 [6] IRanges_2.28.0        S4Vectors_0.32.4      Biobase_2.54.0        BiocGenerics_0.40.0   reshape2_1.4.4       
[11] MASS_7.3-58.1         ggplot2_3.4.0         gplots_3.1.3         

loaded via a namespace (and not attached):
  [1] fgsea_1.20.0           ggnewscale_0.4.8       colorspace_2.0-3       ggtree_3.2.1           qvalue_2.26.0         
  [6] XVector_0.34.0         aplot_0.1.8            rstudioapi_0.14        farver_2.1.1           graphlayouts_0.8.3    
 [11] ggrepel_0.9.2          bit64_4.0.5            fansi_1.0.3            scatterpie_0.1.8       splines_4.1.2         
 [16] cachem_1.0.6           GOSemSim_2.20.0        polyclip_1.10-4        jsonlite_1.8.3         broom_1.0.1           
 [21] GO.db_3.14.0           png_0.1-7              ggforce_0.4.1          compiler_4.1.2         httr_1.4.4            
 [26] backports_1.4.1        assertthat_0.2.1       Matrix_1.4-0           fastmap_1.1.0          lazyeval_0.2.2        
 [31] cli_3.1.1              tweenr_2.0.2           tools_4.1.2            igraph_1.3.5           gtable_0.3.1          
 [36] glue_1.6.2             GenomeInfoDbData_1.2.7 DO.db_2.9              dplyr_1.0.10           fastmatch_1.1-3       
 [41] Rcpp_1.0.9             vctrs_0.5.0            Biostrings_2.62.0      ape_5.6-2              nlme_3.1-155          
 [46] ggraph_2.1.0           stringr_1.4.1          lifecycle_1.0.3        gtools_3.9.3           zlibbioc_1.40.0       
 [51] scales_1.2.1           tidygraph_1.2.2        parallel_4.1.2         RColorBrewer_1.1-3     memoise_2.0.1         
 [56] gridExtra_2.3          downloader_0.4         ggfun_0.0.8            yulab.utils_0.0.5      stringi_1.7.6         
 [61] RSQLite_2.2.18         tidytree_0.4.1         caTools_1.18.2         BiocParallel_1.28.3    GenomeInfoDb_1.30.1   
 [66] rlang_1.0.6            pkgconfig_2.0.3        bitops_1.0-7           lattice_0.20-45        purrr_0.3.5           
 [71] treeio_1.18.1          patchwork_1.1.2        labeling_0.4.2         shadowtext_0.1.2       bit_4.0.4             
 [76] tidyselect_1.2.0       plyr_1.8.7             magrittr_2.0.3         R6_2.5.1               snow_0.4-4            
 [81] generics_0.1.3         DBI_1.1.3              pillar_1.8.1           withr_2.5.0            KEGGREST_1.34.0       
 [86] RCurl_1.98-1.9         tibble_3.1.8           crayon_1.5.2           KernSmooth_2.23-20     utf8_1.2.2            
 [91] viridis_0.6.2          grid_4.1.2             data.table_1.14.4      blob_1.2.3             digest_0.6.30         
 [96] tidyr_1.2.1            gridGraphics_0.5-1     munsell_0.5.0          viridisLite_0.4.1      ggplotify_0.1.0    
clusterProfiler • 4.1k views
ADD COMMENT
0
Entering edit mode

You need to check that enrichGO correctly worked, otherwise there may be an issue in creating your data. Look closely at each step of your code and the resulting objects

ADD REPLY
0
Entering edit mode

To add to Basti's comment: you may also need to update, since it is working in my hands using the latest version of R/Bioconductor.

> library(clusterProfiler)
> 
> ## use sample data
> data(geneList, package = "DOSE")
> de <- names(geneList)[1:100]
> yy <- enrichGO(de, 'org.Hs.eg.db', ont="BP", pvalueCutoff=0.01, readable=TRUE)

> 
> ## create cnetpplot. It is working fine.
> ## notice the deprecation warning when generating the cnetplot
> cnetplot(yy, categorySize="pvalue", foldChange=geneList, showCategory=20, font.size=12, label_format=30, cex_line =1, colorEdge = TRUE)
Scale for size is already present.
Adding another scale for size, which will replace the existing scale.
Warning messages:
1: In cnetplot.enrichResult(x, ...) :
  Use 'color.params = list(foldChange = your_value)' instead of 'foldChange'.
 The foldChange parameter will be removed in the next version.
2: In cnetplot.enrichResult(x, ...) :
  Use 'color.params = list(edge = your_value)' instead of 'colorEdge'.
 The colorEdge parameter will be removed in the next version.
3: ggrepel: 13 unlabeled data points (too many overlaps). Consider increasing max.overlaps 
> 
> ## this will be the new way of providing the arguments.
> color.params = list(foldChange = geneList, edge = TRUE)
> cnetplot(yy, color.params = color.params, categorySize="pvalue", showCategory =20, font.size=12, label_format=30, cex_line =1)
Scale for size is already present.
Adding another scale for size, which will replace the existing scale.
Warning message:
ggrepel: 13 unlabeled data points (too many overlaps). Consider increasing max.overlaps 
> 
>
> sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

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

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

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

other attached packages:
[1] clusterProfiler_4.6.0

loaded via a namespace (and not attached):
  [1] nlme_3.1-160           bitops_1.0-7           ggtree_3.6.2          
  [4] enrichplot_1.18.1      bit64_4.0.5            HDO.db_0.99.1         
ADD REPLY

Login before adding your answer.

Traffic: 877 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