spacer
spacer

WSDbfetch (REST)

Description

The dbfetch services provide access to entries from various up-to-date biological databases using entry identifiers or accession numbers. There are three main interfaces to dbfetch:

  1. REST: WSDbfetch (REST)

For more information see:

Web service registry entries:

Clients

Sample clients are provided for a number of programming languages. For details of how to use these clients, download the client and run the program without any arguments.

Language Download Requirements
Perl dbfetch_lwp.pl LWP and YAML::Syck
Python dbfetch_urllib2.py urllib2 and xmltramp
Ruby dbfetch_net_http.rb net/http and REXML

Service API

The RESTful form of the WSDbfetch (REST) interface is described here, for the parametrised form, see the Dbfetch URL Syntax guide.

Database Entry

To retrieve an entry in the default database format use a URL of the form:

http://www.ebi.ac.uk/Tools/dbfetch/dbfetch/{db}/{id}

where:

  1. {db} is the database name (e.g. uniprotkb)
  2. {id} is the entry identifier, either an ID (e.g. WAP_RAT) or an accession number (e.g. P01174)

For a list of valid database names see the dbfetch documentation.

For example to fetch WAP_RAT from UniProtKB:

Database Entry with Format

To retrieve an entry in a specified database format use a URL of the form:

http://www.ebi.ac.uk/Tools/dbfetch/dbfetch/{db}/{id}/{format}

where:

  1. {db} is the database name (e.g. uniprotkb)
  2. {id} is the entry identifier either an ID (e.g. WAP_RAT) or an accession number (e.g. P01174)
  3. {format} is the required data format (e.g. uniprotxml)

For a list of valid database and format names see the dbfetch documentation.

For example to fetch WAP_RAT from UniProtKB in UniProtXML format:

Database Entry with Format and Style

To retrieve an entry in a specified database format and result style use a URL of the form:

http://www.ebi.ac.uk/Tools/dbfetch/dbfetch/{db}/{id}/{format}?style={style}

where:

  1. {db} is the database name (e.g. uniprotkb)
  2. {id} is the entry identifier either an ID (e.g. WAP_RAT) or an accession number (e.g. P01174)
  3. {format} is the required data format (e.g. fasta)
  4. {format} is the required result style (e.g. html)

For a list of valid database, data format and result style names see the dbfetch documentation.

For example to fetch WAP_RAT from UniProtKB in fasta sequence format in the HTML style:

Database Information

Details of the databases, formats and styles are available from the service in a range of formats using a URL of the form:

http://www.ebi.ac.uk/Tools/dbfetch/dbfetch/dbfetch.databases?style={style}

The available styles are:

  • html: database information as an XHTML page, as used by the web interface.
  • json: JSON representation for use with JSON based REST clients.
  • xml: XML representation for use with XML based REST clients.
  • yaml: YAML representation for use with YAML based REST clients.

WADL

A WADL document defining the request format:

<?xml version="1.0" encoding="utf-8"?>
<application
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xsi:schemaLocation="http://research.sun.com/wadl/2006/10 wadl.xsd"
  xmlns="http://research.sun.com/wadl/2006/10">
  <resources base="http://www.ebi.ac.uk/">
    <resource path="Tools/dbfetch/dbfetch">
      <!-- Default data format -->
      <resource path="{db}/{id}">
        <param name="db" type="xsd:string" style="template" required="true">
          <doc xml:lang="en" title="db (Sample Value: EMBL)">Database name to get data from</doc>
        </param>
        <param name="id" type="xsd:string" style="template" required="true">
          <doc xml:lang="en"
            title="id (Sample Value: J00231,HSFOS,ROD894,LOP242600)">Comma separated list of identifiers, max. 200.</doc>
        </param>
      </resource>
      <!-- Specified data format -->
      <resource path="{db}/{id}/{format}">
        <param name="db" type="xsd:string" style="template" required="true">
          <doc xml:lang="en" title="db (Sample Value: EMBL)">Database name to get data from</doc>
        </param>
        <param name="id" type="xsd:string" style="template" required="true">
          <doc xml:lang="en"
            title="id (Sample Value: J00231,HSFOS,ROD894,LOP242600)">Comma separated list of identifiers, max. 200.</doc>
        </param>
        <param name="format" type="xsd:string" style="template" required="true">
          <doc xml:lang="en" title="format (Sample Value: fasta)">Database format to get data in</doc>
        </param>
      </resource>
    </resource>
  </resources>
</application>


Note: due to the wide range of possible response formats for a WSDbfetch call (e.g. EMBL flatfile, EMBLXML, INSDXML, GenBank, UniProtKB flatfile, UniProtKB XML, UniRef XML, UniParc XML, fasta format, etc.) the format of the response cannot be easily specified in the WADL description. For details of the entry formats please see the documentation of the database(s) of interest. If you need to parse the results then you may find bioinformatics tool-kits such as:

Useful for handling the common sequence formats (e.g. fasta format, EMBL, UniProt, GenBank, etc.).

Contact

If you have any questions or comments, or you plan to use this service as part of a course or for a high number of submissions, please contact us EBI Support.

 
services/dbfetch_rest.txt · Last modified: 2013/05/23 10:48 by hpm
spacer
spacer