Difference between revisions of "Web Services REST API"

From CoGepedia
Jump to: navigation, search
(2. CoGe Web Services API (RESTful))
 
(52 intermediate revisions by 2 users not shown)
Line 1: Line 1:
There are two main ways a programmer can interact with CoGe:
+
Our web services let you incorporate CoGe's database of organisms, genomes, and other data sets into your web site or pipeline.  You can also run any type of analysis on CoGe.
#Through the web pages via URLs
+
#Through CoGe's web services API (Application Programming Interface)
+
  
==1. Linking to CoGe==
+
==Documentation==
 
+
* Interactive documentation: https://genomevolution.org/apidocs
Each web application of CoGe is designed for a particular task, and provides links to other web applications in CoGe. This is how CoGe's [[Open-ended Analysis Network]] works.  To get information on how to link to a particular web application, please see that application's wiki.  If the information you are seeking is not immediately apparent, please feel free to e-mail [mailto:elyons@berkeley.edu Eric Lyons] and for help.
+
** Live-test API endpoints using simple web interface
 
+
** A tad out of date and doesn't include all API endpoints
==2. CoGe Web Services API (RESTful)==
+
* Specification document: http://docs.google.com/document/d/1GXOPIVvyTwoGR2IRjDNmdd2nj_6d8db7jx9hG8RxTDc
 
+
** Up-to-date documentation of all API endoints
We are currently developing public web services for accessing and loading data in CoGe!
+
* [[Embedding CoGe JBrowse in your website]]
 
+
* Automated Testing ([http://robotframework.org/ Robot Framework]): https://geco.iplantcollaborative.org/coge/test/log.html
Here is our draft API specification document:<br>
+
http://docs.google.com/document/d/1GXOPIVvyTwoGR2IRjDNmdd2nj_6d8db7jx9hG8RxTDc
+
  
 +
==Examples==
  
 
'''Organism Search'''
 
'''Organism Search'''
 
<pre>
 
<pre>
curl http://genomevolution.org/coge/api/v1/organisms/search/col-0
+
curl https://genomevolution.org/coge/api/v1/organisms/search/col-0
 
{
 
{
 
   "organisms":
 
   "organisms":
Line 30: Line 27:
 
</pre>
 
</pre>
  
'''Organism Fetch'''
+
'''Genome Search'''
 
<pre>
 
<pre>
curl http://genomevolution.org/coge/api/v1/organisms/1
+
curl https://genomevolution.org/coge/api/v1/genomes/search/col-0
{
+
[
  "id": 1,
+
    {
  "name": "Arabidopsis thaliana Col-0 (thale cress)",
+
        "name": "",
  "description": "Eukaryota; Viridiplantae; Streptophyta; Embryophyta; Tracheophyta; Spermatophyta; Magnoliophyta; eudicotyledons; core eudicotyledons; rosids; eurosids II; Brassicales; Brassicaceae; Arabidopsis"
+
        "chromosome_count": 7,
  “genomes” : [ 16911, ... ]
+
        "sequence_type": {
}
+
            "id": "1",
 +
            "description": "unmasked sequence data",
 +
            "name": "unmasked"
 +
        },
 +
        "info": "Arabidopsis thaliana Col-0 (thale cress) (v10.02, id16911): unmasked",
 +
        "description": "",
 +
        "organism": {
 +
            "id": 1,
 +
            "description": "Eukaryota; Viridiplantae; Streptophyta; Embryophyta; Tracheophyta; Spermatophyta; Magnoliophyta; eudicotyledons; core eudicotyledons; rosids; eurosids II; Brassicales; Brassicaceae; Arabidopsis",
 +
            "name": "Arabidopsis thaliana Col-0 (thale cress)"
 +
        },
 +
        "restricted": false,
 +
        "organism_id": 1,
 +
        "version": "10.02",
 +
        "id": 16911,
 +
        "link": ""
 +
    },
 +
    ...
 +
]
 
</pre>
 
</pre>
  
 
'''Genome Fetch'''
 
'''Genome Fetch'''
 
<pre>
 
<pre>
curl http://genomevolution.org/coge/api/v1/genomes/16911
+
curl https://genomevolution.org/coge/api/v1/genomes/16911
 
{
 
{
 
   "id": 16911
 
   "id": 16911
Line 57: Line 72:
 
   "experiments": [31,32,33, ...],
 
   "experiments": [31,32,33, ...],
 
   "metadata": [],
 
   "metadata": [],
 +
  ...
 
}
 
}
 
</pre>
 
</pre>
 +
 +
'''Genome Sequence Download'''
 +
 +
Full Genome:
 +
<pre>curl https://genomevolution.org//coge/api/v1/genomes/16911/sequence</pre>
 +
 +
Partial Genome:
 +
<pre>https://genomevolution.org/coge/coge/api/v1/genomes/16911/sequence/<chr>?start=<x>&stop=<y></pre>
 +
 +
 +
More examples to be added soon!

Latest revision as of 16:53, 23 March 2017

Our web services let you incorporate CoGe's database of organisms, genomes, and other data sets into your web site or pipeline. You can also run any type of analysis on CoGe.

Documentation

Examples

Organism Search

curl https://genomevolution.org/coge/api/v1/organisms/search/col-0
{
   "organisms":
      [
         {
            "id": "1",
            "name": "Arabidopsis thaliana Col-0 (thale cress)",    
            "description": "Eukaryota; Viridiplantae; Streptophyta; Embryophyta; Tracheophyta; Spermatophyta; Magnoliophyta; eudicotyledons; core eudicotyledons; rosids; eurosids II; Brassicales; Brassicaceae; Arabidopsis"
         }
      ]
}

Genome Search

curl https://genomevolution.org/coge/api/v1/genomes/search/col-0
[
    {
        "name": "",
        "chromosome_count": 7,
        "sequence_type": {
            "id": "1",
            "description": "unmasked sequence data",
            "name": "unmasked"
        },
        "info": "Arabidopsis thaliana Col-0 (thale cress) (v10.02, id16911): unmasked",
        "description": "",
        "organism": {
            "id": 1,
            "description": "Eukaryota; Viridiplantae; Streptophyta; Embryophyta; Tracheophyta; Spermatophyta; Magnoliophyta; eudicotyledons; core eudicotyledons; rosids; eurosids II; Brassicales; Brassicaceae; Arabidopsis",
            "name": "Arabidopsis thaliana Col-0 (thale cress)"
        },
        "restricted": false,
        "organism_id": 1,
        "version": "10.02",
        "id": 16911,
        "link": ""
    },
    ...
]

Genome Fetch

curl https://genomevolution.org/coge/api/v1/genomes/16911
{
   "id": 16911
   "name": "",
   "description": "",
   "version": "10.02",
   "link": "",
   "restricted": false,
   "sequence_type": {
      "name": "unmasked",
      "description": "unmasked sequence data"
   },
   "experiments": [31,32,33, ...],
   "metadata": [],
   ...
}

Genome Sequence Download

Full Genome:

curl https://genomevolution.org//coge/api/v1/genomes/16911/sequence

Partial Genome:

https://genomevolution.org/coge/coge/api/v1/genomes/16911/sequence/<chr>?start=<x>&stop=<y>


More examples to be added soon!