Skip to content

Instantly share code, notes, and snippets.

@joshkh
Created October 17, 2017 09:52
Show Gist options
  • Save joshkh/6974179420a9fffef973e3834c1dbd6c to your computer and use it in GitHub Desktop.
Save joshkh/6974179420a9fffef973e3834c1dbd6c to your computer and use it in GitHub Desktop.
InterMine Python Tutorial 1
from intermine.webservice import Service
service = Service("www.flymine.org/query/service")
query=service.new_query()
query.select("Gene.symbol","Gene.primaryIdentifier", "Gene.length")
for row in query.rows(start=0,size=10):
print(row)
query=service.new_query("Gene")
query.select("symbol","primaryIdentifier","length")
for row in query.rows(start=0,size=10):
print(row)
query2=service.new_query()
query2.select("Organism.name")
query2.add_view("Organism.taxonId")
for row in query2.rows(start=0,size=10):
print(row)
query2.add_sort_order("Organism.taxonId")
for row in query2.rows(start=0,size=10):
print(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment