Skip to content

Instantly share code, notes, and snippets.

@bmcorser
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmcorser/9c7be6472e5e084ffd70 to your computer and use it in GitHub Desktop.
Save bmcorser/9c7be6472e5e084ffd70 to your computer and use it in GitHub Desktop.

The genomebrowser API does not deal with foreign key associations at all.

A request requires enough information to get to a chromosome id (either directly a chromosome id, or combination of genome/chromsome filters) and a target region (start and end). This information should be provided in a JSON-encoded JavaScript object transmitted in the request body. Detailed spec:

{
    chromosome: {
        name: "%Y%" // SQL-style wildcards supported
    },
    genome: {
        version: "new",
        name: "human"
    },
    target_region: {
        start: 1000,
        end: 2000,
        strand: 1  // optional, default 0
    },
    region_type: ["gene", "exon"]
}

This would return ...

{
    gene: [ ... ],  // a list of gene objects
    exon: [ ... ],  // a list of exon objects
    sequence: {
        bases: "ACTG...ACTG",  // full sequence for the requested target region
        strand: 1
    }
}

Example using jQuery:

$.ajax({
    type: "POST",
    url: 'http://genomebrowser.deskgen.com/api/genomebrowser', // domain is just an example
    data: JSON.stringify({
        chromosome: {
            id: 1
        },
        target_region: {
            start: 1000,
            end: 2000
        },
        region_type: ["gene", "exon"]
    }),
    dataType: 'json',
    crossDomain: true,
    success: function(d) {
        console.log(d)
    }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment