Webservice::InterMine - modules for interacting with InterMine datawarehouse webservices
use Webservice::InterMine; my $service = Webservice::InterMine->new_service($url, $user, $pass); my $template = $service->template($name); my $results = $template->results_with(valueA => 'x', valueB => 'y'); OR use Webservice::InterMine 'flymine', 'some-username', 'some-password'; my $query = Webservice::InterMine->new_query; $query->add_view(@views); $query->add_constraint( path => $path, op => $op, value => $value, ); my $results = $query->results;
This distribution is the client interface to any implementation of the InterMine Datawarehousing WebService (www.intermine.org). Primarily used for biological genomic databases, the webservice allows the user to easily write and execute structured queries.
This module allows you to interact with one or more webservices by providing a url to an InterMine implementation.
This package can be installed using the following commands (Module::Build >= 0.36 is required):
perl Build.PL ./Build test sudo ./Build install
If any runtime dependencies are missing, you can use the following command to install them:
sudo ./Build installdeps
In the example above the modules are imported with the following statements:
use Webservice::InterMine;
and
use Webservice::InterMine 'flymine', 'some-username', 'some-password';
Calling use Webservice::InterMine without any parameters simply means you need to either specify the webservice url on every call, or call the methods on a service directly.
use Webservice::InterMine
If you call use Webservice::InterMine $mine, [$user, $pass], a default service will be set, meaning method calls will not require the webservice url. Unless you are intending to access multiple services, this form is recommended.
use Webservice::InterMine $mine, [$user, $pass]
returns a new query object for you to fill in with constraints before being run to get its results.
Parameters:
from => [url, user, pass]
An array ref of arguments to pass to get_service. This information can be used to specify a different service than the one named on import, or to specify one when none was named on import.
%query_args
Key value pairs of arguments to pass to the query constructor in Webservice::InterMine::Service. This methid serves as sugar for the factory method in that class.
Please see Webservice::InterMine::Query, Webservice::InterMine::Service.
Creates a new list with the content specified by the list arguments. The content key-word parameter will always be required. For a full specification of creating lists, see: Webservice::InterMine::Service.
content
%list_args
Key value pairs of arguments to pass to the list constructor in Webservice::InterMine::Service. This methid serves as sugar for the factory method in that class.
Get the list of the given name from the default service, or the given service if details are supplied.
Returns a query object based on xml you have previously saved, either as a string or as a file. For a file pass:
load_query(source_file => $file);
For a string:
load_query(source_string => $string);
If you want a specific service, call it thus:
load_query(from => [$name, $user, $pass], source_string => $string);
OR:
Please see Webservice::InterMine::Query::Saved
returns the named template (if it exists - if not it returns undef). If you pass a url, it returns the named template from the specified webservice.
Please see Webservice::InterMine::Query::Template
returns the named saved_query (if it exists - if not it returns undef). If you pass a url, it returns the named query from the specified webservice.
This method requires you to have provided a username and password to the webservice for authentication.
returns a webservice object, which is used to construct queries and fetch templates and saved queries. If a url is passed, the webservice for that url is returned, otherwise the service for the url given to use is returned.
use
If a service for a url has been created previously, that one is returned, even if different login details are provided.
Please see: Webservice::InterMine::Service
Returns saved user name and passwords from the webservice config file if it exists. This file should be located at ~/.intermine-webservices.config, and should have the following format:
flymine user@somewhere.edu password metabolicmine user@somewhere.edu another-password http://yeastmine.org/yeastmine user@somewhere.org A v3rj d1EE!kvlt 0n3
ie., whitespace separated fields. The password may contain whitespace characters, but no new-lines. The mine-name/url needs to identical to the name used to request the service.
Deletes all automatically created anonymous lists. Any renamed lists will be spared the clean-up. This method is called on system exit, unless the variable $Webservice::InterMine::CLEAN_UP is set to a false value.
An unknown method preceded with 'get_' will be interpreted as a mine name, and an attempt will be made to return a service with that name.
Webservice::InterMine::Cookbook for a guide on how to use these modules.
Webservice::InterMine::Query
Webservice::InterMine::Service
Webservice::InterMine::List
Webservice::InterMine::Query::Template
Webservice::InterMine::Query::Saved
Webservice::InterMine::Bio Biologically specific roles.
Alex Kalderimis <dev@intermine.org>
<dev@intermine.org>
Please report any bugs or feature requests to dev@intermine.org.
dev@intermine.org
You can find documentation for this module with the perldoc command.
perldoc Webservice::InterMine
You can also look for information at:
InterMine
http://www.intermine.org
Documentation
http://www.intermine.org/perlapi
Copyright 2006 - 2011 FlyMine, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Webservice::InterMine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Webservice::InterMine
CPAN shell
perl -MCPAN -e shell install Webservice::InterMine
For more information on module installation, please visit the detailed CPAN module installation guide.