Dear list,

With the help of friendly IT support, I have a solution to this problem.  I am posting their response here for anyone else experiencing a similar problem.

Lisa


The biomaRt library calls the postForm function of RCurl to submit the query to the web service. The resultant HTTP request contains an HTTP 1.1 header

Expect: 100 - continue

The squid proxy doesn't support HTTP 1.1. so responds with an error "417: Expectation failed"

The RCurl manual suggested that the HTTP version can be restricted by setting the http.version to the symbolic constant HTTP_VERSION_1_0

library(RCurl)
options(RCurlOptions = list(proxy="wwwcache.gla.ac.uk:8080",http.version=HTTP_VERSION_1_0))

If I do this I can successfully retrieve the result for the example in the help e.g.

library(RCurl)
options(RCurlOptions = list(proxy="wwwcache.gla.ac.uk:8080",http.version=HTTP_VERSION_1_0))
library(biomaRt)
mart <- useMart("ensembl")
datasets <- listDatasets(mart)
mart<-useDataset("hsapiens_gene_ensembl",mart)
getBM(attributes=c("affy_hg_u95av2","hgnc_symbol","chromosome_name","band"),filters="affy_hg_u95av2",values=c("1939_at","1503_at","1454_at"), mart=mart)

which results in the output

  affy_hg_u95av2 hgnc_symbol chromosome_name   band
1        1939_at        TP53              17  p13.1
2        1503_at       BRCA2              13  q13.1
3        1454_at       SMAD3              15 q22.33





On 01/03/12 16:20, Steffen Durinck wrote:
Hi Lisa,

This query works for me, maybe the BioMart server was temporarily down at the time you tried the query:

> getBM(attributes=c("affy_hg_u95av2","hgnc_symbol"),filters="affy_hg_u95av2",values=c("1939_at"), mart=human.ensembl,verbose=TRUE)
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE Query><Query  virtualSchemaName = 'default' uniqueRows = '1' count = '0' datasetConfigVersion = '0.6' requestid= "biomaRt"> <Dataset name = 'hsapiens_gene_ensembl'><Attribute name = 'affy_hg_u95av2'/><Attribute name = 'hgnc_symbol'/><Filter name = 'affy_hg_u95av2' value = '1939_at' /></Dataset></Query>
  affy_hg_u95av2 hgnc_symbol
1        1939_at        TP53


Cheers,
Steffen

On Thu, Mar 1, 2012 at 12:40 AM, Lisa Hopcroft <Lisa.Hopcroft@glasgow.ac.uk<mailto:Lisa.Hopcroft@glasgow.ac.uk>> wrote:
Hi,

I'm still getting the error that I described in my previous email.  I'm now wanting to use biomaRt for something else and I really don't want to have to use a flatfile format.

Is everyone getting this error?  (MWE to follow at end of email).

Is the server down?  Does anyone know how to check whether the server is down?

Thanks again,
Lisa

MWE (modified from getBM help file):


> rm(list=ls())
> library(biomaRt)
> mart <- useMart("ensembl")
> human.ensembl <-useDataset("hsapiens_gene_ensembl",mart)
> getBM(attributes=c("affy_hg_u95av2","hgnc_symbol"),filters="affy_hg_u95av2",values=c("1939_at"), mart=human.ensembl,verbose=TRUE)
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE Query><Query  virtualSchemaName = 'default' uniqueRows = '1' count = '0' datasetConfigVersion = '0.6' requestid= "biomaRt"> <Dataset name = 'hsapiens_gene_ensembl'><Attribute name = 'affy_hg_u95av2'/><Attribute name = 'hgnc_symbol'/><Filter name = 'affy_hg_u95av2' value = '1939_at' /></Dataset></Query>
                                                                                                                           V1
1                           <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd>
2                                             <HTML><HEAD><META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=iso-8859-1>
3                                                               <TITLE>ERROR: The requested URL could not be retrieved</TITLE>
4 <STYLE type=text/css><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
5                                                                                                                </HEAD><BODY>
6                                                                                                               <H1>ERROR</H1>
Error in getBM(attributes = c("affy_hg_u95av2", "hgnc_symbol"), filters = "affy_hg_u95av2",  :
 The query to the BioMart webservice returned an invalid result: the number of columns in the result table does not equal the number of attributes in the query. Please report this to the mailing list.

> sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: i686-pc-linux-gnu (32-bit)

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8     LC_MONETARY=C
 [6] LC_MESSAGES=en_GB.UTF-8    LC_PAPER=en_GB.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] biomaRt_2.8.1  limma_3.8.2    gplots_2.8.0   caTools_1.12   bitops_1.0-4.1 gtools_2.6.2   gdata_2.8.2

loaded via a namespace (and not attached):
[1] RCurl_1.91-1 tools_2.13.1 XML_3.9-4
>



On 22/02/12 11:22, Lisa Hopcroft wrote:
Hallo,

I'm trying to map Uniprot accessions to Ensembl protein IDs using the biomaRt library in bioconductor.  This has worked in the past, but I'm getting an error today.  Is the server down?  Is there anywhere/anyhow I can check whether the server is down?

MWE and errors follow:

=============================
library(biomaRt)

human.ensembl <- useMart("ensembl", dataset = "hsapiens_gene_ensembl")
uniprot.list <- c( "Q09666" )

uniprot2ensembl <- getBM(
 attributes = c( "uniprot_swissprot_accession","ensembl_peptide_id" ),
 filters    = "uniprot_swissprot_accession",
 values     = uniprot.list,
 mart       = human.ensembl )

=============================
                                                                                                                           V1
1                           <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd>
2                                             <HTML><HEAD><META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=iso-8859-1>
3                                                               <TITLE>ERROR: The requested URL could not be retrieved</TITLE>
4 <STYLE type=text/css><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
5                                                                                                                </HEAD><BODY>
6                                                                                                               <H1>ERROR</H1>
Error in getBM(attributes = c("uniprot_swissprot_accession", "ensembl_peptide_id"),  :
 The query to the BioMart webservice returned an invalid result: the number of columns in the result table does not equal the number of attributes in the query. Please report this to the mailing list.
=============================

Session info:

R version 2.13.1 (2011-07-08)
Platform: i686-pc-linux-gnu (32-bit)

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
 [5] LC_MONETARY=C              LC_MESSAGES=en_GB.UTF-8    LC_PAPER=en_GB.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] biomaRt_2.8.1         preprocessCore_1.14.0 vsn_3.20.0            Biobase_2.12.2

loaded via a namespace (and not attached):
[1] affy_1.30.0     affyio_1.20.0   grid_2.13.1     lattice_0.19-33 limma_3.8.2     RCurl_1.91-1    tools_2.13.1
[8] XML_3.9-4


Many thanks in advance,
Lisa

PS. Apologies if I've sent this to the wrong place, please set me right if I have.


--

Dr Lisa Hopcroft (née McMillan)
Postdoctoral research assistant
www.dcs.gla.ac.uk/~lisa/<http://www.dcs.gla.ac.uk/%7Elisa/><http://www.dcs.gla.ac.uk/%7Elisa/>

R315 Level 3
Paul O'Gorman Leukaemia Research Centre
Gartnavel General Hospital
Glasgow G12 0YN
+44 (0) 141 301 7882<tel:%2B44%20%280%29%20141%20301%207882>

R308 Level 3
Sir Alwyn Williams Building
School of Computing Science
University of Glasgow
Glasgow G12 8QQ
+44 (0) 141 330 1648<tel:%2B44%20%280%29%20141%20330%201648>

Skype: lisahopcroft

[Working days: Tuesday-Friday]



--

Dr Lisa Hopcroft (née McMillan)
Postdoctoral research assistant
www.dcs.gla.ac.uk/~lisa/<http://www.dcs.gla.ac.uk/%7Elisa/><http://www.dcs.gla.ac.uk/~lisa/<http://www.dcs.gla.ac.uk/%7Elisa/>>

R315 Level 3
Paul O'Gorman Leukaemia Research Centre
Gartnavel General Hospital
Glasgow G12 0YN
+44 (0) 141 301 7882<tel:%2B44%20%280%29%20141%20301%207882>

R308 Level 3
Sir Alwyn Williams Building
School of Computing Science
University of Glasgow
Glasgow G12 8QQ
+44 (0) 141 330 1648<tel:%2B44%20%280%29%20141%20330%201648>

Skype: lisahopcroft

[Working days: Tuesday-Friday]


________________________________
The University of Glasgow, charity number SC004401

       [[alternative HTML version deleted]]


_______________________________________________
Bioconductor mailing list
Bioconductor@r-project.org<mailto:Bioconductor@r-project.org>
https://stat.ethz.ch/mailman/listinfo/bioconductor
Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor



--

Dr Lisa Hopcroft (née McMillan)
Postdoctoral research assistant
www.dcs.gla.ac.uk/~lisa/<http://www.dcs.gla.ac.uk/~lisa/>

R315 Level 3
Paul O'Gorman Leukaemia Research Centre
Gartnavel General Hospital
Glasgow G12 0YN
+44 (0) 141 301 7882

R308 Level 3
Sir Alwyn Williams Building
School of Computing Science
University of Glasgow
Glasgow G12 8QQ
+44 (0) 141 330 1648

Skype: lisahopcroft

[Working days: Tuesday-Friday]


________________________________
The University of Glasgow, charity number SC004401

	[[alternative HTML version deleted]]

