select() gene in db not working although key exists
2
0
Entering edit mode
@patrick-schorderet-6081
Last seen 6.1 years ago
United States

 

Hi all,

I'm trying to find the names (e.g. SYMBOLS) corresponding to gene ID using the "org.Dm.eg.db" and "TxDb.Dmelanogaster.UCSC.dm3.ensGene" libraries. I have done it (and it works) when I try with the mm9 (mouse) genome, but some how, I get an error if I try with the drosophila genome.

I have pasted some code below:

Part1: Mouse genome and libraries. This works  with no error.

Part2: Drosophila genome and librairies. I get the following error:

 Error in .testForValidKeys(x, keys, keytype) : 
  None of the keys entered are valid keys for 'ENTREZID'. Please use the keys method to see a listing of valid arguments.

However, when I try to look at the possible keys, the "SYMBOL" is present, so I don't understand..

 keytypes(drosoDB2)
 [1] "ENTREZID"     "ACCNUM"       "ALIAS"        "CHR"          "CHRLOC"      
 [6] "CHRLOCEND"    "ENZYME"       "MAP"          "PATH"         "PMID"        
[11] "REFSEQ"       "SYMBOL"       "UNIGENE"      "ENSEMBL"      "ENSEMBLPROT" 
[16] "ENSEMBLTRANS" "GENENAME"     "UNIPROT"      "GO"           "EVIDENCE"    
[21] "ONTOLOGY"     "GOALL"        "EVIDENCEALL"  "ONTOLOGYALL"  "FLYBASE"     
[26] "FLYBASECG"    "FLYBASEPROT" 

Any help would be greatly appreciated. Thanks!

 

Part 1 (Mouse)

   TaxonDatabaseKG <- "TxDb.Mmusculus.UCSC.mm9.knownGene"
   TaxonDatabaseDict <- "org.Mm.eg.db"
   library(TaxonDatabaseKG, character.only = TRUE)
   library(TaxonDatabaseDict, character.only = TRUE)
   exonRanges <- exonsBy(get(TaxonDatabaseKG), by = "gene")
   symb <- select(get(TaxonDatabaseDict), names(exonRanges), columns = "SYMBOL")
   mouseDB1 <- get("TxDb.Mmusculus.UCSC.mm9.knownGene")
   keytypes(mouseDB1)
   help('select')
   mouseDB2 <- get("org.Mm.eg.db")
   keytypes(mouseDB)
   symb <- select(get(TaxonDatabaseDict), names(exonRanges), columns = "SYMBOL")

 

Part 2 (Drosophila)

  
   TaxonDatabaseKG <- "TxDb.Dmelanogaster.UCSC.dm3.ensGene"
   TaxonDatabaseDict <- "org.Dm.eg.db"
   library(TaxonDatabaseKG, character.only = TRUE)
   library(TaxonDatabaseDict, character.only = TRUE)
   exonRanges <- exonsBy(get(TaxonDatabaseKG), by = "gene")
   symb <- select(get(TaxonDatabaseDict), names(exonRanges), columns = "SYMBOL")
   drosoDB1 <- get("TxDb.Dmelanogaster.UCSC.dm3.ensGene")
   keytypes(drosoDB1)
   drosoDB2 <- get("org.Dm.eg.db")
   keytypes(drosoDB2)
   symb <- select(get(TaxonDatabaseDict), names(exonRanges), columns = "SYMBOL")
  
annotationdbi org.mm.eg.db org.dm.eg.db select • 6.8k views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States

Note the error you got:

Error in .testForValidKeys(x, keys, keytype) : 
  None of the keys entered are valid keys for 'ENTREZID'. Please use the keys method to see a listing of valid arguments.

That's intended to be pretty clear - the keys you are using are (by default) expected to be Entrez Gene IDs, but what you are passing in do not appear to be Entrez Gene IDs. So let's look at what we have here:

> exonRanges <- exonsBy(TxDb.Dmelanogaster.UCSC.dm3.ensGene, by = "gene")
> head(names(exonRanges))
[1] "FBgn0000003" "FBgn0000008" "FBgn0000014" "FBgn0000015" "FBgn0000017"
[6] "FBgn0000018"

So that makes sense - those look like flybase IDs to me, not Entrez Gene IDs.

> select(org.Dm.eg.db, head(names(exonRanges)), "SYMBOL","FLYBASE")
      FLYBASE         SYMBOL
1 FBgn0000003 7SLRNA:CR32864
2 FBgn0000008              a
3 FBgn0000014          abd-A
4 FBgn0000015          Abd-B
5 FBgn0000017            Abl
6 FBgn0000018            abo
ADD COMMENT
0
Entering edit mode
@patrick-schorderet-6081
Last seen 6.1 years ago
United States

Great, thanks a lot!

ADD COMMENT

Login before adding your answer.

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