Skip to content

Instantly share code, notes, and snippets.

@cmdcolin
Last active August 29, 2015 14:07
Show Gist options
  • Save cmdcolin/5d4e2a1c055ef66640dc to your computer and use it in GitHub Desktop.
Save cmdcolin/5d4e2a1c055ef66640dc to your computer and use it in GitHub Desktop.
<script src="require.js"></script>
// uses https://github.com/alexkalderimis/imjs
<script>
require(['js/im'], function(im) {
console.log(im);
var flymine = new im.Service({root: 'www.flymine.org/query'});
var query = {
from: 'Gene',
select: [
'exons.symbol',
'chromosome.primaryIdentifier',
'exons.chromosomeLocation.start',
'exons.chromosomeLocation.end'
],
where: {
symbol: 'eve',
organism: {lookup: 'D. melanogaster'}}
};
flymine.rows(query).then(function(rows) {
console.log("No. of exons: " + rows.length);
rows.forEach(function printRow(row) {
console.log("[" + row[0] + "] " + row[1] + ":" + row[2] + ".." + row[3]);
});
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment