| Summary | Included libraries | Package variables | Synopsis | Description | General documentation | Methods |
| WebCvs |
# list all available analyses from the default location,
# using a default (SOAP) access method
use Bio::Tools::Run::AnalysisFactory;
my $list = Bio::Tools::Run::AnalysisFactory->new();
->available_analyses;
use Data::Dumper; print Dumper ($list);
# ditto, but from a different location use Bio::Tools::Run::AnalysisFactory; my $list = Bio::Tools::Run::AnalysisFactory->new(-location => 'http://somewhere/something')
->available_analyses;
# ...and using a different access method # (this example is not yet impelmented) use Bio::Tools::Run::AnalysisFactory; my $list = Bio::Tools::Run::AnalysisFactory->new(-location => 'http://somewhere/something',
-access => 'novella')
->available_analyses;
# list available categories of analyses use Bio::Tools::Run::AnalysisFactory; my $categories = Bio::Tools::Run::AnalysisFactory->new(); ->available_categories; use Data::Dumper; print Dumper ($categories); # show all analyses group by categories use Bio::Tools::Run::AnalysisFactory; my $factory = Bio::Tools::Run::AnalysisFactory->new(); foreach $cat ( @{ $factory->available_categories } ) { my @sublist = @{ $factory->available_analyses ($cat) }; print "$cat:\n\t", join ("\n\t", @{ $factory->available_analyses ($cat) }), "\n"; } # create an analysis object use Bio::Tools::Run::AnalysisFactory; $service = Bio::Tools::Run::AnalysisFactory->new(); ->create_analysis ('edit.seqret'); $service->run ( #... )->results;
| BEGIN | Code | |
| new | Description | Code |
| _load_access_module | Description | Code |
| _guess_access | Description | Code |
| new | code | next | Top |
Usage : my $factory =It builds, populates and returns a new Bio::Tools::Run::AnalysisFactory object. This is how it is seen from the outside. But in fact, it builds, populates and returns a more specific lower-level object, for example Bio::Tools::Run::AnalysisFactory::soap object - which one it is it depends on the -access parameter. -access It indicates what lower-level module to load. Default is 'soap'.Other (but future) possibilities are: -access => 'novella' -location A location of the service. The contents is access-specific (seedetails in the lower-level implementation modules). Default is http://www.ebi.ac.uk/soaplab/services (there are services running at European Bioinformatics Institute on top of most of EMBOSS analyses, and on some others). -httpproxy In addition to the location parameter, you may need to specify alsoa location/URL of an HTTP proxy server (if your site requires one). The expected format is http://server:port. There is no default value. It is also an access-specific parameter which may not be used by all access methods. -timeout For long(er) running jobs the HTTP connection may be time-outed. Inorder to avoid it (or, vice-versa, to call timeout sooner) you may specify timeout with the number of seconds the connection will be kept alive. Zero means to keep it alive forever. The default value is two minutes. |
| _load_access_module | code | prev | next | Top |
Usage : $class->_load_access_module ($access)It does (in the run-time) a similar thing as require Bio::Tools::Run::AnalysisFactory::$accessIt prints an error on STDERR if it fails to find and load the module (for example, because of the compilation errors in the module). |
| _guess_access | code | prev | next | Top |
Usage : $class->_guess_access ($rh_params)It makes an expert guess what kind of access/transport protocol should be used to access the underlying analysis. The guess is based on the parameters in rh_params. Rememeber that this method is called only if there was no -access parameter which could tell directly what access method to use. |
| BEGIN | Top |
$Revision = q$$Id$;}
| new | description | prev | next | Top |
my ($caller,@args) = @_; my $class = ref($caller) || $caller; if ($class eq 'Bio::Tools::Run::AnalysisFactory') { # this is called only the first time when somebody calls: 'new}
# Bio::Tools::Run::AnalysisFactory (...)', and it actually loads a
# 'real-work-doing' module and call this new() method again
# (unless the loaded module has its own new() method)
my %param = @args; @param { map { lc $_ } keys %param } = values %param; # lowercase keys
my $access = $param {'-access'} || # use -access parameter
$class->_guess_access (\% param ) || # or guess from other parameters
'soap'; # or use a default access method
$access = "\L$access"; # normalize capitalization to lower case
# remember the access method (putting it into @args means that the
# object - when created - will remember it)
push (@args, (-access => $access)) unless $param {'-access'}; # load module with the real implementation - as defined in $access
return undef unless (&_load_access_module ($access)); # this calls this same method new() - but now its object part
# (see the upper branche above) is called
return "Bio::Tools::Run::AnalysisFactory::$access"->new (@args); } else { # if $caller is an object, or if it is an underlying
# 'real-work-doing' class (e.g. Bio::Tools::Run::AnalysisFactory::soap)
# then we want to call SUPER to create and bless a new object
my ($self) = $class->SUPER::new (@args); # now the $self is an empty object - we will populate it from
# the $caller - if $caller is an object (so we do cloning here)
if (ref ($caller)) { %{ $self } = %{ $caller }; } # and finally add values from '@args' into the newly created
# object (the values will overwrite the values copied above);
# this is done by calling '_initialize' of the 'real-work-doing'
# class (if there is no one there, there is always an empty one
# in Bio::Root::Root)
$self->_initialize (@args); return $self; } } # -----------------------------------------------------------------------------
| _load_access_module | description | prev | next | Top |
my ($access) = @_; my $load = "Bio/Tools/Run/AnalysisFactory/$access.pm"; eval { require $load; }; if ( $@ ) { Bio::Root::Root->throw (<<END); $load: $access cannot be found or loaded Exception $@ For more information about the Analysis system please see the Bio::Tools::Run::AnalysisFactory docs. END ; return; } return 1; } # -----------------------------------------------------------------------------}
| _guess_access | description | prev | next | Top |
my ($class, $rh_params) = @_; return undef; } # -----------------------------------------------------------------------------}
| FEEDBACK | Top |
| Mailing Lists | Top |
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
| Support | Top |
| Reporting Bugs | Top |
http://redmine.open-bio.org/projects/bioperl/
| AUTHOR | Top |
| COPYRIGHT | Top |
| DISCLAIMER | Top |
| SEE ALSO | Top |
| APPENDIX | Top |
| VERSION and Revision | Top |
Usage : print $Bio::Tools::Run::AnalysisFactory::VERSION;
print $Bio::Tools::Run::AnalysisFactory::Revision;