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)
}
});