|  Help  |  About  |  Contact Us

Perl Web Service Client

The Perl web service client library makes it easy to run queries in MouseMine directly from Perl programs. You can use these modules to construct any query you could run from web interface and fetch the results in a number of formats, including native Perl data structures and objects, and TSV/CSV strings.
Like all our code, it is open-source, coming licensed under the LGPL. For information on our API, visit our wiki pages.


  • Prerequisites

    You should install the Perl webservice client library module to get started. You can install it directly from CPAN (the comprehensive Perl archive network). This is a public repository of thousands of modules. Using CPAN will ensure you get the latest version, and that your dependencies are automatically managed for you.

    To install the InterMine Perl client library type the following command into a shell:

    > sudo cpan Webservice::InterMine
  • Examples of using the downloaded script

    On each Template Query page and the QueryBuilder there is a link to get Perl code to run that particular query using the web service API. Just click the link, save the generated Perl script in a file and execute it. You can use the generated code as a starting point for your own programs.

    You can run the downloaded script by running the following command in a shell:

    > perl path/to/downloaded/script.pl

    If you get an error saying Cannot find Webservice::InterMine in @INC, or similar then see 'Prerequisites' above.

    Feel free to edit the script - these are designed to be spring-boards to help you get where you want to. See the Cookbook, which contains a set of short tutorial 'recipes' that demonstrate particular features of the Perl API, for ways to edit the scripts, and even extend their functionality.

    For a good reference to writing programs in Perl, see here.