Question: Error with using getBM function in biomaRt
0
gravatar for Apex92
9 months ago by
Apex9220
Apex9220 wrote:

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

ADD COMMENTlink modified 9 months ago • written 9 months ago by Apex9220

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 REPLYlink written 9 months ago by Ram32k

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

ADD REPLYlink modified 9 months ago by Ram32k • written 9 months ago by Apex9220

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 REPLYlink written 9 months ago by Ram32k

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 REPLYlink modified 9 months ago • written 9 months ago by Apex9220

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 REPLYlink written 9 months ago by Apex9220
0
gravatar for Apex92
9 months ago by
Apex9220
Apex9220 wrote:

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 COMMENTlink modified 9 months ago • written 9 months ago by Apex9220
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.3.0
Traffic: 1088 users visited in the last hour
_