Question
When I run the mgeneSim function in the GOSemsim package, I choose ontology "BP" or "CC", the error pop up as follows. It seems that only these genes with "BP" or "CC" cause problems. ontology term "MF" doesn't cause error, but it returns a value 1 instead of a matrix.
The source code is here
rm(list = ls())
# source("https://bioconductor.org/biocLite.R")
# biocLite("GOSemSim")
library("GOSemSim")
# source("https://bioconductor.org/biocLite.R")
# biocLite("org.Hs.eg.db")
library("org.Hs.eg.db")
# install.packages("rvcheck")
library("rvcheck")
rvcheck::check_bioc("GOSemSim")
rvcheck::check_bioc("org.Hs.eg.db")
R.Version()
sessionInfo()
sim_db <- godata('org.Hs.eg.db', ont="BP", computeIC=TRUE)
an_Entrez_ID_vector <- c("9895", "404636", "54621", "115361")
names(an_Entrez_ID_vector) <- c("TECPR2", "FAM45A", "VSIG10", "GBP4")
an_Entrez_ID_vector
similarity_matrix <- mgeneSim(an_Entrez_ID_vector, semData = sim_db,
measure = "Wang", drop = "IEA",
combine = "avg", verbose = TRUE)
The running result is here
> rm(list = ls())
> # source("https://bioconductor.org/biocLite.R")
> # biocLite("GOSemSim")
> library("GOSemSim")
> # source("https://bioconductor.org/biocLite.R")
> # biocLite("org.Hs.eg.db")
> library("org.Hs.eg.db")
> # install.packages("rvcheck")
> library("rvcheck")
> rvcheck::check_bioc("GOSemSim")
package is up-to-date release version
$`package`
[1] "GOSemSim"
$installed_version
[1] "2.6.0"
$latest_version
[1] "2.6.0"
$up_to_date
[1] TRUE
> rvcheck::check_bioc("org.Hs.eg.db")
package is up-to-date release version
$`package`
[1] "org.Hs.eg.db"
$installed_version
[1] "3.6.0"
$latest_version
[1] "3.6.0"
$up_to_date
[1] TRUE
> R.Version()
$`platform`
[1] "x86_64-w64-mingw32"
$arch
[1] "x86_64"
$os
[1] "mingw32"
$system
[1] "x86_64, mingw32"
$status
[1] ""
$major
[1] "3"
$minor
[1] "5.1"
$year
[1] "2018"
$month
[1] "07"
$day
[1] "02"
$`svn rev`
[1] "74947"
$language
[1] "R"
$version.string
[1] "R version 3.5.1 (2018-07-02)"
$nickname
[1] "Feather Spray"
> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936
[2] LC_CTYPE=Chinese (Simplified)_People's Republic of China.936
[3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_People's Republic of China.936
attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] org.Hs.eg.db_3.6.0 AnnotationDbi_1.42.1 IRanges_2.14.10 S4Vectors_0.18.3 Biobase_2.40.0
[6] BiocGenerics_0.26.0 GOSemSim_2.6.0 rvcheck_0.1.0 BiocInstaller_1.30.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.18 GO.db_3.6.0 digest_0.6.15 DBI_1.0.0 RSQLite_2.1.1 blob_1.1.1
[7] tools_3.5.1 bit64_0.9-7 bit_1.1-14 compiler_3.5.1 pkgconfig_2.0.1 memoise_1.1.0
> sim_db <- godata('org.Hs.eg.db', ont="BP", computeIC=TRUE)
preparing gene to GO mapping data...
preparing IC data...
> an_Entrez_ID_vector <- c("9895", "404636", "54621", "115361")
> names(an_Entrez_ID_vector) <- c("TECPR2", "FAM45A", "VSIG10", "GBP4")
> an_Entrez_ID_vector
TECPR2 FAM45A VSIG10 GBP4
"9895" "404636" "54621" "115361"
> similarity_matrix <- mgeneSim(an_Entrez_ID_vector, semData = sim_db,
+ measure = "Wang", drop = "IEA",
+ .... [TRUNCATED]
|========== | 10%
Error in go_matrix[gos[[i]], gos[[j]]] : incorrect number of dimensions
good.......................
Please use
ADD COMMENT/ADD REPLYwhen responding to existing posts to keep threads logically organized. This comment comment should have gone under @Guangchuang's answer.Okay. Thanks for your suggestions. This is my first time posting here.
Do not use the
SUBMIT ANSWERwindow/button to post additional content/comments.If you are posting from china and are not able to use the
ADD REPLY/ADD COMMENTbuttons then try switching tochromebrowser. That generally works.I don't know how to post to a correct place...
posting to a correct place is very hard...