RSAT REST APIs

RSAT REST API provides language agnostic bindings to RSAT data.

The Regulatory Sequence Analysis Tools are accessible via a REST API for its programmatic access.

Web Services offer a programmatic interface for running the tools on the public servers, querying the server with a program rather than with the Web forms. Using RSAT via Web Services allows to automatize repetitive tasks, interconnect RSAT with other tools exposing REST API (like Ensembl or Remap) and combine multiple tools of RSAT into automated pipelines.

This REST API aims to replace our former SOAP/WSDL programmatic interface.

How to use RSAT REST API web services ?

Entry points

Currently, 49 individual tools are accessible with a REST API.

The entry points are listed below by server:

Testing from the Web browser

We suggest to start with the tool supported-organisms. The entry point enables to directly test each tool :

The curl command will be displayed, along with the result.

Example of client program in Python

#Begin by importing the Requests module
import requests, sys

#State the base URL
server = "http://rsat-tagc.univ-mrs.fr/rest.wsgi"

#The endpoint indicates which RSAT resource you are interested in
ext = "/supported-organisms/" ##Returns the list of organisms supported on the local RSAT or on a remove server (opion -server).

#Write the parameters specifying details of how you want to interact with the resource. For default option write None
data =  {
        "format" : "tab", ##Output format. supported tab, tree, html_tree, newick
        "return" : "ID", ##String. Output fields. Supported ID,name,taxid,source,last_update,nb,seq_format,up_from,up_to,taxonomy,data,genome,genome_assembly,genome_version,download_date,variant_available,variant_source,variant_date,path_to_variant_files
        "taxon" : None, ##String. Selected_taxon. Only returns organisms belonging to a selected taxon.
        "group" : "Fungi", ##String. Selected_group. Only returns organisms belonging to a selected taxonomy group.
        "source" : "NCBI-Refseq", ##String. Selected_source. Only return organisms from a user-selected source(s).
        "depth" : None, ##Integer. Depth for exploring the taxonomic tree.
        "unique_species" : None, ##Boolean. Select at most one organism per species. This option aims at avoiding to be submerged by hundreds of strains sequenced for the same species.
        "unique_genus" : None, ##Boolean. Select at most one organism per genus.
        "source" : None ##String. Return the list of organisms supported on a remote RSAT server, via the Web services interfaces.
    } 
r = requests.get(server+ext, data, headers={ "Content-Type" : "text/plain", "Accept" : "application/json"}) ##Default value : text/plain
#r = requests.post(server+ext, data, headers={ "Content-Type" : "text/plain", "Accept" : "application/json"})
 
if not r.ok:
  r.raise_for_status()
  sys.exit()

 
print(r.text)
# print (repr(r.json))

More example client programs in Python