[BioC] postForm in RCurl

Ovokeraye Achinike-Oduaran ovokeraye at gmail.com
Thu Oct 13 15:49:03 CEST 2011


Hi Duncan,

I didn't want to send any other emails on this question (to belabor
the point, that is), but I'm just slightly frustrated about the url
(and its backward and forward slashes) situation...because I'm
guessing that's what the problem currently is. The connection error
has been sorted (I think) like I previously alluded to. But, I run the
exact script that appears to work for you, and what I get is pasted
below.

Thanks again.

-Avoks


>  data = postForm("http://www.genome.gov/GWAStudies/#searchForm",
+                   disease = c("Fasting glucose-related traits"),
+                   submit = "Search")
>
>  tbl = readHTMLTable(htmlParse(data, asText = TRUE), which = 5, header = TRUE)

Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function "readHTMLTable", for
signature "NULL"

> data
[1] "<h1>Bad Request (Invalid URL)</h1>"
attr(,"Content-Type")

"text/html"

> sessionInfo()
R version 2.13.2 (2011-09-30)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_xxx  LC_CTYPE=English_xxx
LC_MONETARY=English_xxx LC_NUMERIC=C
[5] LC_TIME=English_xxx

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

other attached packages:
[1] XML_3.4-2.2     RCurl_1.6-10.1  bitops_1.0-4.1  puma_2.4.0
mclust_3.4.10   affy_1.30.0     limma_3.8.3     GEOquery_2.19.4
Biobase_2.12.2

loaded via a namespace (and not attached):
[1] affyio_1.20.0         preprocessCore_1.14.0 tools_2.13.2

On Wed, Oct 12, 2011 at 7:49 PM, Duncan Temple Lang
<duncan at wald.ucdavis.edu> wrote:
> Hi Ovokeraye
>
>  Your script is  okay. It works for me.
> Somehow the communication between the server and RCurl
> fell apart at some point.
> You should try it again now and see if it works now.
> Otherwise, are you behind some sort of firewall? proxy? etc.?
>
> While your query works, it gives no results in the table.
>
> I simplified the query to just one disease.
>
>  data = postForm("http://www.genome.gov/GWAStudies/#searchForm",
>                   disease = c("Fasting glucose-related traits"),
>                   submit = "Search")
>
>  tbl = readHTMLTable(htmlParse(data, asText = TRUE), which = 5, header = TRUE)
>
> and tbl contains the result.
>
>  D.
>
> On 10/12/11 4:26 AM, Ovokeraye Achinike-Oduaran wrote:
>> Hi all,
>>
>> I was trying to retrieve some information from the GWAS catalog using
>> the postForm() function. I get an error (below the script). I can't
>> seem to figure out where I went wrong in my script. Please help.
>>
>> -Avoks
>>
>>>  data = postForm("http://www.genome.gov/GWAStudies/#searchForm",
>> + disease = c("Fasting glucose-related traits",
>> + "Fasting insulin-related traits",
>> + "Fasting plasma glucose",
>> + "Insulin resistance/response",
>> + "Insulin traits",
>> + "Type 2 diabetes",
>> + "Type 2 diabetes and 6 quantitative traits",
>> + "Type 2 diabetes and other traits"),
>> + submit = "Search")
>>
>> Error in postForm("http://www.genome.gov/GWAStudies/#searchForm",
>> disease = c("Fasting glucose-related traits",  :
>>   Failure when receiving data from the peer
>>
>>> sessionInfo()
>> R version 2.13.2 (2011-09-30)
>> Platform: i386-pc-mingw32/i386 (32-bit)
>>
>> locale:
>> [1] LC_COLLATE=English_xxx  LC_CTYPE=English_xxx
>> [3] LC_MONETARY=English_xxx LC_NUMERIC=C
>> [5] LC_TIME=English_xxx
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>> [1] RCurl_1.6-10.1  bitops_1.0-4.1  puma_2.4.0      mclust_3.4.10
>> [5] affy_1.30.0     limma_3.8.3     GEOquery_2.19.4 Biobase_2.12.2
>>
>> loaded via a namespace (and not attached):
>> [1] affyio_1.20.0         preprocessCore_1.14.0 tools_2.13.2
>> [4] XML_3.4-2.2
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>



More information about the Bioconductor mailing list