Last modified 2 months ago Last modified on 23/12/11 12:21:27

InterMine instances offer a range of services through a RESTful HTTP interface. These services expose data and operations that are accessible from any script or programme that can communicate over HTTP. To facilitate this, we also publish client libraries in a number of popular languages to simplify the construction of webservice requests, and the parsing of webservice responses.

A short example

The easiest way to get started with the web services is to use code automatically generated from the web interface. In this short example we'll generate some Python code from the [www.flymine.org FlyMine] web site and run it.

  1. First install the intermine python package, the API tab in each Mine gives instructions:  see FlyMine
  2. Open a FlyMine template query:  Protein Domain --> Proteins + Genes coding for these proteins.
  3. Click 'Edit Query' at the bottom right of the page. This shows the same query in the QueryBuilder interface.
  4. At the bottom of the page click 'Python' to generate Python code that will construct and execute the query. Copy the code and save it in a file called flymine-demo.py
  5. Run it with (you should see about two hundred lines of output):
    python flymine-demo.py
    
  6. Now open the flymine-demo.py file in a text editor again. Where you see query.add_view(...) add "Protein.genes.symbol" to the arguments and run the script again. You should now see an extra column showing the gene symbol.