I came across a problem when trying to run pathview() to map gene expression data to KEGG.
1. I run this code:
pathview(gene.data = gene_matrix,
pathway.id = "04070",
species = "mouse")
The structure of the input object gene_matrix is shown as followed:
head(gene_matrix)
497097 27395 21399 240690 319263 71096
0.6876964 0.4142183 1.4401079 -1.0009338 0.4017501 0.7701214
I got this error:
Error in UseMethod("select_") :
**no applicable method for 'select_' applied to an object of class "c('OrgDb', 'AnnotationDb', 'envRefClass', '.environment', 'refClass', 'environment', 'refObject', 'AssayData')"**
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Error in `$<-.data.frame`(`*tmp*`, "labels", value = c("", "", "", "", :
replacement has 29 rows, data has 49
2. The environment where I run the program was rstudio-server, which was installed on Cent OS 7 and R version was 3.4.4.
Detailed information is listed below:
> R.Version()
$platform
[1] "x86_64-redhat-linux-gnu"
$arch
[1] "x86_64"
$os
[1] "linux-gnu"
$system
[1] "x86_64, linux-gnu"
$status
[1] ""
$major
[1] "3"
$minor
[1] "4.4"
$year
[1] "2018"
$month
[1] "03"
$day
[1] "15"
$`svn rev`
[1] "74408"
$language
[1] "R"
$version.string
[1] "R version 3.4.4 (2018-03-15)"
$nickname
[1] "Someone to Lean On"
3. What puzzled me was that there seemed to be no problem with the pathview package, because I tested it with the demo data and the pathview() function worked well.
I run this code:
library(pathview)
data(gse16873.d)
pv.out <- pathview(gene.data = gse16873.d[, 1],
pathway.id = "04110",
species = "hsa",
out.suffix = "gse16873")
'select()' returned 1:1 mapping between keys and columns
Info: Working in directory /home/**/R/**/**
Info: Writing image file hsa04110.gse16873.png
In addition, both the codes I run above (in green) worked well on RStudio built on Win 10.
The result of the first code is shown below:
pathview(gene.data = gene_matrix,
pathway.id = "04070",
species = "mouse")
'select()' returned 1:1 mapping between keys and columns
Info: Working in directory E:/**/R/**
Info: Writing image file mmu04070.pathview.png
There were 50 or more warnings (use warnings() to see the first 50)
The version of RStudio is 1.1.423 and the version of R is 3.4.2.
I really appreciate any help you offer. Thanks.
0 answers
No answers yet.
Log in to answer this question.
Maybe the culprit is dplyr?
Please use the
CODE FORMATTINGbutton, your question is really hard to read due to the mix of code and regular text.Thank you so much for your suggestion, which really solved the problem. It's the first time I have posted on Biostars.
Thank zx8754 for editing your post, he did the hard work.
Hello giuseppe0525!
Questions similar to yours can already be found at:
We have closed your question to allow us to keep similar content in the same thread.
If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.
Cheers!
That is fine. Thanks for modifying the format of the post.