Difference between revisions of "GMOD RPC API"

From GMOD
Jump to: navigation, search
m (Background)
m
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<div class="emphasisbox">
 
{|
 
| [[Image:WorkInProgressTools.gif]]
 
| There will be a one day [[GMOD REST Hackathon]] in San Diego on January 13, the day before the [[January 2010 GMOD Meeting]].  See the [[GMOD REST Hackathon]] page if you are interested in participating.
 
|}
 
</div>
 
 
 
{{TocRight}}
 
{{TocRight}}
  
Line 19: Line 12:
 
* Richard Smith - [http://www.intermine.org InterMine]
 
* Richard Smith - [http://www.intermine.org InterMine]
 
* Giles Velarde - [http://www.genedb.org GeneDB]
 
* Giles Velarde - [http://www.genedb.org GeneDB]
 +
* [[User:Tharris|Todd Harris]] - [http://www.wormbase.org WormBase]
 +
* [[User:JimHu|Jim Hu]] - [http://ecoliwiki.net EcoliWiki]
 +
* [[User:alexkalderimis| Alex Kalderimis]] - [http://www.intermine.org InterMine]
 
* ''Add your name here''
 
* ''Add your name here''
  
Line 29: Line 25:
 
== Related projects ==
 
== Related projects ==
 
* [[Common url]]
 
* [[Common url]]
* [[Bio::GMOD]]
+
* [[:Bio::GMOD]]
 
* [[Bio GMOD GenericGenePage]]
 
* [[Bio GMOD GenericGenePage]]
  
Line 40: Line 36:
 
In order to provide a stable URL API all web calls should be versioned according to what version of the GMOD REST API they are using.  The version number included in the URLs corresponds to the API version and not the data version.  As changes to the API are made the version number will be incremented.  Access to the older API versions should be provided indefinitely.
 
In order to provide a stable URL API all web calls should be versioned according to what version of the GMOD REST API they are using.  The version number included in the URLs corresponds to the API version and not the data version.  As changes to the API are made the version number will be incremented.  Access to the older API versions should be provided indefinitely.
  
'''Current GMOD REST API Version:''' 1
+
'''Current GMOD REST API Version:''' 1.1
  
 
== Data version ==
 
== Data version ==
Line 63: Line 59:
  
 
== Querying or Filtering by Organism ==
 
== Querying or Filtering by Organism ==
Some of the queries that have been defined below allow for querying and/or filtering by organism by using Taxonomy IDs from the NCBI's Taxonomy database (http://www.ncbi.nlm.nih.gov/Taxonomy/). Non-leaf taxons should be supported by the service provider.  For example, if you want to query all species in the Sophophora submitting the taxon ID 32341 should allow you to perform such a query.  In order to implement this service you can either implement your own methods or utilize the NCBI's elink application that is part of their Eutils service (e.g. http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?id=32341&db=taxonomy&dbfrom=taxonomy)
+
Some of the queries that have been defined below allow for querying and/or filtering by organism by using Taxonomy IDs
 +
from the NCBI's Taxonomy database (http://www.ncbi.nlm.nih.gov/Taxonomy/) or the genus and/or species name (e.g. 'Drosophila melanogaster').
 +
Non-leaf taxons should be supported by the service provider.  For example, if you want to query all species in the Sophophora submitting the
 +
taxon ID 32341 should allow you to perform such a query.  In order to implement this service you can either implement your own methods or
 +
utilize the NCBI's elink application that is part of their Eutils service
 +
(e.g. http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?id=32341&db=taxonomy&dbfrom=taxonomy)
 +
 
 +
== Pretty URLs ==
 +
In version 1.1 we have opted for a mixed approach of forming URLs that uses directory path structures to specify some elements and parameters to add additional
 +
filters.
 +
 
 +
== Language Implementation Pages ==
 +
* [[GMOD_RPC_API/PHP]]
 +
 
  
 
== Error handling ==
 
== Error handling ==
=== Error types ===
+
=== HTTP error code 400 ===
 +
An HTTP 400 status code should be returned for the following errors.
 
* not implemented - returned when a particular service is not implemented.
 
* not implemented - returned when a particular service is not implemented.
 +
* invalid term - returned when a particular CV term is not used by the service.
  
=== XML Result ===
 
<xml>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<error>
 
  <type>not implemented</type>
 
  <message>Not implemented, we don't support searches of such and such using such and such.</message>
 
</error>
 
</xml>
 
  
 
== Use Cases ==
 
== Use Cases ==
* [[GMOD REST API Use Cases]]
+
* [[GMOD RPC API Use Cases]]
  
 
== Services ==
 
== Services ==
 
=== Searches ===
 
=== Searches ===
 
==== Organism List ====
 
==== Organism List ====
 +
===== Service Name =====
 +
organisms
 
===== Purpose =====
 
===== Purpose =====
 
Provides a list of organisms that are able to be queried with the service provider.
 
Provides a list of organisms that are able to be queried with the service provider.
  
 
===== URL =====
 
===== URL =====
<nowiki>http://yourmod.org/gmodrest/v<api version>/organisms[.xml | .json]</nowiki>
+
<nowiki>http://yourmod.org/gmodrpc/v<api version>/organisms[.xml | .json]</nowiki>
  
 
===== Return types =====
 
===== Return types =====
Line 97: Line 102:
  
 
===== Example URLs =====
 
===== Example URLs =====
* <nowiki>http://flybase.org/gmodrest/v1/organisms</nowiki>
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/organisms</nowiki>
* <nowiki>http://flybase.org/gmodrest/v1/organisms.xml</nowiki>
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/organisms.xml</nowiki>
* <nowiki>http://flybase.org/gmodrest/v1/organisms.json</nowiki>
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/organisms.json</nowiki>
  
 
===== XML Result =====
 
===== XML Result =====
<xml>
+
<syntaxhighlight lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<resultset>
 
<resultset>
   <api_version>1</api_version>
+
   <api_version>1.1</api_version>
 
   <data_provider>FlyBase</data_provider>
 
   <data_provider>FlyBase</data_provider>
 
   <data_version>FB2008_10</data_version>
 
   <data_version>FB2008_10</data_version>
   <organism>
+
   <result>
      <genus>Drosophila</genus>
+
      <organism>
      <species>melanogaster</species>
+
        <genus>Drosophila</genus>
      <taxonomy_id>7227</taxonomy_id>
+
        <species>melanogaster</species>
  </organism>
+
        <taxonomy_id>7227</taxonomy_id>
   <organism>
+
      </organism>
      <species>Drosophila</species>
+
   </result>
      <genus>simulans</genus>
+
  <result>
      <taxonomy_id>7240</taxonomy_id>
+
      <organism>
  </organism>
+
          <species>Drosophila</species>
 +
          <genus>simulans</genus>
 +
          <taxonomy_id>7240</taxonomy_id>
 +
      </organism>
 +
    </result>
 
</resultset>
 
</resultset>
</xml>
+
</syntaxhighlight>
  
 
===== JSON Result =====
 
===== JSON Result =====
 
  {
 
  {
 
     resultset:{
 
     resultset:{
         api_version:1,
+
         api_version:1.1,
 
         data_provider:'FlyBase',
 
         data_provider:'FlyBase',
 
         data_version:'FB2008_10',
 
         data_version:'FB2008_10',
         organism:[
+
         result:[
 
             {
 
             {
                 genus:'Drosophila',
+
                 organism:{
                species:'melanogaster',
+
                    genus:'Drosophila',
                taxonomy_id:7227
+
                    species:'melanogaster',
 +
                    taxonomy_id:7227
 +
                }
 
             },
 
             },
 
             {
 
             {
                 species:'Drosophila',
+
                 organism:{
                genus:'simulans',
+
                    species:'Drosophila',
                taxonomy_id:7240
+
                    genus:'simulans',
 +
                    taxonomy_id:7240
 +
                }
 
             }
 
             }
 
         ]
 
         ]
Line 143: Line 156:
  
 
==== Gene full text search ====
 
==== Gene full text search ====
 +
===== Service Name =====
 +
fulltext
 +
 
===== Purpose =====
 
===== Purpose =====
Performs a full text search on gene records and returns the IDs for matching records.
+
Performs a full text search on records and returns the IDs for matching records.
  
 
===== Description =====
 
===== Description =====
This service returns genes that contain the search term anywhere in the gene record.  Results
+
This service returns features that contain the search term anywhere in the gene record.  Results
 
can be restricted to a specific organism by supplying the NCBI taxonomy id.
 
can be restricted to a specific organism by supplying the NCBI taxonomy id.
  
 
===== URL=====
 
===== URL=====
<nowiki>http://yourmod.org/gmodrest/v<api version>/fulltext/gene/<search term>[/organism/<taxonomy id>][.xml | .json]</nowiki>
+
<nowiki>http://yourmod.org/gmodrpc/v<api version>/fulltext/<search term>[.xml | .json]?[type=<SO term ID>][taxid=<taxid>][genus=<genus>][species=<species>]</nowiki>
  
 
===== Return types =====
 
===== Return types =====
Line 160: Line 176:
  
 
===== Example URLs =====
 
===== Example URLs =====
* <nowiki>http://flybase.org/gmodrest/v1/fulltext/gene/cotransfection</nowiki> - Find genes that contain the term cotransfection.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/fulltext/cotransfection?type=SO:0000704</nowiki> - Find genes that contain the term cotransfection.
* <nowiki>http://flybase.org/gmodrest/v1/fulltext/gene/cotransfection/organism/7227</nowiki> - Find Drosophila melanogaster genes that contain the term cotransfection.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/fulltext/cotransfection?type=SO:0000704&taxid=7227</nowiki> - Find Drosophila melanogaster genes that contain the term cotransfection.
* <nowiki>http://flybase.org/gmodrest/v1/fulltext/gene/AE003845.json</nowiki> - Find genes that contain the term AE003845 and return a JSON result.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/fulltext/AE003845.json?type=SO:0000704</nowiki> - Find genes that contain the term AE003845 and return a JSON result.
* <nowiki>http://flybase.org/gmodrest/v1/fulltext/gene/IPR000483/organism/7240.json</nowiki> - Find Drosophila simulans genes that are labeled with InterPro ID IPR000483.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/fulltext/IPR000483.json?taxid=7240&type=SO:0000704</nowiki> - Find Drosophila simulans genes that are labeled with InterPro ID IPR000483.
  
 
===== XML Result =====
 
===== XML Result =====
<xml>
+
<syntaxhighlight lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<resultset>
 
<resultset>
   <api_version>1</api_version>
+
   <api_version>1.1</api_version>
 
   <data_provider>FlyBase</data_provider>
 
   <data_provider>FlyBase</data_provider>
 
   <data_version>FB2008_10</data_version>
 
   <data_version>FB2008_10</data_version>
 
   <query_time>2009-01-15 09:03:00</query_time>
 
   <query_time>2009-01-15 09:03:00</query_time>
   <query_url>http://flybase.org/gmodrest/v1/fulltext/gene/cotransfection</query_url>
+
   <query_url>http://flybase.org/gmodrpc/v1.1/fulltext/cotransfection?type=SO:0000704</query_url>
 
   <result>
 
   <result>
 
       <dbxref>
 
       <dbxref>
 
         <db>FlyBase</db>
 
         <db>FlyBase</db>
 
         <accession>FBgn0085432</accession>
 
         <accession>FBgn0085432</accession>
         <url>http://flybase.org/gmodrest/v1/fetch/FBgn0085432</url>
+
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0085432</url>
 
       </dbxref>
 
       </dbxref>
 
       <date_created>2003-03-08 00:00:00</date_created>
 
       <date_created>2003-03-08 00:00:00</date_created>
Line 187: Line 203:
 
         <db>FlyBase</db>
 
         <db>FlyBase</db>
 
         <accession>FBgn0004364</accession>
 
         <accession>FBgn0004364</accession>
         <url>http://flybase.org/gmodrest/v1/fetch/FBgn0004364</url>
+
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0004364</url>
 
       </dbxref>
 
       </dbxref>
 
       <date_created>2005-01-08 00:00:00</date_created>
 
       <date_created>2005-01-08 00:00:00</date_created>
Line 193: Line 209:
 
   </result>
 
   </result>
 
</resultset>
 
</resultset>
</xml>
+
</syntaxhighlight>
  
 
===== JSON Result =====
 
===== JSON Result =====
 
  {
 
  {
 
     resultset:{
 
     resultset:{
         api_version:1,
+
         api_version:1.1,
 
         data_provider:'FlyBase',
 
         data_provider:'FlyBase',
 
         data_version:'FB2008_10',
 
         data_version:'FB2008_10',
 
         query_time:'2009-01-15 09:03:00',
 
         query_time:'2009-01-15 09:03:00',
         query_url:'<nowiki>http://flybase.org/gmodrest/v1/fulltext/gene/cotransfection</nowiki>',
+
         query_url:'<nowiki>http://flybase.org/gmodrpc/v1.1/fulltext/cotransfection?type=SO:0000704</nowiki>',
 
         result:[
 
         result:[
 
             {
 
             {
Line 208: Line 224:
 
                     db:'FlyBase',
 
                     db:'FlyBase',
 
                     accession:'FBgn0085432',
 
                     accession:'FBgn0085432',
                     url:'<nowiki>http://flybase.org/gmodrest/v1/fetch/FBgn0085432</nowiki>'
+
                     url:'<nowiki>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0085432</nowiki>'
 
                 },
 
                 },
 
                 date_created:'2003-03-08 00:00:00',
 
                 date_created:'2003-03-08 00:00:00',
Line 217: Line 233:
 
                     db:'FlyBase',
 
                     db:'FlyBase',
 
                     accession:'FBgn0004364',
 
                     accession:'FBgn0004364',
                     url:'<nowiki>http://flybase.org/gmodrest/v1/fetch/FBgn0004364</nowiki>'
+
                     url:'<nowiki>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0004364</nowiki>'
 
                 },
 
                 },
 
                 date_created:'2005-01-08 00:00:00',
 
                 date_created:'2005-01-08 00:00:00',
Line 227: Line 243:
  
 
==== Gene location ====
 
==== Gene location ====
 +
 +
===== Service Name =====
 +
location
 +
 
===== Purpose =====
 
===== Purpose =====
Retrieves a list of genes that lie within a specific sequence range.
+
Retrieves a list of features that lie within a specific sequence range.
  
 
===== Description =====
 
===== Description =====
This service returns genes that lie within a specific sequence range.  Arguments include the name of the largest assembled unit (i.e. chromosome, scaffold, etc...), location start (fmin), location stop (fmax), and strand.  Results can be restricted to a specific organism by supplying the NCBI taxonomy id.
+
This service returns features that lie within a specific sequence range.  Arguments include the name of
 +
the largest assembled unit (i.e. chromosome, scaffold, etc...), location start (fmin), location stop
 +
(fmax), and strand.  Results can be restricted to a specific organism by supplying the NCBI taxonomy id.
  
 
===== URL=====
 
===== URL=====
<nowiki>http://yourmod.org/gmodrest/v<api version>/location/chromosome/<name>[fmin/<int>][fmax/<int>][strand/(1 | -1)][/gene][/organism/<taxonomy id>][.xml | .json]</nowiki>
+
<nowiki>http://yourmod.org/gmodrpc/v<api version>/location/chromosome/<name>[.xml | .json]?[type=<SO term ID>][fmin=<int>][fmax=<int>][strand=(1 | -1)][taxid=<taxid>][genus=<genus>][species=<species>]</nowiki>
  
 
===== Return types =====
 
===== Return types =====
Line 243: Line 265:
  
 
===== Example URLs =====
 
===== Example URLs =====
* <nowiki>http://flybase.org/gmodrest/v1/location/chromosome/X/gene</nowiki> - Find all genes that are localized to the X chromosome of any Drosophila species.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/location/chromosome/X?type=SO:0000704</nowiki> - Find all genes that are localized on the X chromosome of any Drosophila species.
* <nowiki>http://flybase.org/gmodrest/v1/location/chromosome/X/gene/organism/7227</nowiki> - Find all genes that are localized to the X chromosome of melanogaster.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/location/chromosome/X?type=SO:0000704&taxid=7227</nowiki> - Find all genes that are localized to the X chromosome of melanogaster.
* <nowiki>http://flybase.org/gmodrest/v1/location/chromosome/X/fmin/40000/gene/organism/7227</nowiki> - Find all genes that are localized on the X chromosome in the range of 40,000 bp to the end of X on any strand.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/location/chromosome/X.json?type=SO:0000704&fmin=40000&taxid=7227</nowiki> - Find all genes that are localized on the X chromosome in the range of 40,000 bp to the end of X on any strand.
* <nowiki>http://flybase.org/gmodrest/v1/location/chromosome/X/fmax/40000/gene/organism/7227</nowiki> - Find all genes that are localized on the X chromosome in the range of the start of the X up to and including 40,000 bp on any strand.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/location/chromosome/X.xml?type=SO:0000704&genus=Drosophila&species=melanogaster&fmax=40000</nowiki> - Find all genes that are localized on the X chromosome in the range of the start of the X up to and including 40,000 bp on any strand.
* <nowiki>http://flybase.org/gmodrest/v1/location/chromosome/X/fmin/50000/fmax/140000/strand/1/gene/organism/7227</nowiki> - Find all genes that are localized on the plus strand of the X chromosome between and including 50,000 bp and 140,000 bp.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/location/chromosome/X.xml?type=SO:0000704&fmin=50000&fmax=140000&strand=1&taxid=7227</nowiki> - Find all genes that are localized on the plus strand of the X chromosome between and including 50,000 bp and 140,000 bp.
  
 
===== XML Result =====
 
===== XML Result =====
<xml>
+
<syntaxhighlight lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<resultset>
 
<resultset>
   <api_version>1</api_version>
+
   <api_version>1.1</api_version>
 
   <data_provider>FlyBase</data_provider>
 
   <data_provider>FlyBase</data_provider>
 
   <data_version>FB2008_10</data_version>
 
   <data_version>FB2008_10</data_version>
 
   <query_time>2009-01-15 09:03:00</query_time>
 
   <query_time>2009-01-15 09:03:00</query_time>
   <query_url>http://flybase.org/gmodrest/v1/location/chromosome/2L/fmin/12587000/fmax/12629000/gene/organism/7227</query_url>
+
   <query_url>http://flybase.org/gmodrpc/v1.1/location/chromosome/2L?type=SO:0000704&amp;fmin=12587000&amp;fmax=12629000&amp;taxid=7227</query_url>
 
   <result>
 
   <result>
 
       <dbxref>
 
       <dbxref>
 
         <db>FlyBase</db>
 
         <db>FlyBase</db>
 
         <accession>FBgn0085424</accession>
 
         <accession>FBgn0085424</accession>
         <url>http://flybase.org/gmodrest/v1/fetch/FBgn0085424</url>
+
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0085424</url>
 
       </dbxref>
 
       </dbxref>
 
       <date_created>2003-03-08 00:00:00</date_created>
 
       <date_created>2003-03-08 00:00:00</date_created>
Line 268: Line 290:
 
   </result>
 
   </result>
 
</resultset>
 
</resultset>
</xml>
+
</syntaxhighlight>
  
 
===== JSON Result =====
 
===== JSON Result =====
 
  {
 
  {
 
     resultset:{
 
     resultset:{
         api_version:1,
+
         api_version:1.1,
 
         data_provider:'FlyBase',
 
         data_provider:'FlyBase',
 
         data_version:'FB2008_10',
 
         data_version:'FB2008_10',
 
         query_time:'2009-01-15 09:03:00',
 
         query_time:'2009-01-15 09:03:00',
         query_url:'<nowiki>http://flybase.org/gmodrest/v1/location/chromosome/2L/fmin/12587000/fmax/12629000/gene/organism/7227</nowiki>',
+
         query_url:'<nowiki>http://flybase.org/gmodrpc/v1.1/location/chromosome/2L?type=SO:0000704&fmin=12587000&fmax=12629000&taxid=7227</nowiki>',
 
         result:[
 
         result:[
 
             {
 
             {
Line 283: Line 305:
 
                     db:'FlyBase',
 
                     db:'FlyBase',
 
                     accession:'FBgn0085424',
 
                     accession:'FBgn0085424',
                     url:'<nowiki>http://flybase.org/gmodrest/v1/fetch/FBgn0085424</nowiki>'
+
                     url:'<nowiki>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0085424</nowiki>'
 
                 },
 
                 },
 
                 date_created:'2003-03-08 00:00:00',
 
                 date_created:'2003-03-08 00:00:00',
Line 292: Line 314:
 
  }
 
  }
  
==== Gene ontology search ====
+
==== Gene Ontology search ====
 +
===== Service Name =====
 +
ontology
 +
 
 
===== Purpose =====
 
===== Purpose =====
Searches for genes that have a particular ontology ID.
+
Search for genes that have been annotated with a particular gene ontology ID.
  
 
===== Description =====
 
===== Description =====
Line 301: Line 326:
  
 
===== URL =====
 
===== URL =====
<nowiki>http://yourmod.org/gmodrest/v<api version>/ontology/gene/<ontology ID>[/organism/<taxonomy id>][.xml | .json]</nowiki>
+
<nowiki>http://yourmod.org/gmodrpc/v<api version>/ontology/gene/<ontology ID>[.xml | .json]?[taxid=<taxid>][genus=<genus>][species=<species>]</nowiki>
  
 
===== Return types =====
 
===== Return types =====
Line 310: Line 335:
  
 
===== Example URLs =====
 
===== Example URLs =====
* <nowiki>http://flybase.org/gmodrest/v1/ontology/gene/GO:00012345</nowiki> - Find all genes annotated with GO:00012345.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/ontology/gene/GO:0005515</nowiki> - Find all genes annotated with GO:0005515.
* <nowiki>http://flybase.org/gmodrest/v1/ontology/gene/!GO:00012345</nowiki> - Find all genes annotated with GO:00012345 and the GO NOT operator.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/ontology/gene/!GO:0005515</nowiki> - Find all genes annotated with GO:0005515 and the GO NOT operator.
* <nowiki>http://flybase.org/gmodrest/v1/ontology/gene/GO:00012345/organism/7227</nowiki> - Find all Drosophila melanogaster genes annotated with GO:00012345.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/ontology/gene/GO:0005515?taxid=7227</nowiki> - Find all Drosophila melanogaster genes annotated with GO:0005515.
* <nowiki>http://flybase.org/gmodrest/v1/ontology/gene/GO:00012345.json</nowiki> - Find all genes annotated with GO:00012345 and return a JSON result.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/ontology/gene/GO:0005515.json</nowiki> - Find all genes annotated with GO:0005515 and return a JSON result.
  
 
===== XML Result =====
 
===== XML Result =====
<xml>
+
<syntaxhighlight lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<resultset>
 
<resultset>
   <api_version>1</api_version>
+
   <api_version>1.1</api_version>
 
   <data_provider>FlyBase</data_provider>
 
   <data_provider>FlyBase</data_provider>
 
   <data_version>FB2008_10</data_version>
 
   <data_version>FB2008_10</data_version>
 
   <query_time>2009-01-15 09:03:00</query_time>
 
   <query_time>2009-01-15 09:03:00</query_time>
   <query_url>http://flybase.org/gmodrest/v1/ontology/gene/GO:00012345</query_url>
+
   <query_url>http://flybase.org/gmodrpc/v1.1/ontology/gene/GO:0005515</query_url>
 
   <result>
 
   <result>
 
       <dbxref>
 
       <dbxref>
 
         <db>FlyBase</db>
 
         <db>FlyBase</db>
 
         <accession>FBgn0085432</accession>
 
         <accession>FBgn0085432</accession>
         <url>http://flybase.org/gmodrest/v1/fetch/FBgn0085432</url>
+
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0085432</url>
 
       </dbxref>
 
       </dbxref>
 
       <date_created>2003-03-08 00:00:00</date_created>
 
       <date_created>2003-03-08 00:00:00</date_created>
Line 337: Line 362:
 
         <db>FlyBase</db>
 
         <db>FlyBase</db>
 
         <accession>FBgn0004364</accession>
 
         <accession>FBgn0004364</accession>
         <url>http://flybase.org/gmodrest/v1/fetch/FBgn0004364</url>
+
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0004364</url>
 
       </dbxref>
 
       </dbxref>
 
       <date_created>2005-01-08 00:00:00</date_created>
 
       <date_created>2005-01-08 00:00:00</date_created>
Line 343: Line 368:
 
   </result>
 
   </result>
 
</resultset>
 
</resultset>
</xml>
+
</syntaxhighlight>
  
 
===== JSON Result =====
 
===== JSON Result =====
 
  {
 
  {
 
     resultset:{
 
     resultset:{
         api_version:1,
+
         api_version:1.1,
 
         data_provider:'FlyBase',
 
         data_provider:'FlyBase',
 
         data_version:'FB2008_10',
 
         data_version:'FB2008_10',
 
         query_time:'2009-01-15 09:03:00',
 
         query_time:'2009-01-15 09:03:00',
         query_url:'<nowiki>http://flybase.org/gmodrest/v1/ontology/gene/GO:12345</nowiki>',
+
         query_url:'<nowiki>http://flybase.org/gmodrpc/v1.1/ontology/gene/GO:0005515</nowiki>',
 
         result:[
 
         result:[
 
             {
 
             {
Line 358: Line 383:
 
                     db:'FlyBase',
 
                     db:'FlyBase',
 
                     accession:'FBgn0085432',
 
                     accession:'FBgn0085432',
                     url:'<nowiki>http://flybase.org/gmodrest/v1/fetch/FBgn0085432</nowiki>'
+
                     url:'<nowiki>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0085432</nowiki>'
 
                 },
 
                 },
 
                 date_created:'2003-03-08 00:00:00',
 
                 date_created:'2003-03-08 00:00:00',
Line 367: Line 392:
 
                     db:'FlyBase',
 
                     db:'FlyBase',
 
                     accession:'FBgn0004364',
 
                     accession:'FBgn0004364',
                     url:'<nowiki>http://flybase.org/gmodrest/v1/fetch/FBgn0004364</nowiki>'
+
                     url:'<nowiki>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0004364</nowiki>'
 
                 },
 
                 },
 
                 date_created:'2005-01-08 00:00:00',
 
                 date_created:'2005-01-08 00:00:00',
Line 377: Line 402:
  
 
==== Gene ortholog search ====
 
==== Gene ortholog search ====
 +
===== Service name =====
 +
orthologs/gene
 +
 
===== Purpose =====
 
===== Purpose =====
 
Search for orthologs of the supplied gene ID.
 
Search for orthologs of the supplied gene ID.
Line 395: Line 423:
  
 
===== URL =====
 
===== URL =====
<nowiki>http://yourmod.org/gmodrest/v<api version>/orthologs/gene/<gene ID>[/organism/<taxonomy ID>][.xml | .json]</nowiki>
+
<nowiki>http://yourmod.org/gmodrpc/v<api version>/orthologs/gene/<gene ID>[.xml | .json]?[taxid=<taxid>][genus=<genus>][species=<species>]</nowiki>
  
 
===== Return types =====
 
===== Return types =====
Line 404: Line 432:
  
 
===== Example URLs =====
 
===== Example URLs =====
* <nowiki>http://flybase.org/gmodrest/v1/orthologs/gene/FBgn0004364</nowiki> - Find all FlyBase and non FlyBase genes that are orthologous to FBgn0004364.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/orthologs/gene/FBgn0004364</nowiki> - Find all FlyBase and non FlyBase genes that are orthologous to FBgn0004364.
* <nowiki>http://flybase.org/gmodrest/v1/orthologs/gene/FBgn0004364/organism/7240</nowiki> - Find out if FBgn0004364 has an ortholog in Drosophila simulans.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/orthologs/gene/FBgn0004364?taxid=7240</nowiki> - Find out if FBgn0004364 has an ortholog in Drosophila simulans.
* <nowiki>http://flybase.org/gmodrest/v1/orthologs/gene/WBGene12345.json</nowiki> - Find all FlyBase genes that are orthologous to WBGene12345 and return a JSON result.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/orthologs/gene/WBGene12345.json</nowiki> - Find all FlyBase genes that are orthologous to WBGene12345 and return a JSON result.
  
 
===== XML Result: =====
 
===== XML Result: =====
<xml>
+
<syntaxhighlight lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<resultset>
 
<resultset>
   <api_version>1</api_version>
+
   <api_version>1.1</api_version>
 
   <data_provider>FlyBase</data_provider>
 
   <data_provider>FlyBase</data_provider>
 
   <data_version>FB2008_10</data_version>
 
   <data_version>FB2008_10</data_version>
 
   <query_time>2009-01-15 09:03:00</query_time>
 
   <query_time>2009-01-15 09:03:00</query_time>
   <query_url>http://flybase.org/gmodrest/v1/orthologs/gene/FBgn0000490</query_url>
+
   <query_url>http://flybase.org/gmodrpc/v1.1/orthologs/gene/FBgn0000490</query_url>
 
   <result>
 
   <result>
 
       <dbxref>
 
       <dbxref>
Line 422: Line 450:
 
         <accession>FBgn0097591</accession>
 
         <accession>FBgn0097591</accession>
 
         <data_provider>FlyBase</data_provider>
 
         <data_provider>FlyBase</data_provider>
         <url>http://flybase.org/gmodrest/v1/fetch/FBgn0097591</url>
+
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0097591</url>
 
       </dbxref>
 
       </dbxref>
 
   </result>
 
   </result>
Line 433: Line 461:
 
   </result>
 
   </result>
 
</resultset>
 
</resultset>
</xml>
+
</syntaxhighlight>
  
 
===== JSON Result =====
 
===== JSON Result =====
 
  {
 
  {
 
     resultset:{
 
     resultset:{
         api_version:1,
+
         api_version:1.1,
 
         data_provider:'FlyBase',
 
         data_provider:'FlyBase',
 
         data_version:'FB2008_10',
 
         data_version:'FB2008_10',
 
         query_time:'2009-01-15 09:03:00',
 
         query_time:'2009-01-15 09:03:00',
         query_url:'<nowiki>http://flybase.org/gmodrest/v1/orthologs/gene/FBgn0000490</nowiki>',
+
         query_url:'<nowiki>http://flybase.org/gmodrpc/v1.1/orthologs/gene/FBgn0000490</nowiki>',
 
         result:[
 
         result:[
 
             {
 
             {
Line 449: Line 477:
 
                     accession:'FBgn0097591',
 
                     accession:'FBgn0097591',
 
                     data_provider:'FlyBase'
 
                     data_provider:'FlyBase'
                     url:'<nowiki>http://flybase.org/gmodrest/v1/fetch/FBgn0097591</nowiki>'
+
                     url:'<nowiki>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0097591</nowiki>'
 
                 }
 
                 }
 
             },
 
             },
Line 464: Line 492:
  
 
==== Organism ortholog search ====
 
==== Organism ortholog search ====
 +
 +
===== Service name =====
 +
orthologs/organism
 +
 
===== Purpose =====
 
===== Purpose =====
 
Returns a list of orthologs between an organism and one or more other organisms.
 
Returns a list of orthologs between an organism and one or more other organisms.
Line 472: Line 504:
  
 
===== URL =====
 
===== URL =====
<nowiki>http://yourmod.org/gmodrest/v<api version>/orthologs/organism/<taxonomy ID>/to/<taxonomy ID>[,<taxonomy ID>][.xml | .json]</nowiki>
+
<nowiki>http://yourmod.org/gmodrpc/v<api version>/orthologs/organism[/<taxid>][/genus/<genus>/species/<species>][.xml | .json]?[to_taxid=<taxid>][to_genus=<genus>&to_species=<species>]</nowiki>
  
 
===== Return types =====
 
===== Return types =====
Line 481: Line 513:
  
 
===== Example URLs =====
 
===== Example URLs =====
* <nowiki>http://flybase.org/gmodrest/v1/orthologs/organism/7227/to/7240</nowiki> - Find all orthologs between Dmel and Dsim.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/orthologs/organism/genus/Drosophila/species/melanogaster</nowiki> - Find all orthologs between Dmel and any other species.
* <nowiki>http://flybase.org/gmodrest/v1/orthologs/organism/7227/to/7240,7222</nowiki> - Find all orthologs between Dmel/Dsim and Dmel/Dgri.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/orthologs/organism/7227.xml?to_taxid=7240</nowiki> - Find all orthologs between Dmel and Dsim.
* <nowiki>http://flybase.org/gmodrest/v1/orthologs/organism/7227/to/7240,7222.json</nowiki> - Same as above except returned in JSON format.
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/orthologs/organism/7227.json?to_taxid=7240</nowiki> - Same as above except returned in JSON format.
  
 
===== XML Result: =====
 
===== XML Result: =====
<xml>
+
<syntaxhighlight lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<resultset>
 
<resultset>
   <api_version>1</api_version>
+
   <api_version>1.1</api_version>
 
   <data_provider>FlyBase</data_provider>
 
   <data_provider>FlyBase</data_provider>
 
   <data_version>FB2008_10</data_version>
 
   <data_version>FB2008_10</data_version>
 
   <query_time>2009-01-15 09:03:00</query_time>
 
   <query_time>2009-01-15 09:03:00</query_time>
   <query_url>http://flybase.org/gmodrest/v1/orthologs/organism/7227/to/7240,6239</query_url>
+
   <query_url>http://flybase.org/gmodrpc/v1.1/orthologs/organism/genus/Drosophila/species/melanogaster</query_url>
 
   <result>
 
   <result>
 
       <dbxref>
 
       <dbxref>
Line 500: Line 532:
 
         <taxonomy_id>7227</taxonomy_id>
 
         <taxonomy_id>7227</taxonomy_id>
 
         <data_provider>FlyBase</data_provider>
 
         <data_provider>FlyBase</data_provider>
         <url>http://flybase.org/gmodrest/v1/fetch/FBgn0000490</url>
+
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0000490</url>
 
       </dbxref>
 
       </dbxref>
 
       <dbxref>
 
       <dbxref>
Line 507: Line 539:
 
         <taxonomy_id>7240</taxonomy_id>
 
         <taxonomy_id>7240</taxonomy_id>
 
         <data_provider>FlyBase</data_provider>
 
         <data_provider>FlyBase</data_provider>
         <url>http://flybase.org/gmodrest/v1/fetch/FBgn0015673</url>
+
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0015673</url>
 
       </dbxref>
 
       </dbxref>
 
       <dbxref>
 
       <dbxref>
Line 514: Line 546:
 
         <taxonomy_id>6239</taxonomy_id>
 
         <taxonomy_id>6239</taxonomy_id>
 
         <data_provider>InParanoid</data_provider>
 
         <data_provider>InParanoid</data_provider>
         <url>http://wormbase.org/gmodrest/v1/fetch/WBGene00006570</url>
+
         <url>http://wormbase.org/gmodrpc/v1.1/fetch/WBGene00006570</url>
 
       </dbxref>
 
       </dbxref>
 
   </result>
 
   </result>
 
...
 
...
 
</resultset>
 
</resultset>
</xml>
+
</syntaxhighlight>
  
 
===== JSON Result =====
 
===== JSON Result =====
 
  {
 
  {
 
     resultset:{
 
     resultset:{
         api_version:1,
+
         api_version:1.1,
 
         data_provider:'FlyBase',
 
         data_provider:'FlyBase',
 
         data_version:'FB2008_10',
 
         data_version:'FB2008_10',
 
         query_time:'2009-01-15 09:03:00',
 
         query_time:'2009-01-15 09:03:00',
         query_url:'<nowiki>http://flybase.org/gmodrest/v1/orthologs/organism/7227/to/7240,6239</nowiki>',
+
         query_url:'<nowiki>http://flybase.org/gmodrpc/v1.1/orthologs/organism/genus/Drosophila/species/melanogaster</nowiki>',
 
         result:[
 
         result:[
 
           {
 
           {
Line 537: Line 569:
 
                     taxonomy_id:7227,
 
                     taxonomy_id:7227,
 
                     data_provider:'FlyBase',
 
                     data_provider:'FlyBase',
                     url:'<nowiki>http://flybase.org/gmodrest/v1/fetch/FBgn0000490</nowiki>'
+
                     url:'<nowiki>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0000490</nowiki>'
 
                 },
 
                 },
 
                 {
 
                 {
Line 544: Line 576:
 
                     taxonomy_id:7240,
 
                     taxonomy_id:7240,
 
                     data_provider:'FlyBase',
 
                     data_provider:'FlyBase',
                     url:'<nowiki>http://flybase.org/gmodrest/v1/fetch/FBgn0015673</nowiki>'
+
                     url:'<nowiki>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0015673</nowiki>'
 
                 },
 
                 },
 
                 {
 
                 {
Line 551: Line 583:
 
                     taxonomy_id:6239,
 
                     taxonomy_id:6239,
 
                     data_provider:'InParanoid',
 
                     data_provider:'InParanoid',
                     url:'<nowiki>http://wormbase.org/gmodrest/v1/fetch/WBGene00006570</nowiki>'
+
                     url:'<nowiki>http://wormbase.org/gmodrpc/v1.1/fetch/WBGene00006570</nowiki>'
 
                 }
 
                 }
 
             ]
 
             ]
Line 561: Line 593:
 
=== Fetching ===
 
=== Fetching ===
 
==== Gene records ====
 
==== Gene records ====
 +
===== Service name =====
 +
fetch/gene
 +
 
===== Purpose =====
 
===== Purpose =====
 
To fetch gene records in the Generic gene page XML format as implemented by [[Bio GMOD GenericGenePage]].
 
To fetch gene records in the Generic gene page XML format as implemented by [[Bio GMOD GenericGenePage]].
Line 567: Line 602:
  
 
===== URL =====
 
===== URL =====
<nowiki>http://yourmod.org/gmodrest/v<api version>/fetch/<gene ID></nowiki>
+
<nowiki>http://yourmod.org/gmodrpc/v<api version>/fetch/gene/<gene ID></nowiki>
  
 
===== Return types =====
 
===== Return types =====
Line 576: Line 611:
  
 
===== Example URLs =====
 
===== Example URLs =====
* <nowiki>http://flybase.org/gmodrest/v1/fetch/FBgn0097591</nowiki>
+
* <nowiki>http://flybase.org/gmodrpc/v1.1/fetch/gene/FBgn0097591</nowiki>
  
 
===== XML Result =====
 
===== XML Result =====
  
 
See [[Bio GMOD GenericGenePage]] for example XML.
 
See [[Bio GMOD GenericGenePage]] for example XML.
 +
 +
==== Sequence ====
 +
 +
===== Service name =====
 +
fetch/seq
 +
 +
===== Purpose =====
 +
Returns FASTA sequence for the specified query.
 +
 +
===== Description =====
 +
 +
 +
===== URL =====
 +
<nowiki>http://yourmod.org/gmodrpc/v<api version>/fetch/seq/<ID>[/<SO term ID of subtype>]</nowiki>
 +
 +
===== Return types =====
 +
FASTA
 +
 +
===== Example URLs =====
 +
* <nowiki>http://flybase.org/gmodrpc/v1.1/fetch/seq/FBgn0097591.fasta</nowiki> - Fetch the FASTA sequence of FBgn0097591
 +
* <nowiki>http://flybase.org/gmodrpc/v1.1/fetch/seq/FBgn0097591/SO:0000204.fasta</nowiki> - Download all 5' UTRs of the gene FBgn0097591
 +
* <nowiki>http://flybase.org/gmodrpc/v1.1/fetch/seq/FBgn0097591/SO:0000316.fasta</nowiki> - Download all CDS features of the gene FBgn0097591
 +
* <nowiki>http://flybase.org/gmodrpc/v1.1/fetch/seq/FBgn0097591/SO:0000316.fasta</nowiki> - Download all CDS features of the gene FBgn0097591
 +
 +
 +
 +
===== FASTA Result: =====
 +
  
  
 
== TODO ==
 
== TODO ==
 +
* WADLs for all services?
  
 
[[Category:REST]]
 
[[Category:REST]]
[[Category: Web services]]
+
[[Category:Web services]]
 +
[[Category:RPC]]

Latest revision as of 23:02, 15 August 2013

Contents

Document Status

In progress.

Background

This effort was started after Josh Goodman's talk at the January 2009 GMOD Meeting meeting titled "MOD Web API (A RESTful interface for MODs)". The main idea is to increase interoperability among the various model organism databases by creating an easy to use high level RESTful API. The queries iterated below are currently in the proposal stage and have no been implemented at any MOD.

Members

Goals

  • Data model agnostic
  • Programming language agnostic
  • Easy to use
  • Versioned URLs for API stability over time

Related projects

Data classes

At present, this API only covers querying and retrieving information for the gene data class.

API Version

In order to provide a stable URL API all web calls should be versioned according to what version of the GMOD REST API they are using. The version number included in the URLs corresponds to the API version and not the data version. As changes to the API are made the version number will be incremented. Access to the older API versions should be provided indefinitely.

Current GMOD REST API Version: 1.1

Data version

The search results must contain an XML tag called data_version that contains the database release number. If the database does not use release numbers then the date for when the entire data class was updated should be used. If that is not available or if individual records within a data class are updated and released asynchronously then a timestamp derived from the time of query execution should be used.

For example, FlyBase releases its data on a roughly monthly basis and tags all data contained in that release with a release number (e.g. FB2008_10). If a release number was not used then a date stamp for when the entire genes data class was updated should be used. If this is not available or if individual genes are updated in a piecemeal fashion then a timestamp based on the query execution time should be used.

Result dates

The individual search results must provide a creation and last modified timestamp via the date_created and last_modified XML tags respectively. If this information is not available then the current timestamp at query execution should be used.

Return types

Each service may define its own return types. The client may request a specific return type by appending the appropriate file extension to the URL. If no file extension is appended then the default return type for that service is used.

Compression

Sending of compressed XML and JSON results should follow the same rules used for HTTP communication. If a client wishes to receive compressed output it should indicate this by setting the Accept-Encoding HTTP request header. When a service provider receives a request it should check for the Accept-Encoding request header and compress the output if it supports the requested compression algorithm. If the service provider does compress the content it should then set the Content-Encoding HTTP response header to indicate the compression algorithm used.

Supported HTTP methods

Currently this API only describes read only services that use the GET HTTP method. There are no plans to provide create, update or delete operations at this time.

Querying or Filtering by Organism

Some of the queries that have been defined below allow for querying and/or filtering by organism by using Taxonomy IDs from the NCBI's Taxonomy database (http://www.ncbi.nlm.nih.gov/Taxonomy/) or the genus and/or species name (e.g. 'Drosophila melanogaster'). Non-leaf taxons should be supported by the service provider. For example, if you want to query all species in the Sophophora submitting the taxon ID 32341 should allow you to perform such a query. In order to implement this service you can either implement your own methods or utilize the NCBI's elink application that is part of their Eutils service (e.g. http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?id=32341&db=taxonomy&dbfrom=taxonomy)

Pretty URLs

In version 1.1 we have opted for a mixed approach of forming URLs that uses directory path structures to specify some elements and parameters to add additional filters.

Language Implementation Pages


Error handling

HTTP error code 400

An HTTP 400 status code should be returned for the following errors.

  • not implemented - returned when a particular service is not implemented.
  • invalid term - returned when a particular CV term is not used by the service.


Use Cases

Services

Searches

Organism List

Service Name

organisms

Purpose

Provides a list of organisms that are able to be queried with the service provider.

URL

http://yourmod.org/gmodrpc/v<api version>/organisms[.xml | .json]

Return types

XML or JSON

Default return type

XML

Example URLs
  • http://flybase.org/gmodrpc/v1.1/organisms
  • http://flybase.org/gmodrpc/v1.1/organisms.xml
  • http://flybase.org/gmodrpc/v1.1/organisms.json
XML Result
<?xml version="1.0" encoding="UTF-8"?>
<resultset>
   <api_version>1.1</api_version>
   <data_provider>FlyBase</data_provider>
   <data_version>FB2008_10</data_version>
   <result>
      <organism>
         <genus>Drosophila</genus>
         <species>melanogaster</species>
         <taxonomy_id>7227</taxonomy_id>
      </organism>
   </result>
   <result>
      <organism>
          <species>Drosophila</species>
          <genus>simulans</genus>
          <taxonomy_id>7240</taxonomy_id>
      </organism>
    </result>
</resultset>
JSON Result
{
   resultset:{
       api_version:1.1,
       data_provider:'FlyBase',
       data_version:'FB2008_10',
       result:[
           {
               organism:{
                   genus:'Drosophila',
                   species:'melanogaster',
                   taxonomy_id:7227
               }
           },
           {
               organism:{
                   species:'Drosophila',
                   genus:'simulans',
                   taxonomy_id:7240
               }
           }
       ]
   }
}

Gene full text search

Service Name

fulltext

Purpose

Performs a full text search on records and returns the IDs for matching records.

Description

This service returns features that contain the search term anywhere in the gene record. Results can be restricted to a specific organism by supplying the NCBI taxonomy id.

URL

http://yourmod.org/gmodrpc/v<api version>/fulltext/<search term>[.xml | .json]?[type=<SO term ID>][taxid=<taxid>][genus=<genus>][species=<species>]

Return types

XML or JSON

Default return type

XML

Example URLs
  • http://flybase.org/gmodrpc/v1.1/fulltext/cotransfection?type=SO:0000704 - Find genes that contain the term cotransfection.
  • http://flybase.org/gmodrpc/v1.1/fulltext/cotransfection?type=SO:0000704&taxid=7227 - Find Drosophila melanogaster genes that contain the term cotransfection.
  • http://flybase.org/gmodrpc/v1.1/fulltext/AE003845.json?type=SO:0000704 - Find genes that contain the term AE003845 and return a JSON result.
  • http://flybase.org/gmodrpc/v1.1/fulltext/IPR000483.json?taxid=7240&type=SO:0000704 - Find Drosophila simulans genes that are labeled with InterPro ID IPR000483.
XML Result
<?xml version="1.0" encoding="UTF-8"?>
<resultset>
   <api_version>1.1</api_version>
   <data_provider>FlyBase</data_provider>
   <data_version>FB2008_10</data_version>
   <query_time>2009-01-15 09:03:00</query_time>
   <query_url>http://flybase.org/gmodrpc/v1.1/fulltext/cotransfection?type=SO:0000704</query_url>
   <result>
      <dbxref>
         <db>FlyBase</db>
         <accession>FBgn0085432</accession>
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0085432</url>
      </dbxref>
      <date_created>2003-03-08 00:00:00</date_created>
      <last_modified>2005-01-15 09:03:00</last_modified>
   </result>
   <result>
      <dbxref>
         <db>FlyBase</db>
         <accession>FBgn0004364</accession>
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0004364</url>
      </dbxref>
      <date_created>2005-01-08 00:00:00</date_created>
      <last_modified>2009-01-01 00:00:00</last_modified>
   </result>
</resultset>
JSON Result
{
   resultset:{
       api_version:1.1,
       data_provider:'FlyBase',
       data_version:'FB2008_10',
       query_time:'2009-01-15 09:03:00',
       query_url:'http://flybase.org/gmodrpc/v1.1/fulltext/cotransfection?type=SO:0000704',
       result:[
           {
               dbxref:{
                   db:'FlyBase',
                   accession:'FBgn0085432',
                   url:'http://flybase.org/gmodrpc/v1.1/fetch/FBgn0085432'
               },
               date_created:'2003-03-08 00:00:00',
               last_modified:'2005-01-15 09:03:00'
           },
           {
               dbxref:{
                   db:'FlyBase',
                   accession:'FBgn0004364',
                   url:'http://flybase.org/gmodrpc/v1.1/fetch/FBgn0004364'
               },
               date_created:'2005-01-08 00:00:00',
               last_modified:'2009-01-01 00:00:00'
           }
       ]
   }
}

Gene location

Service Name

location

Purpose

Retrieves a list of features that lie within a specific sequence range.

Description

This service returns features that lie within a specific sequence range. Arguments include the name of the largest assembled unit (i.e. chromosome, scaffold, etc...), location start (fmin), location stop (fmax), and strand. Results can be restricted to a specific organism by supplying the NCBI taxonomy id.

URL

http://yourmod.org/gmodrpc/v<api version>/location/chromosome/<name>[.xml | .json]?[type=<SO term ID>][fmin=<int>][fmax=<int>][strand=(1 | -1)][taxid=<taxid>][genus=<genus>][species=<species>]

Return types

XML or JSON

Default return type

XML

Example URLs
  • http://flybase.org/gmodrpc/v1.1/location/chromosome/X?type=SO:0000704 - Find all genes that are localized on the X chromosome of any Drosophila species.
  • http://flybase.org/gmodrpc/v1.1/location/chromosome/X?type=SO:0000704&taxid=7227 - Find all genes that are localized to the X chromosome of melanogaster.
  • http://flybase.org/gmodrpc/v1.1/location/chromosome/X.json?type=SO:0000704&fmin=40000&taxid=7227 - Find all genes that are localized on the X chromosome in the range of 40,000 bp to the end of X on any strand.
  • http://flybase.org/gmodrpc/v1.1/location/chromosome/X.xml?type=SO:0000704&genus=Drosophila&species=melanogaster&fmax=40000 - Find all genes that are localized on the X chromosome in the range of the start of the X up to and including 40,000 bp on any strand.
  • http://flybase.org/gmodrpc/v1.1/location/chromosome/X.xml?type=SO:0000704&fmin=50000&fmax=140000&strand=1&taxid=7227 - Find all genes that are localized on the plus strand of the X chromosome between and including 50,000 bp and 140,000 bp.
XML Result
<?xml version="1.0" encoding="UTF-8"?>
<resultset>
   <api_version>1.1</api_version>
   <data_provider>FlyBase</data_provider>
   <data_version>FB2008_10</data_version>
   <query_time>2009-01-15 09:03:00</query_time>
   <query_url>http://flybase.org/gmodrpc/v1.1/location/chromosome/2L?type=SO:0000704&amp;fmin=12587000&amp;fmax=12629000&amp;taxid=7227</query_url>
   <result>
      <dbxref>
         <db>FlyBase</db>
         <accession>FBgn0085424</accession>
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0085424</url>
      </dbxref>
      <date_created>2003-03-08 00:00:00</date_created>
      <last_modified>2005-01-15 09:03:00</last_modified>
   </result>
</resultset>
JSON Result
{
   resultset:{
       api_version:1.1,
       data_provider:'FlyBase',
       data_version:'FB2008_10',
       query_time:'2009-01-15 09:03:00',
       query_url:'http://flybase.org/gmodrpc/v1.1/location/chromosome/2L?type=SO:0000704&fmin=12587000&fmax=12629000&taxid=7227',
       result:[
           {
               dbxref:{
                   db:'FlyBase',
                   accession:'FBgn0085424',
                   url:'http://flybase.org/gmodrpc/v1.1/fetch/FBgn0085424'
               },
               date_created:'2003-03-08 00:00:00',
               last_modified:'2005-01-15 09:03:00'
           }
       ]
   }
}

Gene Ontology search

Service Name

ontology

Purpose

Search for genes that have been annotated with a particular gene ontology ID.

Description

This service returns genes that have been annotated with a particular ontology term. Results can be restricted to a specific organism by supplying the NCBI taxonomy id.

URL

http://yourmod.org/gmodrpc/v<api version>/ontology/gene/<ontology ID>[.xml | .json]?[taxid=<taxid>][genus=<genus>][species=<species>]

Return types

XML or JSON

Default return type

XML

Example URLs
  • http://flybase.org/gmodrpc/v1.1/ontology/gene/GO:0005515 - Find all genes annotated with GO:0005515.
  • http://flybase.org/gmodrpc/v1.1/ontology/gene/!GO:0005515 - Find all genes annotated with GO:0005515 and the GO NOT operator.
  • http://flybase.org/gmodrpc/v1.1/ontology/gene/GO:0005515?taxid=7227 - Find all Drosophila melanogaster genes annotated with GO:0005515.
  • http://flybase.org/gmodrpc/v1.1/ontology/gene/GO:0005515.json - Find all genes annotated with GO:0005515 and return a JSON result.
XML Result
<?xml version="1.0" encoding="UTF-8"?>
<resultset>
   <api_version>1.1</api_version>
   <data_provider>FlyBase</data_provider>
   <data_version>FB2008_10</data_version>
   <query_time>2009-01-15 09:03:00</query_time>
   <query_url>http://flybase.org/gmodrpc/v1.1/ontology/gene/GO:0005515</query_url>
   <result>
      <dbxref>
         <db>FlyBase</db>
         <accession>FBgn0085432</accession>
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0085432</url>
      </dbxref>
      <date_created>2003-03-08 00:00:00</date_created>
      <last_modified>2005-01-15 09:03:00</last_modified>
   </result>
   <result>
      <dbxref>
         <db>FlyBase</db>
         <accession>FBgn0004364</accession>
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0004364</url>
      </dbxref>
      <date_created>2005-01-08 00:00:00</date_created>
      <last_modified>2009-01-01 00:00:00</last_modified>
   </result>
</resultset>
JSON Result
{
   resultset:{
       api_version:1.1,
       data_provider:'FlyBase',
       data_version:'FB2008_10',
       query_time:'2009-01-15 09:03:00',
       query_url:'http://flybase.org/gmodrpc/v1.1/ontology/gene/GO:0005515',
       result:[
           {
               dbxref:{
                   db:'FlyBase',
                   accession:'FBgn0085432',
                   url:'http://flybase.org/gmodrpc/v1.1/fetch/FBgn0085432'
               },
               date_created:'2003-03-08 00:00:00',
               last_modified:'2005-01-15 09:03:00'
           },
           {
               dbxref:{
                   db:'FlyBase',
                   accession:'FBgn0004364',
                   url:'http://flybase.org/gmodrpc/v1.1/fetch/FBgn0004364'
               },
               date_created:'2005-01-08 00:00:00',
               last_modified:'2009-01-01 00:00:00'
           }
       ]
   }
}

Gene ortholog search

Service name

orthologs/gene

Purpose

Search for orthologs of the supplied gene ID.

Description

This service returns genes that have been determined by some means to be orthologous to the supplied gene ID. If the supplied gene ID is within the namespace of the web service provider then all known orthologs of that gene are returned. If the supplied gene ID is not within the namespace of the web service provider then it only returns genes for organisms that are offered by the service provider.

For example, for a given gene FlyBase stores orthology calls to other FlyBase genes and non FlyBase genes. Thus, given a FlyBase gene ID you can obtain a list of gene IDs for genes within FlyBase and to other non Drosophila species. In addition, given a non FlyBase gene ID you can obtain a list of FlyBase genes that are orthologous to it.

Results can be restricted to a specific organism by supplying the NCBI taxonomy ID.

URL

http://yourmod.org/gmodrpc/v<api version>/orthologs/gene/<gene ID>[.xml | .json]?[taxid=<taxid>][genus=<genus>][species=<species>]

Return types

XML or JSON

Default return type

XML

Example URLs
  • http://flybase.org/gmodrpc/v1.1/orthologs/gene/FBgn0004364 - Find all FlyBase and non FlyBase genes that are orthologous to FBgn0004364.
  • http://flybase.org/gmodrpc/v1.1/orthologs/gene/FBgn0004364?taxid=7240 - Find out if FBgn0004364 has an ortholog in Drosophila simulans.
  • http://flybase.org/gmodrpc/v1.1/orthologs/gene/WBGene12345.json - Find all FlyBase genes that are orthologous to WBGene12345 and return a JSON result.
XML Result:
<?xml version="1.0" encoding="UTF-8"?>
<resultset>
   <api_version>1.1</api_version>
   <data_provider>FlyBase</data_provider>
   <data_version>FB2008_10</data_version>
   <query_time>2009-01-15 09:03:00</query_time>
   <query_url>http://flybase.org/gmodrpc/v1.1/orthologs/gene/FBgn0000490</query_url>
   <result>
      <dbxref>
         <db>FlyBase</db>
         <accession>FBgn0097591</accession>
         <data_provider>FlyBase</data_provider>
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0097591</url>
      </dbxref>
   </result>
   <result>
      <dbxref>
          <db>ENSEMBL</db>
          <accession>ENSBTAP00000004992</accession>
          <data_provider>InParanoid</data_provider>
      </dbxref>
   </result>
</resultset>
JSON Result
{
   resultset:{
       api_version:1.1,
       data_provider:'FlyBase',
       data_version:'FB2008_10',
       query_time:'2009-01-15 09:03:00',
       query_url:'http://flybase.org/gmodrpc/v1.1/orthologs/gene/FBgn0000490',
       result:[
           {
               dbxref:{
                   db:'FlyBase',
                   accession:'FBgn0097591',
                   data_provider:'FlyBase'
                   url:'http://flybase.org/gmodrpc/v1.1/fetch/FBgn0097591'
               }
           },
           {
               dbxref:{
                   db:'ENSEMBL',
                   accession:'ENSBTAP00000004992',
                   data_provider:'InParanoid'
               }
           }
       ]
   }
}

Organism ortholog search

Service name

orthologs/organism

Purpose

Returns a list of orthologs between an organism and one or more other organisms.

Description

This service returns genes that have been determined by some means to be orthologous between a single organism and one or more other organisms. The organisms are specified by providing taxonomy IDs.

URL

http://yourmod.org/gmodrpc/v<api version>/orthologs/organism[/<taxid>][/genus/<genus>/species/<species>][.xml | .json]?[to_taxid=<taxid>][to_genus=<genus>&to_species=<species>]

Return types

XML or JSON

Default return type

XML

Example URLs
  • http://flybase.org/gmodrpc/v1.1/orthologs/organism/genus/Drosophila/species/melanogaster - Find all orthologs between Dmel and any other species.
  • http://flybase.org/gmodrpc/v1.1/orthologs/organism/7227.xml?to_taxid=7240 - Find all orthologs between Dmel and Dsim.
  • http://flybase.org/gmodrpc/v1.1/orthologs/organism/7227.json?to_taxid=7240 - Same as above except returned in JSON format.
XML Result:
<?xml version="1.0" encoding="UTF-8"?>
<resultset>
   <api_version>1.1</api_version>
   <data_provider>FlyBase</data_provider>
   <data_version>FB2008_10</data_version>
   <query_time>2009-01-15 09:03:00</query_time>
   <query_url>http://flybase.org/gmodrpc/v1.1/orthologs/organism/genus/Drosophila/species/melanogaster</query_url>
   <result>
      <dbxref>
         <db>FlyBase</db>
         <accession>FBgn0000490</accession>
         <taxonomy_id>7227</taxonomy_id>
         <data_provider>FlyBase</data_provider>
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0000490</url>
      </dbxref>
      <dbxref>
         <db>FlyBase</db>
         <accession>FBgn0015673</accession>
         <taxonomy_id>7240</taxonomy_id>
         <data_provider>FlyBase</data_provider>
         <url>http://flybase.org/gmodrpc/v1.1/fetch/FBgn0015673</url>
      </dbxref>
      <dbxref>
         <db>WormBase</db>
         <accession>WBGene00006570</accession>
         <taxonomy_id>6239</taxonomy_id>
         <data_provider>InParanoid</data_provider>
         <url>http://wormbase.org/gmodrpc/v1.1/fetch/WBGene00006570</url>
      </dbxref>
   </result>
...
</resultset>
JSON Result
{
   resultset:{
       api_version:1.1,
       data_provider:'FlyBase',
       data_version:'FB2008_10',
       query_time:'2009-01-15 09:03:00',
       query_url:'http://flybase.org/gmodrpc/v1.1/orthologs/organism/genus/Drosophila/species/melanogaster',
       result:[
         {
           dbxref:[
               {
                   db:'FlyBase',
                   accession:'FBgn0000490',
                   taxonomy_id:7227,
                   data_provider:'FlyBase',
                   url:'http://flybase.org/gmodrpc/v1.1/fetch/FBgn0000490'
               },
               {
                   db:'FlyBase',
                   accession:'FBgn0015673'
                   taxonomy_id:7240,
                   data_provider:'FlyBase',
                   url:'http://flybase.org/gmodrpc/v1.1/fetch/FBgn0015673'
               },
               {
                   db:'WormBase',
                   accession:'WBGene00006570',
                   taxonomy_id:6239,
                   data_provider:'InParanoid',
                   url:'http://wormbase.org/gmodrpc/v1.1/fetch/WBGene00006570'
               }
           ]
         }
       ]
   }
}

Fetching

Gene records

Service name

fetch/gene

Purpose

To fetch gene records in the Generic gene page XML format as implemented by Bio GMOD GenericGenePage.

Description
URL

http://yourmod.org/gmodrpc/v<api version>/fetch/gene/<gene ID>

Return types

XML

Default return type

XML

Example URLs
  • http://flybase.org/gmodrpc/v1.1/fetch/gene/FBgn0097591
XML Result

See Bio GMOD GenericGenePage for example XML.

Sequence

Service name

fetch/seq

Purpose

Returns FASTA sequence for the specified query.

Description
URL

http://yourmod.org/gmodrpc/v<api version>/fetch/seq/<ID>[/<SO term ID of subtype>]

Return types

FASTA

Example URLs
  • http://flybase.org/gmodrpc/v1.1/fetch/seq/FBgn0097591.fasta - Fetch the FASTA sequence of FBgn0097591
  • http://flybase.org/gmodrpc/v1.1/fetch/seq/FBgn0097591/SO:0000204.fasta - Download all 5' UTRs of the gene FBgn0097591
  • http://flybase.org/gmodrpc/v1.1/fetch/seq/FBgn0097591/SO:0000316.fasta - Download all CDS features of the gene FBgn0097591
  • http://flybase.org/gmodrpc/v1.1/fetch/seq/FBgn0097591/SO:0000316.fasta - Download all CDS features of the gene FBgn0097591


FASTA Result:

TODO

  • WADLs for all services?