[BioC] PostForm() with KEGG

Ovokeraye Achinike-Oduaran ovokeraye at gmail.com
Tue Feb 28 17:10:35 CET 2012


Hi,

I should probably be clearer with my question. I have a list of genes
which I've been able to get into pathways thanks to you. The whole
idea is to enrich the gene list by adding genes that are connected to
my focus genes. Is this something that is possible using the current
set of tools I'm using in R? I ask because I don't see what I want in
the elements in the current namespace per se. Would I need to specify
a different namespace for it to work or? I hope I am somewhat clear
and not all jumbled up with my ' question'.

Thanks.

Avoks.

On 2/28/12, Ovokeraye Achinike-Oduaran <ovokeraye at gmail.com> wrote:
> Hi Duncan,
>
> My understanding is that xpathSApply() combines both the geneSetNode()
> and the sapply(). I hope that this is a correct assumption. In
> attempting to retrieve nodes in general from the pathway, I used  both
>
> xpathSApply(doc, "//li/node()",  xmlGetAttr, "href")
> and
> xpathSApply(doc, "//li/a/node()",  xmlGetAttr, "href")
>
> and the I get nothing (null) back even though no visible error pops
> up. I something wrong with the way I'm using the path or do I just not
> yet grasp the whole XPath concept (I did read the online tutorial)?
>
> Sorry to drag this on, but please help.
>
> Thanks.
>
> Avoks
>
> On Mon, Feb 27, 2012 at 4:09 PM, Ovokeraye Achinike-Oduaran
> <ovokeraye at gmail.com> wrote:
>> Thank you so very much, Duncan. I will go get myself enlightened:).
>> Thanks again.
>>
>> Avoks
>>
>> On Mon, Feb 27, 2012 at 3:50 PM, Duncan Temple Lang
>> <duncan at wald.ucdavis.edu> wrote:
>>>
>>> Use
>>>
>>>   target = "alias"
>>>
>>> in the call.
>>>
>>> If you don't know how to map form elements to parameters in the request,
>>> you
>>> can either read  a tutorial on HTML forms, or alternatively, use
>>> the RHTMLForms package which you have loaded according to your search
>>> path, e.g.
>>>
>>>  # read the form  and then turn the information into an R function.
>>> ff =
>>> getHTMLFormDescription("http://www.genome.jp/kegg/tool/map_pathway1.html")
>>> fun = createFunction(ff[[1]])
>>>
>>>  # Since the action in the form is javascript, we'll provide the
>>>  # URL manually.
>>> u = "http://www.genome.jp/kegg-bin/search_pathway_object"
>>> out = fun(unclassified = "ko:K01803 cpd:C00111 cpd:C00118 K00134
>>> C00236",
>>>          target = "alias", .url = u)
>>>
>>> The benefits of the RHTMLForms include using the same defaults
>>> as the form on the Web page, adding hidden parameters, identifying
>>> the names of the parameters.
>>>
>>>   D
>>>
>>>
>>> On 2/27/12 3:08 AM, Ovokeraye Achinike-Oduaran wrote:
>>>> Hi Duncan,
>>>>
>>>> I noticed that with the script as is, it doesn't take into
>>>> consideration the "include alias" checkbox. I tried modifying the
>>>> script to force include that option but it still did not work. Any
>>>> ideas?
>>>>
>>>> u = "http://www.genome.jp/kegg-bin/search_pathway_object"
>>>> data = postForm(u,
>>>>                .params = list(org_name = "hsadd",
>>>>                unclassified = paste(readLines(file.choose()), collapse =
>>>> "\n"),
>>>>                file = "", checkbox = "alias", submit = "Exec"))
>>>>
>>>>
>>>> Thanks again.
>>>>
>>>> Avoks
>>>>
>>>>
>>>> On Mon, Feb 27, 2012 at 10:24 AM, Ovokeraye Achinike-Oduaran
>>>> <ovokeraye at gmail.com> wrote:
>>>>> Hi Duncan,
>>>>>
>>>>> Thanks a bunch.
>>>>>
>>>>> -Avoks
>>>>>
>>>>> On Fri, Feb 24, 2012 at 11:09 PM, Duncan Temple Lang
>>>>> <duncan at wald.ucdavis.edu> wrote:
>>>>>> Hi Avoks
>>>>>>
>>>>>> While the form is provided by KEGG and so bio-relatd,
>>>>>> you might have been better posting this to the more general r-help
>>>>>> mailing list.
>>>>>>
>>>>>>
>>>>>> You are posting the HTTP request to the wrong URL. That is the URL
>>>>>> of the Web page that displays the form, not the URL that processes
>>>>>> the input from the form.
>>>>>> You have to look at the JavaScript that is referenced in the action
>>>>>> attribute of the HTML form element.
>>>>>>
>>>>>> The second issue is that you are submitting the name of a local file.
>>>>>> This won't work as is.  You either need to identify this is the name
>>>>>> of a file and not the contents
>>>>>> of the file to send, or else send the contents.  In this form, you can
>>>>>> send the
>>>>>> contents via the the unclassified parameter.
>>>>>>
>>>>>>
>>>>>> u = "http://www.genome.jp/kegg-bin/search_pathway_object"
>>>>>> data = postForm(u,
>>>>>>                .params = list(org_name = "hsadd",
>>>>>>                               unclassified = "hsa:7167 hsa:GPI
>>>>>> cpd:C00118\nALDOA 1.2.1.12 C00236",
>>>>>>                               file = "", submit = "Exec"))
>>>>>>
>>>>>>
>>>>>> If your input is in a file, you can use
>>>>>>
>>>>>>  unclassified = paste(readLines(file.choose()), collapse = "\n")
>>>>>>
>>>>>> as the value for the unclassified parameter.
>>>>>>
>>>>>>
>>>>>> There are additional parameters that the form accepts that may be
>>>>>> relevant for your search.
>>>>>>
>>>>>>
>>>>>> As for processing the results, you will want to use
>>>>>>
>>>>>>  doc = htmlParse(data, asText = TRUE)
>>>>>>
>>>>>> and then use getNodeSet()/xpathSApply() or direct tree extraction to
>>>>>> access the nodes you want, e.g.
>>>>>>
>>>>>>  xpathSApply(doc, "//li/a",  xmlGetAttr, "href")
>>>>>>
>>>>>>
>>>>>>  D.
>>>>>>
>>>>>>
>>>>>> On 2/24/12 6:09 AM, Ovokeraye Achinike-Oduaran wrote:
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I am trying to use postForm() with the KEGG website but I am stuck
>>>>>>> on
>>>>>>> how to get my results. Is it possible (code below) or am I using
>>>>>>> postForm() wrongly? The code appears to run but I'm not quite sure
>>>>>>> how
>>>>>>> to read the results assuming there are any. Please help.
>>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>> Avoks
>>>>>>> ____
>>>>>>>
>>>>>>> data = postForm("http://www.genome.jp/kegg/tool/map_pathway1.html",
>>>>>>> org_name = "hsadd",
>>>>>>> file = file.choose(),
>>>>>>> submit = "Exec")
>>>>>>>
>>>>>>>> sessionInfo()
>>>>>>> R version 2.14.1 (2011-12-22)
>>>>>>> Platform: i386-pc-mingw32/i386 (32-bit)
>>>>>>>
>>>>>>> locale:
>>>>>>> [1] LC_COLLATE=English_xxx.1252  LC_CTYPE=English_xxx.1252
>>>>>>> [3] LC_MONETARY=English_xxx.1252 LC_NUMERIC=C
>>>>>>> [5] LC_TIME=English_xxx.1252
>>>>>>>
>>>>>>> attached base packages:
>>>>>>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>>>>>>
>>>>>>> other attached packages:
>>>>>>> [1] RHTMLForms_0.5-1 XML_3.9-4.1      RCurl_1.91-1.1
>>>>>>> bitops_1.0-4.1
>>>>>>>
>>>>>>> loaded via a namespace (and not attached):
>>>>>>> [1] tools_2.14.1
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> 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