I am trying to use org.Hs.eg.db to annotate gene IDs extracted from calling genes on a TxDB as such
genes <- genes(TxDb.Hsapiens.UCSC.hg38.knownGene)
overlaps <- join_overlap_left_directedmycoords.gr, genes)
gene_result = as(overlaps, "data.frame")
I used this code taken directly from here https://www.bioconductor.org/packages/release/bioc/vignettes/AnnotationDbi/inst/doc/IntroToAnnotationPackages.pdf
annots <- select(org.Hs.eg.db, keys=gene_result$gene_id,
columns=c("SYMBOL","GENENAME"), keytype="ENTREZID")
But I get the following error message
Error in UseMethod("select_") : no applicable method for 'select_' applied to an object of class "c('OrgDb', 'AnnotationDb', 'envRefClass', '.environment', 'refClass', 'environment', 'refObject', 'AssayData')"
Any help or an alternate method would be appreciated.
What is the output of
str(gene_result)
?It's a data frame made from a GRanges object
problem fixed via other comment, thanks for your help anyway!