Created
July 10, 2015 15:58
-
-
Save joshkh/74c0fa13f8f5ef8fbfe1 to your computer and use it in GitHub Desktop.
IMJS 3.14.0 query example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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