Our mart (on https) is not compatible with biomaRt access. What's wrong?
3
2
Entering edit mode
JWCarlson ▴ 80
@jwcarlson-10145
Last seen 7.7 years ago

We host a BioMart server at phytozome.jgi.doe.gov/ A user is having trouble accessing data using biomaRt. I have not used biomaRt much so I cannot answer this question for them.

p = useMart('phytozome_mart',dataset='phytozome',host='phytozome.jgi.doe.gov')

One issue I'm aware of is that we need to use https (this is a requirement by our infrastructure providers) and we need to inform users that they will need to set the global option

options(RCurlOptions=list(followlocation=TRUE))

Is there a way to specify using https in the useMart command? Preceding the hostname with the protocol appears not to work. Or, is there a more direct way for biomaRt to follow 'page moved' responses?

But attempting to retrieve results results in a 'line 1 did not have 3 elements' message and the verbose output shows that it only returns a generic html help page on how to conduct a query

getBM(attributes=c("gene_name1", "transcript_name1", "coding"), filters = "organism_id", values ="314", mart=p,verbose=TRUE)

Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
  line 1 did not have 3 elements

Is there a problem in how our BioMart is configured or in how the query is formulated? I can see from the web server logs that the GET request is hitting the server, but as far as I can see, there are no supplied parameters in the request. My assumption is that when the second request is issued, the parameters have been stripped off.

Thanks

> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
[1] C

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

other attached packages:
[1] biomaRt_2.18.0

loaded via a namespace (and not attached):
[1] RCurl_1.95-4.7 XML_3.98-1.3   bitops_1.0-6  
R biomart biomaRt • 1.6k views
ADD COMMENT
1
Entering edit mode
biomartdev ▴ 10
@biomartdev-10192
Last seen 8.7 years ago

Thanks I can add this to the code

ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 5 months ago
United States

It does look like the protocol is set to http:// in useMart() in a way that can't be over-written. getBM() actually sends a POST request (via RCurl postForm()). It seems that FOLLOWLOCATION when presented with a 302 code (returned by your server when the http query is sent) will switch POST to GET. So the work-around is to provide an appropriate mask to POSTREDIR, e.g.,

options(RCurlOptions=list(followlocation=TRUE, postredir=2L))
ADD COMMENT
0
Entering edit mode
JWCarlson ▴ 80
@jwcarlson-10145
Last seen 7.7 years ago

That does the trick. the postredir=2L was the part I needed. Thanks!

Will there be a future patch that allows for https and dealing with 'document moved' responses?

ADD COMMENT

Login before adding your answer.

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