I am trying to convert a list of gene names into Ensembl IDs but I'm having a bit of trouble.
I've tried using the EnsDb.Hsapiens.v86 package but I always get LRG-ID values returned as well, even when using the GeneIdFilter "startsWith" thing.
My code looks like this:
targets <- as.character(targetCSV[, 2]) targetEnsemble <- ensembldb::select( EnsDb.Hsapiens.v86, filter = GeneIdFilter("ENS", "startsWith"), keys = targets, keytype = "SYMBOL", columns = c("SYMBOL","GENEID"))
And for example I get back:
SYMBOL GENEID 1 CYR61 ENSG00000142871 2 CTGF ENSG00000118523 3 AMOTL2 ENSG00000114019 4 ANKRD1 ENSG00000148677 5 ANKRD1 LRG_379 6 IGFBP3 ENSG00000146674 7 F3 ENSG00000117525
I also tried using org.Hs.eg.db package but get a different problem where some of my genes return NA.
mapIds(x = org.Hs.eg.db, keys = targets, "ENSEMBL", "SYMBOL", fuzzy = TRUE, multiVals = first)
And this works on some but not all the genes for some reason.
$CYR61  NA $CTGF  NA $AMOTL2  "ENSG00000114019" $ANKRD1  "ENSG00000148677" $IGFBP3  "ENSG00000146674" $F3  "ENSG00000117525"
If anyone can solve either of these problems that would be great, thanks in advance!