Entering edit mode
5.3 years ago
sangram_keshari
▴
260
I am trying to make the org.db (x
) argument in AnnotationDbi::mapIds()
as variable, But
genelist <- c("ENSG00000074800","ENSG00000116285","ENSG00000171603","ENSG00000049245")
org_pkg <- "org.Hs.eg.db"
library(AnnotationDbi)
library(org_pkg)
entrez_Ids <- mapIds(org_pkg, as.character(genelist), 'ENTREZID', 'ENSEMBL')
Getting an Error message:
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘mapIds’ for signature ‘"character"’
Tried with as.symbol(org_pkg)
But no help.
Thanks for the answer. Yes this gives an output.
But suppose I am receiving a string object in
org_pkg
(because its coming from an Rscript argument, and its always a string). Then how to convert that string object to anAnnotationDbi
class.Good question!
I have no problem with loading package if the
org_pkg
is a string, Problem comes withmapIds()
Hey thank you so much. It solved :)