rajko-horvat / RevigoCore

REVIGO (REduce + VIsualize Gene Ontology) Core library
MIT License
6 stars 1 forks source link

userData simple restAPI R #2

Open kesselhwvan opened 1 year ago

kesselhwvan commented 1 year ago

Hi,

I can not figure out through the documentation what the userData object should be and contain?

httr::POST( url = "http://revigo.irb.hr/Revigo", body = list( cutoff = "0.7", valueType = "pvalue", speciesTaxon = "0", measure = "SIMREL", goList = userData ), encode = "form" ) -> res

is it a list, df, matrix? Could you provide an reproducible example?

Hugo

rajko-horvat commented 1 year ago

Hi Hugo, First, if you want more results than a simple result table, use a Advanced job method (See our FAQ page for details and examples).

The result from a RestfulAPI method is in html (a quote from our FAQ): "The output is in HTML format, it has "ErrorMessage" element in which you can find error description(s) (if any error occured) and table for each available namespace with the following names: "BiologicalProcess", "CellularComponent" and "MolecularFunction". The tables have following columns: "Term ID", "Name", "Frequency", "Value", "Uniqueness", "Dispensability", "Eliminated" and "Representative"".

You can view the output yourself from the web browser with the following HTML code (save as file in, for example, test.html, then open with web browser):

<html>
    <head>
        <title>Revigo RestfulAPI test page</title>
    </head>
    <body>
        <form action="http://revigo.irb.hr/Revigo" method="post">
            <textarea name="goList" cols="80" rows="10">
            </textarea><br />
            <input name="cutoff" type="text" value="0.70" /><br />
            <input name="valueType" type="text" value="pvalue"/><br />
            <input name="speciesTaxon" type="text" value="0"/><br />
            <input name="measure" type="text" value="SIMREL"/><br />
            <input name="autoStart" type="text" value="false"/><br />
            <input name="submitForm" type="submit" value="Submit"/>
        </form>
    </body>
</html>

More specific, the output looks more like this:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Revigo RESTful results</title>
</head>
<body>
    <div id="ErrorMessage" name="ErrorMessage"></div>
    <table id="BiologicalProcess">
        <tr>
            <th>Term ID</th>
            <th>Name</th>
            <th>Frequency</th>
            <th>Value</th>
            <th>Uniqueness</th>
            <th>Dispensability</th>
            <th>Eliminated</th>
            <th>Representative</th>
        </tr>
...table data...
    </table>
    <table id="CellularComponent">
The same content as first table, but for Cellular component namespace, if available
    </table>
    <table id="MolecularFunction">
The same content as first table, but for Molecular function namespace, if available
    </table>
</body>
</html>

Hope this helps ;)