Error with using getBM function in biomaRt
1
0
Entering edit mode
4.0 years ago
Apex92 ▴ 280

I have search a lot of online sources to solve this problem but couldn't. I'm using getBM() function of biomaRt but getting an error. I have used this code like 7 months ago without any error but now it's giving error and I think it should probably be because of the server ????

what I use:

db <- useMart('ENSEMBL_MART_ENSEMBL',dataset='mmusculus_gene_ensembl', host="www.ensembl.org")
go_ids <- getBM(attributes=c('go_id', 'ensembl_gene_id', 'namespace_1003'), filters='ensembl_gene_id', values=bg_genes, mart=db)

values=bg_genes is around ~20000 gene ids. I tried with less gene ids (10) then it worked.

The ERROR:

Error in getBM(attributes = c("go_id", "ensembl_gene_id", "namespace_1003"),  : 
  The query to the BioMart webservice returned an invalid result: biomaRt expected a character string of length 1. 
Please report this on the support site at http://support.bioconductor.org

It there any other way to solve this? I need all my ~20000 in values=bg_genes

rna-seq R software error biomaRt • 1.8k views
ADD COMMENT
0
Entering edit mode

There's probably an element in bg_genes that is not a character string.

What is the output to these commands:

class(bg_genes)
table(sapply(bg_genes, class))
ADD REPLY
0
Entering edit mode

bg_genes class is character and the output for the second command is character 22287

ADD REPLY
0
Entering edit mode

I'd recommend passing bg_genes in batches of 5000 and then picking the batch that errors out, then drilling down further to find examples of entries that cause this error.

ADD REPLY
0
Entering edit mode

I couldn't understand exactly what you just recommended. Since I need all the background genes for GO analyses how reliable it is to cut them in batches of 5000 genes?

ADD REPLY
0
Entering edit mode

When I tried to use this with fewer genes it worked. Isn't this because of the server error? I was also getting an unusual ensemble error when I was trying to download some data manually.

ADD REPLY
0
Entering edit mode
4.0 years ago
Apex92 ▴ 280

It seems that there was a server error in ensembl. I ran my code again and again (without any change) and finally, it completed the downloading without any error

ADD COMMENT

Login before adding your answer.

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