annotation: how to use "character" for function 'select()'
1
0
Entering edit mode
Guido Hooiveld ★ 4.0k
@guido-hooiveld-2020
Last seen 2 days ago
Wageningen University, Wageningen, the …

I face a small issue, which likely is easy to solve.....:

I would like to automatically retrieve annotation information for expressionSets, but somehow I don't get it to work...:

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘select’ for signature ‘"character"’

Any suggestions to solve this?

Thanks,

Guido

 

 > library(affyPLM)
> affy.data <- ReadAffy()
>
> x.norm <- rma(affy.data)
Background correcting
Normalizing
Calculating Expression
>
> head(featureNames(x.norm))
[1] "1415670_at"   "1415671_at"   "1415672_at"   "1415673_at"   "1415674_a_at"
[6] "1415675_at"  
>
> annotation(x.norm)
[1] "mouse4302"
>
> require(paste(annotation(x.norm),".db", sep=""), character.only=TRUE)
Loading required package: mouse4302.db
Loading required package: org.Mm.eg.db

>
> paste(annotation(x.norm),".db", sep="")
[1] "mouse4302.db"
>
> anno.result <- select(paste(annotation(x.norm),".db", sep=""),
+ keys=featureNames(x.norm), columns=c("ENTREZID","SYMBOL"), keytype="PROBEID")
Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘select’ for signature ‘"character"’
>

 

annotation organismdb • 1.2k views
ADD COMMENT
1
Entering edit mode
@martin-morgan-1513
Last seen 7 days ago
United States

use select(get(paste0(annotation(x.norm), ".db")), ...) or

pkg <- paste0(annotation(x.norm), ".db")
db <- loadNamespace(pkg)[[pkg]]
ADD COMMENT
0
Entering edit mode

Thanks Martin, working nicely now with get!

ADD REPLY

Login before adding your answer.

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