YuLab-SMU / clusterProfiler

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

Warnings like"The following objects are masked from ‘package:parallel’......." #114

Closed mycodingway closed 6 years ago

mycodingway commented 6 years ago
                                                                                **目录**

问题预览: 1 版本详细信息: 2 问题重现步骤: 3 重新安装最新版R(WindowsX64-3.4.2); 3 安装Bioconductor 3 安装clusterProfiler 4 进行GO富集: 5 显示没有org.Hs.eg.db这个包,开始安装这个包: 6 然后再次进行GO富集: 7 试图解决的过程: 8

问题预览:

yy <- enrichGO(de, 'org.Hs.eg.db', ont="BP", pvalueCutoff=0.01) Loading required package: org.Hs.eg.db Loading required package: AnnotationDbi Loading required package: stats4 Loading required package: BiocGenerics Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap,
parApply, parCapply, parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:stats’:

IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

anyDuplicated, append, as.data.frame, cbind, colMeans, colnames, colSums, do.call,
duplicated, eval, evalq, Filter, Find, get, grep, grepl, intersect, is.unsorted,
lapply, lengths, Map, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
pmin.int, Position, rank, rbind, Reduce, rowMeans, rownames, rowSums, sapply,
setdiff, sort, table, tapply, union, unique, unsplit, which, which.max, which.min

Loading required package: Biobase Welcome to Bioconductor

Vignettes contain introductory material; view with 'browseVignettes()'. To cite
Bioconductor, see 'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: IRanges Loading required package: S4Vectors

Attaching package: ‘S4Vectors’

The following object is masked from ‘package:base’:

expand.grid

也就是说,似乎是出现全局变量与底层包的冲突。

版本详细信息:

R版本:WindowsX64-3.4.2 Bioconductor版本:3.6 Windows版本:win10 17017.1000版(win10 Red Stone3最新内测版)

问题重现步骤:

重新安装最新版R(WindowsX64-3.4.2);

安装Bioconductor

输入: source("https://bioconductor.org/biocLite.R") biocLite() 结果为: > source("https://bioconductor.org/biocLite.R") 试开URL’https://bioconductor.org/packages/3.6/bioc/bin/windows/contrib/3.4/BiocInstaller_1.28.0.zip' Content type 'application/zip' length 130329 bytes (127 KB) downloaded 127 KB

package ‘BiocInstaller’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\Administrator\AppData\Local\Temp\Rtmp8CPzz0\downloaded_packages Bioconductor version 3.6 (BiocInstaller 1.28.0), ?biocLite for help > biocLite() BioC_mirror: https://bioconductor.org Using Bioconductor 3.6 (BiocInstaller 1.28.0), R 3.4.2 (2017-09-28). Installing package(s) ‘Biobase’, ‘IRanges’, ‘AnnotationDbi’ also installing the dependencies ‘rlang’, ‘bit’, ‘tibble’, ‘digest’, ‘bit64’, ‘blob’, ‘memoise’, ‘pkgconfig’, ‘Rcpp’, ‘BH’, ‘plogr’, ‘BiocGenerics’, ‘S4Vectors’, ‘DBI’, ‘RSQLite’

There is a binary version available but the source version is later: binary source needs_compilation rlang 0.1.2 0.1.4 TRUE

Binaries will be installed 试开URL’https://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.1.2.zip' Content type 'application/zip' length 466010 bytes (455 KB) downloaded 455 KB ....................... ....................... package ‘rlang’ successfully unpacked and MD5 sums checked package ‘bit’ successfully unpacked and MD5 sums checked package ‘tibble’ successfully unpacked and MD5 sums checked package ‘digest’ successfully unpacked and MD5 sums checked package ‘bit64’ successfully unpacked and MD5 sums checked package ‘blob’ successfully unpacked and MD5 sums checked package ‘memoise’ successfully unpacked and MD5 sums checked package ‘pkgconfig’ successfully unpacked and MD5 sums checked package ‘Rcpp’ successfully unpacked and MD5 sums checked package ‘BH’ successfully unpacked and MD5 sums checked package ‘plogr’ successfully unpacked and MD5 sums checked package ‘BiocGenerics’ successfully unpacked and MD5 sums checked package ‘S4Vectors’ successfully unpacked and MD5 sums checked package ‘DBI’ successfully unpacked and MD5 sums checked package ‘RSQLite’ successfully unpacked and MD5 sums checked package ‘Biobase’ successfully unpacked and MD5 sums checked package ‘IRanges’ successfully unpacked and MD5 sums checked package ‘AnnotationDbi’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\Administrator\AppData\Local\Temp\Rtmp8CPzz0\downloaded_packages Old packages: 'mgcv', 'rlang' Update all/some/none? [a/s/n]: Update all/some/none? [a/s/n]: a

There is a binary version available but the source version is later: binary source needs_compilation rlang 0.1.2 0.1.4 TRUE

Binaries will be installed 试开URL’https://cran.rstudio.com/bin/windows/contrib/3.4/mgcv_1.8-22.zip' Content type 'application/zip' length 2753100 bytes (2.6 MB) downloaded 2.6 MB

试开URL’https://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.1.2.zip' Content type 'application/zip' length 466010 bytes (455 KB) downloaded 455 KB

package ‘mgcv’ successfully unpacked and MD5 sums checked package ‘rlang’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\Administrator\AppData\Local\Temp\Rtmp8CPzz0\downloaded_packages

安装clusterProfiler

上一步结束后,输入: source("https://bioconductor.org/biocLite.R") biocLite("clusterProfiler") 结果为:

source("https://bioconductor.org/biocLite.R") Bioconductor version 3.6 (BiocInstaller 1.28.0), ?biocLite for help biocLite("clusterProfiler") BioC_mirror: https://bioconductor.org Using Bioconductor 3.6 (BiocInstaller 1.28.0), R 3.4.2 (2017-09-28). Installing package(s) ‘clusterProfiler’ also installing the dependencies ‘lambda.r’, ‘futile.options’, ‘colorspace’, ‘bindr’, ‘futile.logger’, ‘snow’, ‘data.table’, ‘gridExtra’, ‘fastmatch’, ‘irlba’, ‘stringr’, ‘RColorBrewer’, ‘dichromat’, ‘munsell’, ‘labeling’, ‘R6’, ‘viridisLite’, ‘assertthat’, ‘bindrcpp’, ‘BiocParallel’, ‘DO.db’, ‘fgsea’, ‘igraph’, ‘reshape2’, ‘scales’, ‘gtable’, ‘lazyeval’, ‘dplyr’, ‘glue’, ‘purrr’, ‘stringi’, ‘tidyselect’, ‘DOSE’, ‘ggplot2’, ‘GO.db’, ‘GOSemSim’, ‘magrittr’, ‘plyr’, ‘qvalue’, ‘rvcheck’, ‘tidyr’

试开URL’https://cran.rstudio.com/bin/windows/contrib/3.4/lambda.r_1.2.zip' Content type 'application/zip' length 92942 bytes (90 KB) downloaded 90 KB ..................................... downloaded 2.7 MB

package ‘lambda.r’ successfully unpacked and MD5 sums checked package ‘futile.options’ successfully unpacked and MD5 sums checked package ‘colorspace’ successfully unpacked and MD5 sums checked package ‘bindr’ successfully unpacked and MD5 sums checked package ‘futile.logger’ successfully unpacked and MD5 sums checked package ‘snow’ successfully unpacked and MD5 sums checked package ‘data.table’ successfully unpacked and MD5 sums checked package ‘gridExtra’ successfully unpacked and MD5 sums checked package ‘fastmatch’ successfully unpacked and MD5 sums checked package ‘irlba’ successfully unpacked and MD5 sums checked package ‘stringr’ successfully unpacked and MD5 sums checked package ‘RColorBrewer’ successfully unpacked and MD5 sums checked package ‘dichromat’ successfully unpacked and MD5 sums checked package ‘munsell’ successfully unpacked and MD5 sums checked package ‘labeling’ successfully unpacked and MD5 sums checked package ‘R6’ successfully unpacked and MD5 sums checked package ‘viridisLite’ successfully unpacked and MD5 sums checked package ‘assertthat’ successfully unpacked and MD5 sums checked package ‘bindrcpp’ successfully unpacked and MD5 sums checked package ‘BiocParallel’ successfully unpacked and MD5 sums checked package ‘fgsea’ successfully unpacked and MD5 sums checked package ‘igraph’ successfully unpacked and MD5 sums checked package ‘reshape2’ successfully unpacked and MD5 sums checked package ‘scales’ successfully unpacked and MD5 sums checked package ‘gtable’ successfully unpacked and MD5 sums checked package ‘lazyeval’ successfully unpacked and MD5 sums checked package ‘dplyr’ successfully unpacked and MD5 sums checked package ‘glue’ successfully unpacked and MD5 sums checked package ‘purrr’ successfully unpacked and MD5 sums checked package ‘stringi’ successfully unpacked and MD5 sums checked package ‘tidyselect’ successfully unpacked and MD5 sums checked package ‘DOSE’ successfully unpacked and MD5 sums checked package ‘ggplot2’ successfully unpacked and MD5 sums checked package ‘GOSemSim’ successfully unpacked and MD5 sums checked package ‘magrittr’ successfully unpacked and MD5 sums checked package ‘plyr’ successfully unpacked and MD5 sums checked package ‘qvalue’ successfully unpacked and MD5 sums checked package ‘rvcheck’ successfully unpacked and MD5 sums checked package ‘tidyr’ successfully unpacked and MD5 sums checked package ‘clusterProfiler’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\Administrator\AppData\Local\Temp\Rtmp8CPzz0\downloaded_packages installing the source packages ‘DO.db’, ‘GO.db’

试开URL’https://bioconductor.org/packages/3.6/data/annotation/src/contrib/DO.db_2.9.tar.gz' Content type 'application/x-gzip' length 1769978 bytes (1.7 MB) downloaded 1.7 MB

试开URL’https://bioconductor.org/packages/3.6/data/annotation/src/contrib/GO.db_3.4.2.tar.gz' Content type 'application/x-gzip' length 32989249 bytes (31.5 MB) downloaded 31.5 MB

The downloaded source packages are in ‘C:\Users\Administrator\AppData\Local\Temp\Rtmp8CPzz0\downloaded_packages’ Old packages: 'rlang' Update all/some/none? [a/s/n]: a

There is a binary version available but the source version is later: binary source needs_compilation rlang 0.1.2 0.1.4 TRUE

Binaries will be installed 试开URL’https://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.1.2.zip' Content type 'application/zip' length 466010 bytes (455 KB) downloaded 455 KB

package ‘rlang’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\Administrator\AppData\Local\Temp\Rtmp8CPzz0\downloaded_package

## # 进行GO富集: OK…it seems OK now...... 安装完毕之后,我开始载入clusterProfiler并试着进行GO富集:

library(clusterProfiler) 载入需要的程辑包:DOSE

DOSE v3.4.0 For help: https://guangchuangyu.github.io/DOSE

If you use DOSE in published research, please cite: Guangchuang Yu, Li-Gen Wang, Guang-Rong Yan, Qing-Yu He. DOSE: an R/Bioconductor package for Disease Ontology Semantic and Enrichment analysis. Bioinformatics 2015, 31(4):608-609

clusterProfiler v3.6.0 For help: https://guangchuangyu.github.io/clusterProfiler

If you use clusterProfiler in published research, please cite: Guangchuang Yu., Li-Gen Wang, Yanyan Han, 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.

Not run:

data(geneList) de <- names(geneList)[1:100] yy <- enrichGO(de, 'org.Hs.eg.db', ont="BP", pvalueCutoff=0.01) Loading required package: org.Hs.eg.db Error in eval(parse(text = OrgDb)) : 找不到对象'org.Hs.eg.db' 此外: Warning message: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called ‘org.Hs.eg.db’ head(yy) Error in head(yy) : 找不到对象'yy'

End(Not run)

显示没有org.Hs.eg.db这个包,开始安装这个包:

输入: source("https://bioconductor.org/biocLite.R") biocLite("org.Hs.eg.db") 结果:

source("https://bioconductor.org/biocLite.R") Bioconductor version 3.6 (BiocInstaller 1.28.0), ?biocLite for help biocLite("org.Hs.eg.db") BioC_mirror: https://bioconductor.org Using Bioconductor 3.6 (BiocInstaller 1.28.0), R 3.4.2 (2017-09-28). Installing package(s) ‘org.Hs.eg.db’ installing the source package ‘org.Hs.eg.db’

试开URL’https://bioconductor.org/packages/3.6/data/annotation/src/contrib/org.Hs.eg.db_3.4.2.tar.gz' Content type 'application/x-gzip' length 73201455 bytes (69.8 MB) downloaded 69.8 MB

The downloaded source packages are in ‘C:\Users\Administrator\AppData\Local\Temp\Rtmp8CPzz0\downloaded_packages’ Old packages: 'rlang' Update all/some/none? [a/s/n]: a

There is a binary version available but the source version is later: binary source needs_compilation rlang 0.1.2 0.1.4 TRUE

Binaries will be installed 试开URL’https://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.1.2.zip' Content type 'application/zip' length 466010 bytes (455 KB) downloaded 455 KB

package ‘rlang’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘rlang’

The downloaded binary packages are in C:\Users\Administrator\AppData\Local\Temp\Rtmp8CPzz0\downloaded_packages

然后再次进行GO富集:

输入:yy <- enrichGO(de, 'org.Hs.eg.db', ont="BP", pvalueCutoff=0.01) 然后出现:

yy <- enrichGO(de, 'org.Hs.eg.db', ont="BP", pvalueCutoff=0.01) Loading required package: org.Hs.eg.db Loading required package: AnnotationDbi Loading required package: stats4 Loading required package: BiocGenerics Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap, parApply, parCapply, parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:stats’:

IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

anyDuplicated, append, as.data.frame, cbind, colMeans, colnames, colSums, do.call, duplicated, eval, evalq, Filter, Find, get, grep, grepl, intersect, is.unsorted,
lapply, lengths, Map, mapply, match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rowMeans, rownames, rowSums, sapply,
setdiff, sort, table, tapply, union, unique, unsplit, which, which.max, which.min

Loading required package: Biobase Welcome to Bioconductor

Vignettes contain introductory material; view with 'browseVignettes()'. To cite Bioconductor, see 'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: IRanges Loading required package: S4Vectors

Attaching package: ‘S4Vectors’

The following object is masked from ‘package:base’:

expand.grid

# 试图解决的过程: 在Google上搜了一下,说是因为使用了require命令载入包,导致变量被挂载为全局变量,导致与R的优先载入的底层包里的同名变量发生冲突。 但是怎么避免这个问题呢? 我上面的操作似乎没有问题。

求Y叔帮助。。。。

mycodingway commented 6 years ago

补充一个问题:GO富集的话,选择物种,人的话看来是要用org.Hs.eg.db这个数据包,但是其他物种的呢?R上我在下图所示的OrgDb的标签下看到了一系列类似的其他物种的包,但是只有19个,而Panther上显示GO注释目前有104个物种可选,那么是不是还要去Bioc上搜寻其他的物种包?没有一个总的GO的数据注释包吗? 360 20171106141432619

GuangchuangYu commented 6 years ago

Bioconductor上只有19个物种,其它物种可以通过AnnotationHub在线获得(假如有注释的话)。

至于说冲突这种是没有办法的,因为不同的包用了同样的名字,那么你用这个函数名的话,就会调用最后一个载入的包的函数。唯一可以避免的的方式就是告诉R你要用的是某个包里的某个函数。

比如你上面说到的expand.grid,你就可以用S4Vectors::expand.gridbase::expand.grid指定是某个包的函数。

mycodingway commented 6 years ago

好,明白了,谢谢Y叔