Skip to content

Instantly share code, notes, and snippets.

@joshkh
Created July 10, 2015 15:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshkh/74c0fa13f8f5ef8fbfe1 to your computer and use it in GitHub Desktop.
Save joshkh/74c0fa13f8f5ef8fbfe1 to your computer and use it in GitHub Desktop.
IMJS 3.14.0 query example
<!doctype html>
<html>
<head>
<script src="http://cdn.intermine.org/js/intermine/imjs/3.14.0/im.js"></script>
</head>
<body>
<script>
var flymine = new imjs.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>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment