Bio::Phylo::PhyloWS::Client - Base class for phylogenetic web service clients
#!/usr/bin/perl
use strict;
use warnings;
use Bio::Phylo::Factory;
my $fac = Bio::Phylo::Factory->new;
my $client = $fac->create_client(
'-base_uri' => 'http://nexml-dev.nescent.org/nexml/phylows/tolweb/phylows/',
'-authority' => 'uBioNB',
);
my $desc = $client->get_query_result(
'-query' => 'Homo sapiens',
'-section' => 'taxon',
);
for my $res ( @{ $desc->get_entities } ) {
my $proj = $client->get_record( '-guid' => $res->get_guid );
print $proj->to_nexus, "\n";
}
This is the base class for clients connecting to services that implement the
PhyloWS (<http://evoinfo.nescent.org/PhyloWS>) recommendations.
- new()
-
Type : Constructor
Title : new
Usage : my $phylows = Bio::Phylo::PhyloWS::Client->new( -url => $url );
Function: Instantiates Bio::Phylo::PhyloWS::Client object
Returns : a Bio::Phylo::PhyloWS::Client object
Args : Required: -url => $url
Optional: any number of setters. For example,
Bio::Phylo::PhyloWS->new( -name => $name )
will call set_name( $name ) internally
- set_ua()
- Assigns a new LWP::UserAgent object that the client uses to communicate
with the service. Typically you don't have to use this unless you have to
configure a user agent for things such as proxies. Normally a default user
agent is instantiated when the client constructor is called.
Type : Mutator
Title : set_ua
Usage : $obj->set_ua( LWP::UserAgent->new );
Function: Assigns another (non-default) user agent
Returns : $self
Args : An LWP::UserAgent object (or child class)
- get_query_result()
- Gets search query result
Type : Accessor
Title : get_query_result
Usage : my $res = $obj->get_query_result( -query => $query );
Function: Returns Bio::Phylo::PhyloWS::Description object
Returns : A string
Args : Required: -query => $cql_query
Optional: -section, -recordSchema
- parse_query_result()
- Parses a raw query result
Type : Accessor
Title : parse_query_result
Usage : my $desc = $obj->parse_query_result($content);
Function: Parses a raw query result
Returns : Bio::Phylo::PhyloWS::Resource::Description object
Args : Raw result content
- get_record()
- Gets a PhyloWS database record
Type : Accessor
Title : get_record
Usage : my $rec = $obj->get_record( -guid => $guid );
Function: Gets a PhyloWS database record
Returns : Bio::Phylo::Project object
Args : Required: -guid => $guid
- get_ua()
- Gets the underlying LWP::UserAgent object that the client uses to
communicate with the service
Type : Accessor
Title : get_ua
Usage : my $ua = $obj->get_ua;
Function: Gets user agent
Returns : LWP::UserAgent object
Args : None
There is a mailing list at
<https://groups.google.com/forum/#!forum/bio-phylo> for any user or
developer questions and discussions.
Also see the manual: Bio::Phylo::Manual and
<http://rutgervos.blogspot.com>
If you use Bio::Phylo in published research, please cite it:
Rutger A Vos, Jason Caravas, Klaas Hartmann,
Mark A Jensen and Chase Miller, 2011. Bio::Phylo -
phyloinformatic analysis using Perl. BMC Bioinformatics 12:63.
<http://dx.doi.org/10.1186/1471-2105-12-63>