Question: Error in BioMartVersion
gravatar for hodayabeer
15 months ago by
hodayabeer10 wrote:


I am trying to convert between EntrezID to gene symbol using 'bioMart' package and the following function:


  ensembl = useEnsembl(biomart="ensembl",dataset="hsapiens_gene_ensembl",GRCh=37)

  entrezIDs2Genes <- getBM(attributes=c('hgnc_symbol','entrezgene'),
                         filters = 'entrezgene',
                         values = ptwy_genes, # a vector containing the EntrezIds to convert
                         mart = ensembl)

  entrezIDs2Genes.ordered <- entrezIDs2Genes
  entrezIDs2Genes.ordered <- entrezIDs2Genes.ordered[order(entrezIDs2Genes.ordered$hgnc_symbol),]
  gene_symbol_list<-unique(gene_symbol_list[gene_symbol_list != ""])#remove redundancy and empty elements

  return(gene_symbol_list)#check if returns the appropriate value


I have a for loop that calls this function, each time for a different gene list, It worked perfect for about 100 different list of genes, but at some point it outputs the following error:

Request to BioMart web service failed. Verify if you are still connected to the internet.  Alternatively the BioMart web service is temporarily down.  Check and verify if this website is available.
Error in if (BioMartVersion == "\n" | BioMartVersion == "") { : 
  argument is of length zero

(the link works for me)
this is very strange, especially because I checked the specific gene list were it stops, and tried to apply to it the function manually (out of the for loop), and it worked!

I would very appritiate any idea for a solution to that...

thank you in advance!

ADD COMMENTlink modified 15 months ago by James Ashmore2.6k • written 15 months ago by hodayabeer10

When calling web services via a loop one should build a sleep/wait time to prevent going over maximum connections allowed by the site over unit time (e.g. ).

ADD REPLYlink modified 15 months ago • written 15 months ago by genomax65k

Can you update your post to include the output of sessionInfo() so we can see which versions of R and biomaRt you're using? I suspect your package is a little out of data, hasn't been the relevant website to check for quite a while & that error message is no longer in the current version of the package.

ADD REPLYlink written 15 months ago by Mike Smith1.2k
gravatar for James Ashmore
15 months ago by
James Ashmore2.6k
UK/Edinburgh/MRC Centre for Regenerative Medicine
James Ashmore2.6k wrote:

A slightly easier and faster method would be to use the annotation packages Bioconductor provides:

entrez <- c("100422954", "100422957", "100422959", "100422962")
symbol <- mapIds(, keys = entrez, keytype = "ENTREZID", column = "SYMBOL")
ADD COMMENTlink modified 15 months ago • written 15 months ago by James Ashmore2.6k
Please log in to add an answer.


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