biomaRt error during getBM
Entering edit mode
Last seen 23 months ago

I tried to get mouse gene symbol corresponding to ensembl gene id as shown below.

> head(row.names(Data))
[1] "ENSMUSG00000051951" "ENSMUSG00000089699" "ENSMUSG00000102331" "ENSMUSG00000102343"
[5] "ENSMUSG00000025900" "ENSMUSG00000025902"

ensembl <- useEnsembl(biomart = "genes", dataset = "mmusculus_gene_ensembl")
ensemblID_symbol <- getBM(attributes = c("ensembl_gene_id", "mgi_symbol", "description"), 
                          filters = "ensembl_gene_id",
                          values = row.names(Data),
                          mart = ensembl)

And the error was shown. Any trouble in Database? please let me know how to solve this problem.

Error in .processResults(postRes, mart = mart, hostURLsep = sep, fullXmlQuery = fullXmlQuery, : Query ERROR: caught BioMart::Exception::Database: Error during query execution: Table 'ensembl_mart_107.mmusculus_gene_ensembl__ox_mgi__dm' doesn't exist

biomaRt • 2.2k views
Entering edit mode
Last seen 8 days ago
United States

The code you post won't actually work, as 'genes' is not a valid argument for 'biomart'

> ensembl <- useEnsembl(biomart = "genes", dataset = "mmusculus_gene_ensembl")
Ensembl site unresponsive, trying asia mirror
Error in textConnection(text, encoding = "UTF-8") : 
  invalid 'text' argument

If I do it the right way I see the same error as you though.

> gns
[1] "ENSMUSG00000051951" "ENSMUSG00000089699" "ENSMUSG00000102331"
[4] "ENSMUSG00000102343" "ENSMUSG00000025900" "ENSMUSG00000025902"

> mart <- useEnsembl("ensembl","mmusculus_gene_ensembl")
Ensembl site unresponsive, trying useast mirror
Ensembl site unresponsive, trying uswest mirror         <------ WUT
Ensembl site unresponsive, trying useast mirror

> getBM(c("ensembl_gene_id","mgi_symbol","description"), "ensembl_gene_id", gns, mart)
Error in .processResults(postRes, mart = mart, hostURLsep = sep, fullXmlQuery = fullXmlQuery,  : 
  Query ERROR: caught BioMart::Exception::Database: Error during query execution: Table 'ensembl_mart_107.mmusculus_gene_ensembl__ox_mgi__dm' doesn't exist

Mike Smith will probably be along shortly with information about what's happening on the Biomart/Ensembl side of things. The issue with trying to query an online database is that sometimes it's down/not available/whatever. But there are other options! Johannes Rainer makes EnsDb packages from each Ensembl version that you can get from the AnnotationHub.

> library(AnnotationHub)

> hub <- AnnotationHub()
snapshotDate(): 2022-04-21

## let's find the EnsDbs for mouse

> query(hub, c("ensdb","mus musculus"))
AnnotationHub with 20 records
# snapshotDate(): 2022-04-21
# $dataprovider: Ensembl
# $species: Mus musculus
# $rdataclass: EnsDb
# additional mcols(): taxonomyid, genome, description,
#   coordinate_1_based, maintainer, rdatadateadded, preparerclass, tags,
#   rdatapath, sourceurl, sourcetype 
# retrieve records with, e.g., 'object[["AH53222"]]' 

  AH53222  | Ensembl 87 EnsDb for Mus Musculus 
  AH53726  | Ensembl 88 EnsDb for Mus Musculus 
  AH56691  | Ensembl 89 EnsDb for Mus Musculus 
  AH57770  | Ensembl 90 EnsDb for Mus Musculus 
  AH60788  | Ensembl 91 EnsDb for Mus Musculus 
  ...        ...                               
  AH89211  | Ensembl 102 EnsDb for Mus musculus
  AH89457  | Ensembl 103 EnsDb for Mus musculus
  AH95775  | Ensembl 104 EnsDb for Mus musculus
  AH98078  | Ensembl 105 EnsDb for Mus musculus
  AH100674 | Ensembl 106 EnsDb for Mus musculus

## Uh, let's use the latest one, shall we?

> ensdb <- hub[["AH100674"]]
loading from cache
## make a query

> select(ensdb, gns, c("GENENAME","DESCRIPTION"), "GENEID")
              GENEID GENENAME
1 ENSMUSG00000051951     Xkr4
2 ENSMUSG00000089699   Gm1992
3 ENSMUSG00000102331  Gm19938
4 ENSMUSG00000102343  Gm37381
5 ENSMUSG00000025900      Rp1
6 ENSMUSG00000025902    Sox17
1    X-linked Kx blood group related 4 [Source:MGI Symbol;Acc:MGI:3528744]
2                  predicted gene 1992 [Source:MGI Symbol;Acc:MGI:3780162]
3                predicted gene, 19938 [Source:MGI Symbol;Acc:MGI:5012123]
4                predicted gene, 37381 [Source:MGI Symbol;Acc:MGI:5610609]
5       retinitis pigmentosa 1 (human) [Source:MGI Symbol;Acc:MGI:1341105]
6 SRY (sex determining region Y)-box 17 [Source:MGI Symbol;Acc:MGI:107543]

Unlike a query to biomaRt, the return order from select is guaranteed to be the same as the input data, and by default always includes the input values as well. As a defensive programming step you might want to use merge or match when combining with other data to be doubly sure the order is OK, but that's up to you.

Entering edit mode

Thanks James.

I actually followed the script shown in the website and "genes" is used as a argument.

I appreciate the alternative way to solve my problem using AnnotationHub. But, as Mike posted below, my problem will be solved soon.

Entering edit mode

Ah, good point! I didn't see that bomaRt had changed the choices for the 'biomart' argument. Thanks for pointing that out.

Entering edit mode
Mike Smith ★ 6.5k
Last seen 3 hours ago
EMBL Heidelberg

I suspect this was because Ensembl 107 was release today, and you managed to run your query at a time when the release was only partially done, hence the "missing table" error. This should only be temporary and I'd expect it to work in a day or so. Please post back here if that's not the case.

Entering edit mode

Hello. Would the Ensembl update explain also why one cant draw Ensembl ID's from the annotation package any longer? Or is that unrelated? As it would seem we are unable to get a list of ensembl keys from that package either.

I have been having an issue with Biomart this evening also with Ensembl - so can I assume it is likely this update?

Entering edit mode

They might be releated, but probably the best thing to do would be to post a new question with the code that's failing. That'll probably make the diagnosis easier.

Entering edit mode

Thanks Mike. I still see the same error at this moment. I will wait more days and see how it goes.


Login before adding your answer.

Traffic: 861 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6