Web Services REST API: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 10: | Line 10: | ||
'''Organism Search''' | '''Organism Search''' | ||
<pre> | <pre> | ||
curl | curl https://genomevolution.org/coge/api/v1/organisms/search/col-0 | ||
{ | { | ||
"organisms": | "organisms": | ||
Line 25: | Line 25: | ||
'''Organism Fetch''' | '''Organism Fetch''' | ||
<pre> | <pre> | ||
curl | curl https://genomevolution.org/coge/api/v1/organisms/1 | ||
{ | { | ||
"id": 1, | "id": 1, | ||
Line 36: | Line 36: | ||
'''Genome Fetch''' | '''Genome Fetch''' | ||
<pre> | <pre> | ||
curl | curl https://genomevolution.org/coge/api/v1/genomes/16911 | ||
{ | { | ||
"id": 16911 | "id": 16911 | ||
Line 55: | Line 55: | ||
'''Experiment Add''' | '''Experiment Add''' | ||
<pre> | <pre> | ||
curl -H "Content-Type: application/json" -X PUT --data @experiment_add.json " | curl -H "Content-Type: application/json" -X PUT --data @experiment_add.json "https://genomevolution.org/coge/api/v1/experiments?username=xxx&token=yyy" | ||
Here is a sample JSON request body for experiment_add.json: | Here is a sample JSON request body for experiment_add.json: |
Revision as of 17:00, 17 July 2015
CoGe's web services API let's you incorporate CoGe's database of organisms, genomes, and data sets into your web site or pipeline.
Here is our draft API specification document:
http://docs.google.com/document/d/1GXOPIVvyTwoGR2IRjDNmdd2nj_6d8db7jx9hG8RxTDc
Below are some examples queries:
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" } ] }
Organism Fetch
curl https://genomevolution.org/coge/api/v1/organisms/1 { "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" “genomes” : [ 16911, ... ] }
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": [], }
Experiment Add
curl -H "Content-Type: application/json" -X PUT --data @experiment_add.json "https://genomevolution.org/coge/api/v1/experiments?username=xxx&token=yyy" Here is a sample JSON request body for experiment_add.json: { "restricted": true, "genome_id": 16911, "version": "1", "name": "DiffExpr1", "description": "Expression measurements from tissue X with treatment Y.", "source_name": "JGI", "items": [ { "type": "irods", "path": "/iplant/home/coge/coge_data/arabidopsis/experimental_condition1.csv" } ] }
More examples to be added soon!