Diabetes Epigenome Atlas Application Programming Interface (API)
The Diabetes Genome Atlas API provides programmatic access to Diabetes Genome Atlas portal and drives data query and submission functionality. The Diabetes Genome Atlas API uses JSON and standard HTTP verbs for communication with the portal.
There are several third-party tools that can be used with Diabetes Genome Atlas REST API, we have tested following tools that can be used for communicating with our portal:
Tool |
Description |
Web browser plugin for Safari |
|
Web browser plugin for Chrome and Firefox |
|
Web browser plugin for Chrome |
|
Command line tool |
|
Tool for API development |
Diabetes Genome Atlas Accession Ids
Every object (e.g., experiment, annotation, biosamples, antibodies, data file etc.) have unique accession TSTXXXXXXXX ids. API request – response can be made to retrieve specific individual, group or mashup of these objects.
Search and Retrieval Examples
Web browser JSON pretty-printer plugin
JSON pretty-printer plugin for web browser can be used to view page as JSON. In order to view page as JSON add ?format=json
to the URL
Example: To request metadata for experiment TSTSR112545:
http://www.t2depigenome.org/experiments/TSTSR112545/?format=json
Curl
Prerequisite: json.tool provides command line interface to validate and pretty-print JSON
Installation for OS X and Linux:
$ pip install jsontool
The following is an example of a request to annotation endpoint using annotation id, that retrieves annotation metadata:
$ curl –L -H "Accept: application/json" http://www.t2depigenome.org/annotations/TSTSR027410/ | python -m json.tool > 13-state_model_liver.json
Sample Output:
The following is an example of a request to annotation endpoint using annotation id, that retrieves annotation metadata:
curl -L -H "Accept: application/json" http://www.t2depigenome.org/search/?searchTerm=RRBS | python -m json.tool > RRBS
Retrieval of all ATAC-seq experiments in TSV format
curl -L "Accept: application/json" 'www.t2depigenome.org/report.tsv?type=Experiment&searchTerm=ATAC-seq'
Programmatic access to metadata
T2DREAM_metadata_access.py script abstracts the GET request for metadata retrieval. It takes metadata type and accession id and returns metadata in JSON format.
The following metadata endpoints are available from Diabetes Epienome Atlas API to access metadata programmatically
Metadata Endpoints (--type) |
Description |
experiment |
Includes assay metadata, replicate information and data files |
annotation |
Metadata for an annotation set |
files |
Metadata for a data file (e.g., fastq, bigwig, bed, bam, bigBed, tagAlign, sra) |
biosamples |
Metadata for biosamples |
antibodies |
Metadata for antibodies |
target |
metadata for target gene |
The REST-API codebase is available on Diabetes Epigenome Atlas REST API GitHub Repository
Prerequisite: python modules - argparse , json, requests
Example: Download antibody metadata
python T2DREAM_metadata_access.py --accession TSTAB000404 --type antibodies