This is a test version of Biostars. For the public version, visit https://www.biostars.org.
My keys are all ENSEMBL, but R says they are not valid keys for ENSEMBL

I am running DEseq2 analysis on human RNAseq data.

I finally just want my heatmap of top 20 DE genes so I can call it a day.

Code:

library(org.Mm.eg.db)

keytypes(org.Mm.eg.db)

mykeys<- c( "ENSG00000157077", "ENSG00000230844", "ENSG00000161055" ,"ENSG00000172244", "ENSG00000066933" ,"ENSG00000197497" ,"ENSG00000170631" ,"ENSG00000260285",
           "ENSG00000136193", "ENSG00000260744", "ENSG00000141540", "ENSG00000197978", "ENSG00000235781", "ENSG00000197093" ,"ENSG00000106868", "ENSG00000171596",
           "ENSG00000204475", "ENSG00000163053", "ENSG00000237940", "ENSG00000159339")

geneinfo <- AnnotationDbi::select(org.Mm.eg.db, keys=mykeys,
                                  columns=c("ENSEMBL", "SYMBOL","GENENAME"), 
                                  keytype="ENSEMBL")

This error now occurs: Error in .testForValidKeys(x, keys, keytype, fks) : 
  None of the keys entered are valid keys for 'ENSEMBL'. Please use the keys method to see a listing of valid arguments.

The 'mykeys' vector is clearly made of ENSEMBL IDs, but the error claims no valid keys for ENSEMBL are present.

I was using this code:

geneinfo <- AnnotationDbi::select(org.Mm.eg.db, keys=rownames(P482_resSort)[1:20],
                   columns=c("ENSEMBL", "SYMBOL","GENENAME"), 
                   keytype="ENSEMBL")

previously and it gave me the same error, so I changed the keys to what I thought was a straight-forward vector.

Does anyone have any ideas on how to overcome this error?

Thank you.

r ensembl deseq2

1 answer

Org.Mm.eg.db is the mouse organism database, but your ENSEMBL IDs are for human genes. Mouse ensembl ids start with ENSMUSG.

You probably need to use the human org db org.Hs.eg.db or to convert your human IDs to their corresponding mouse ortholog depending on your end goal.

Log in to answer this question.