MyGene.Info : Gene Annotation as a Service

About MyGene.Info

MyGene.Info provides simple-to-use REST web services to query/retrieve gene annotation data. It's designed with simplicity and performance emphasized. A typical use case is to use it to power a web application which requires querying genes and obtaining common gene annotations. For example, MyGene.Info services are used to power BioGPS.

MyGene.Info web services

MyGene.Info provides two simple web services: one for gene queries and the other for gene annotation retrieval. Both return results in JSON format.

Gene query serivce:

URL:
http://mygene.info/query
Examples:
http://mygene.info/query?q=cdk2
http://mygene.info/query?q=cdk2+AND+species:human
http://mygene.info/query?q=cdk?
http://mygene.info/query?q=p*
http://mygene.info/query?q=entrezgene:1017
http://mygene.info/query?q=ensemblgene:ENSG00000123374
Documentation

You can read the full description of our query syntax here.
NEW: We now support batch queries via POST. See how to make POST call.

Gene annotation service:

URL:
http://mygene.info/gene/<geneid>
Examples:
http://mygene.info/gene/1017
http://mygene.info/gene/ENSG00000123374

http://mygene.info/gene/1017?filter=name,symbol,summary

"<geneid>" can be any of Entrez or Ensembl Gene ids from supported species. A retired Entrez Gene id works too if it is replaced by a new one.

Documentation

You can read the full description of our query syntax here.
NEW: We now support batch queries via POST. See "how to make POST call".

Calling MyGene.Info services from web applications

You can call Mygene.info services from either server-side or client-side (via AJAX). The sample code can be found at "demo" section.

Calling services from server-side

All common programing languages provide functions for making http requests and JSON parsing. For Python, you can using build-in httplib and json modules (v2.6 up), or third-party httplib2 and simplejson modules. For Perl, LWP::Simple and JSON modules should work nicely.

Making AJAX calls from client-side

When making an AJAX call from a web application, it is restricted by "same-origin" security policy.

Making your own server-side proxy

To overcome "same-origin" restriction, you can create proxy at your server-side to our services. And then call your proxied services from your web application.

Setup proxy in popular server-side applications, like Apache, Nginx and PHP, are straightforward.

Making JSONP call

Because our core services are just called as simple GET http requests (though we support POST requests for batch queries too), you can bypass "same-origin" restriction by making JSONP call as well. To read more about JSONP, see 1, 2, or just Google about it. All our services accept an optional "jsoncallback" parameter, so that you can pass your callback function to make a JSONP call.

All popular javascript libraries have the support for making JSONP calls, like in JQuery, ExtJS, MooTools

Cross-origin http request through CORS

(NEW) Cross-Origin Resource Sharing (CORS) specification is a W3C draft specification defining client-side cross-origin requests. It's actually supported by all major browsers by now (Internet Explorer 8+, Firefox 3.5+, Safari 4+, and Chrome), but not many people are aware of it. Unlike JSONP, which is limited to GET requests only, you can make cross-domain POST requests as well. Our services supports CORS requests on both GET and POST requests. You can find more information and use case here and here.

JQuery's native ajax call supports CORS since v1.5.

Usage Demo

In this demo, we want to create a web site to display expression charts from a microarray dataset (Affymetrix MOE430v2 chip). The expression data are indexed by porobeset ids, but we need to allow users to query for any mouse genes using any commonly-used identifiers, and then display expression charts for any selected gene.

We implemented this demo in three ways:

Example 1: using CGI

Example 2: using tornado

Example 3: using JSONP

Example 3: using CORS

(NEW)

What's behind MyGene.Info

MyGene.Info is built on CouchDB, a document-based database. Unlike more commonly used relational database systems (e.g., Oracle, MySQL), data are stored as "key-document" pairs. The "document" is a JSON-formatted gene annotation object, while the "key" is a gene ID (Entrez or Ensembl). The hierarchical structure of gene annotation data can be represented naturally in this key-document model. This simple object structure in CouchDB greatly simplified both data loading and data queries, and also gains impressive query performance.

On top of CouchDB, we use tornado, a lightweighted and fast web framework in python, to build our application layer. And then Nginx is used as the front-end to serve outside requests.

Source code

The source code of MyGene.Info are hosted at bitbucket

How many species are supported?

We currently support all genes from eight species:

Common name Genus name Taxonomy id Genome assembly
human Homo sapiens 9606 hg19
mouse Mus musculus 10090 mm9
rat Rattus norvegicus 10116 rn4
fruitfly Drosophila melanogaster 7227 dm3
nematode Caenorhabditis elegans 6239 ce7
zebrafish Danio rerio 7955 danRer6
thale-cress Arabidopsis thaliana 3702 NA
frog Xenopus tropicalis 8364 xenTro2
pig Sus scrofa 9823 susScr2

Gene annotation data are regularly updated once per month. The more updated data information can be access here.

Who is using MyGene.Info?

Contact us

Your feedback to help@mygene.info is welcome.