Source

pyrna-rest-clients / README.md

Full commit

PyRNA REST clients -- Documentation and source code samples to use the PyRNA Web Services

This project provides a documentation and several source code samples for basic clients using the Web Services exposed by the REST server of PyRNA (see the script restserver.py). More advanced clients can also be used, like Assemble2.

For all the clients described here, the default URL is : http://arn-ibmc.in2p3.fr/. This can be changed using the options -h for the host name and -p for the port. Examples:

  • with the default base URL: annotate3d.js -f PDB_file.pdb

  • with a user defined base URL: annotate3d.js -f PDB_file.pdb -h http://localhost -p 8080

Computation of RNA Secondary Structure(s)

The base URL is: http://arn-ibmc.in2p3.fr/api/compute/2d

The webservice is accessible through GET and POST requests:

  • GET request => predict a 2D from a single sequence or annotate a 3D using its PDBID
  • POST request => if the first line of the data sent starts with a '>' (FASTA format), a structural alignment will be computed. If not, the webservice tries to annotate a 3D.

GET request

It returns the JSON description of a secondary structure.

Examples (click on the link to see the result. We suggest you to use a browser like Google Chrome which is able to format raw JSON data into tree view):

http://arn-ibmc.in2p3.fr/api/compute/2d?tool=rnaview&pdbid=1GID

http://arn-ibmc.in2p3.fr/api/compute/2d?tool=rnaview&pdbid=1EHZ&output=rnaml

http://arn-ibmc.in2p3.fr/api/compute/2d?tool=contrafold&seq=AGAGGGGAGGACCAAAAACCCCC&output=bpseq

http://arn-ibmc.in2p3.fr/api/compute/2d?tool=rnafold&seq=AGAGGGGAGGACCAAAAACCCCC&output=vienna&name=my_seq

http://arn-ibmc.in2p3.fr/api/compute/2d?tool=rnafold&seq=AGAGGGGAGGACCAAAAACCCCC&name=my_seq

The parameters

  • tool (mandatory): the name of the tool to be used.
    • Accepted values for a 2D prediction: contrafold, rnafold.
    • Accepted values for a 3D annotation: rnaview
  • pdbid (mandatory for the 3D annotation): id of the PDB file to annotate. The web service will download it from the PDB website.
  • output (optional): the output format. If no output is precised, the 2D is described using the JSON format.
    • Accepted values for a 2D prediction: vienna, bpseq.
    • Accepted values for a 3D annotation: rnaml.
  • seq (mandatory for the 2D prediction): an RNA primary sequence
  • name (optional, only used for the 2D prediction): the name for the RNA sequence

POST request

It returns the JSON description of a secondary structure (for a PDB file or a FASTA file containing a single sequence) or of a structural alignment (for a FASTA file containing more than one sequence). Take a look at the Java and Javascript code samples for details.

The parameters:

  • tool (mandatory): the name of the tool to be used.
    • accepted values for a structural alignment: mlocarna, foldalign.
    • accepted values for a 3D annotation: rnaview
  • data (mandatory): the content of a FASTA file (for the computation of an RNA2D structure or structural alignment) or the content of a PDB file (for an RNA 3D annotation).
  • output (optional, only used for the 3D annotation): if its value is "rnaml", the rnaml ouput of the rnaview algorithm is returned (and not a JSON version, which is the default behavior)

Computation of a 2D plot for an RNA Secondary Structure

The base URL is: http://arn-ibmc.in2p3.fr/api/compute/2dplot

The webservice is accessible through POST requests.

POST request

It returns the JSON description of a 2D plot.

  • data (mandatory): the content of a VIENNA file.
  • output (optional): the output format. If no output is precised, the 2D plot is described using the JSON format. Accepted values: svg.

Source code examples

  • client.nb: Mathematica 9 notebook with GET requests.

  • annotate3d.js: Javascript file using node.js (http://nodejs.org/). It annotates a local PDB file using a POST request.
    Usage: ./annotate3d.js -f PDB_file [-h host_name (default: http://arn-ibmc.in2p3.fr)] [-p port (default: 80)]

  • annotate3d.R: R script to annotate a 3D structure using its PDB ID using a GET request.
    Usage: ./annotate3d.R <pdb_id>

  • Annotate3d.java: Java program to annotate a local PDB file using a POST request.
    Compilation: javac ./Annotate3d.java
    Usage: java -cp . Annotate3d -f PDB_file [-h host_name (default: http://arn-ibmc.in2p3.fr)] [-p port (default: 80)]

Other Web Services clients:

  • Assemble2 a Java GUI using PyRNA Web Services to construct RNA 3D models,