Search
Question: select() gene in db not working although key exists
0
gravatar for Patrick Schorderet
3.7 years ago by
United States
Patrick Schorderet20 wrote:

 

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")
  
ADD COMMENTlink modified 3.7 years ago • written 3.7 years ago by Patrick Schorderet20
1
gravatar for James W. MacDonald
3.7 years ago by
United States
James W. MacDonald48k wrote:

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 COMMENTlink written 3.7 years ago by James W. MacDonald48k
0
gravatar for Patrick Schorderet
3.7 years ago by
United States
Patrick Schorderet20 wrote:

Great, thanks a lot!

ADD COMMENTlink written 3.7 years ago by Patrick Schorderet20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 319 users visited in the last hour