Question: (Closed) Pathview error: no applicable method for 'select_'
1
gravatar for giuseppe0525
12 months ago by
giuseppe052520
Shanghai
giuseppe052520 wrote:

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.

rna-seq R software error • 1.0k views
ADD COMMENTlink modified 12 months ago by zx87547.3k • written 12 months ago by giuseppe052520
1

Maybe the culprit is dplyr?

Please use the CODE FORMATTING button, your question is really hard to read due to the mix of code and regular text.

code_formatting

ADD REPLYlink written 12 months ago by h.mon25k

Thank you so much for your suggestion, which really solved the problem. It's the first time I have posted on Biostars.

ADD REPLYlink modified 12 months ago • written 12 months ago by giuseppe052520
1

Thank zx8754 for editing your post, he did the hard work.

ADD REPLYlink written 12 months ago by h.mon25k
1

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!

ADD REPLYlink written 12 months ago by zx87547.3k
1

That is fine. Thanks for modifying the format of the post.

ADD REPLYlink written 12 months ago by giuseppe052520
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1980 users visited in the last hour