Webservice::InterMine::Cookbook::List::Upload - Uploading Lists
use Webservice::InterMine; my $service = Webservice::InterMine->get_service('www.flymine.org/query', $TOKEN); # From a file on disk containing gene symbols (one per line). my $file = '/path/to/some/file/somewhere.tsv'; my $list = $service->new_list(content => $file, type => 'Gene', name => 'an uploaded list'); # From an array of strings my @symbols = qw/eve zen rudimentary Mad/; my $list = $service->new_list(content => \@symbols, type => 'Gene', name => 'an uploaded list'); # From a query my $query = $service->new_query(class => 'Gene'); $query->add_constraint( path => 'Gene', op => 'IN', value => 'my other list' ); $query->add_constraint( path => 'Gene.length', op => '<', value => 2000 ); # The type of this list can be inferred my $list = $service->new_list(content => $query, name => 'an uploaded list');
You can create lists associated with your account in two main ways. Either you can provide a collection of identifiers (for example gene symbols) and get the InterMine server try and unambiguously resolve them into objects in the database, or you can provide a query that specifies exactly what you want.
If you don't specify a name, a default name will be assigned, and unless the query is renamed, the list will be deleted when the program terminates.
Notes:
All text in the files will be interpreted as identifiers, so you wouldn't want to, say, try to upload a gff3 file directly. Valid separators are spaces, tabs and new-lines, so you will want to quote (with either double or single quotes) and identifiers that have these characters.
These strings will be automatically quoted.
If the query has no output columns (an empty view) the root of the query will be used to define what to save. If there are output columns, they should all be attached to the same object, and that will be used to identify the objects to save. ie:
# If used this query would save a list of one gene. my $query = $service->new_query(class => 'Gene'); $query->add_constraint(path => 'Gene.symbol', op => '=', value => 'eve'); # Adding this view would make this query save the list of proteins associated with eve. $query->add_view('Gene.proteins.name');
These will be ignored. See Webservice::InterMine::Cookbook::IdResolution for ways to deal with these issues.
Lists can be created from a variety of sources.
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.