Bio::Tools::Run::AnalysisFactory Pise
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvs
Summary
Bio::Tools::Run::AnalysisFactory::Pise - A class to create Pise
application objects.
Package variables
No package variables defined.
Included modules
Bio::Factory::ApplicationFactoryI
Bio::Root::Root
Bio::Tools::Run::PiseApplication
Bio::Tools::Run::PiseJob
Inherit
Bio::Factory::ApplicationFactoryI Bio::Root::Root
Synopsis
  use Bio::Tools::Run::AnalysisFactory::Pise;
# Build a Pise factory my $factory = Bio::Tools::Run::AnalysisFactory::Pise->new(); # Then create an application object (Pise::Run::Tools::PiseApplication): my $program = $factory->program('genscan'); # Set parameters $program->seq($ARGV[0]); # Next, run the program # (notice that you can set some parameters at run time) my $job = $program->run(-parameter_file => "Arabidopsis.smat"); # Test for submission errors: if ($job->error) { print "Job submission error (",$job->jobid,"):\n"; print $job->error_message,"\n"; exit; } # Get results print STDERR $job->content('genscan.out'); # or: my $result_file = $job->save('genscan.out');
Description
Bio::Tools::Run::AnalysisFactory::Pise is a class to create Pise
application objects, that let you submit jobs on a Pise server.
  my $factory = Bio::Tools::Run::AnalysisFactory::Pise->new(
-email => 'me@myhome');
The email is optional (there is default one). It can be useful,
though. Your program might enter infinite loops, or just run many
jobs: the Pise server maintainer needs a contact (s/he could of course
cancel any requests from your address...). And if you plan to run a
lot of heavy jobs, or to do a course with many students, please ask
the maintainer before.
The location parameter stands for the actual CGI location, except when
set at the factory creation step, where it is rather the root of all
CGI. There are default values for most of Pise programs.
You can either set location at:
   1 factory creation:
   
my $factory = Bio::Tools::Run::AnalysisFactory::Pise->new(
-location => 'http://somewhere/Pise/cgi-bin',
-email => 'me@myhome');

   2 program creation:
   
my $program = $factory->program('water',
-location => 'http://somewhere/Pise/cgi-bin/water.pl'
);

   3 any time before running:
   
$program->location('http://somewhere/Pise/cgi-bin/water.pl');
$job = $program->run();

   4 when running:
   
$job = $program->run(-location => 'http://somewhere/Pise/cgi-bin/water.pl');

You can also retrieve a previous job results by providing its url:
  $job = $factory->job($url);
You get the url of a job by:
  $job->jobid;
Methods
newDescriptionCode
programDescriptionCode
jobDescriptionCode
Methods description
newcode    nextTop
 Title   : new()
Usage : my $program = Bio::Tools::Run::AnalysisFactory::Pise->new(
-location => 'http://somewhere/cgi-bin/Pise',
-email => $email);
Function: Creates a Bio::Tools::Run::AnalysisFactory::Pise object, which
function is to create interface object
(Bio::Tools::Run::PiseApplication::program) for programs.
Example :
Returns : An instance of Bio::Tools::Run::AnalysisFactory::Pise.
program()codeprevnextTop
 Title   : program()
Usage : my $program = Bio::Tools::Run::AnalysisFactory::Pise->program(
$program,
-location => 'http://somewhere/cgi-bin/Pise',
-email => $email,
@params);
Function: Creates a representation of a single Pise program.
Example :
Returns : An instance of Bio::Tools::Run::PiseApplication::$program.
jobcodeprevnextTop
 Title   : job(url)
Usage : my $job = Bio::Tools::Run::AnalysisFactory::Pise->job(
'http://somewhere/cgi-bin/Pise/tmp/dnapars/A3459687595869098');
Function: Creates a previously run job by providing its jobid (url of
results).
Example :
Returns : An instance of Bio::Tools::Run::PiseJob.
Methods code
newdescriptionprevnextTop
sub new {
    my ($class,@args) = @_;
    my $self = $class->SUPER::new(@args);
    my ($location) =
	$self->_rearrange([qw(LOCATION )],
			  @args);
    my ($email) =
	$self->_rearrange([qw(EMAIL )],
			@args);
    
    my ($verbose) =
	$self->_rearrange([qw(VERBOSE )],
			  @args);
    
    if (defined $location) {
	$self->{LOCATION} = $location;
    }

    if (defined $email) {
	$self->{EMAIL} = $email;
    } else {
	$self->{EMAIL} = 'pise-bioapi@pasteur.fr';
    }
    if (defined $verbose) {
	$self->{VERBOSE} = $verbose;
    } else {
	$self->{VERBOSE} = 0;
    }
    return $self;
}
programdescriptionprevnextTop
sub program {
    my ($self, $program, @args) = @_;

    my ($location) =
      $self->_rearrange([qw(LOCATION )],
			@args);
    my ($email) =
	$self->_rearrange([qw(EMAIL )],
			  @args);

    my ($verbose) =
	$self->_rearrange([qw(VERBOSE )],
			  @args);
    if (! $location) {
	if (defined $self->{LOCATION}) {
	    if ($self->{LOCATION} =~ /$program/) {
		$location = $self->{LOCATION};
	    } else {
		$location = $self->{LOCATION} . "/$program.pl";
	    }
	} else {
	    if (defined $LOCATION{$program}) {
		$location = $LOCATION{$program};
	    } else {
		$location = $LOCATION{'default'} . "/$program.pl";
	    }
	}
    }
    if (! $email) {
	$email = $self->{EMAIL};
    }
    if (! $verbose) {
	$verbose= $self->{VERBOSE};
    }

    no strict "subs";

    my $package = "Bio::Tools::Run::PiseApplication::$program";  
    my $pise_program;

    eval ("use $package");
    $self->throw("Problem to load Bio::Tools::Run::PiseApplication::${program}\n\n$@")
	if $@;

    eval($pise_program = $package->new($location, $email) );
    use strict "subs";

    foreach my $param ($pise_program->parameters_order) {
	my $param_name = $param;
	$param_name =~ tr/a-z/A-Z/;
	#print STDERR "setting $param_name ...?\n";
my ($value) = $self->_rearrange([$param_name], @args); if ($value) { #print STDERR "setting $param to $value\n";
$pise_program->$param($value); } } #print STDERR "creation of $pise_program ", ref($pise_program), "\n";
return $pise_program;
}
jobdescriptionprevnextTop
sub job {
    my ($self, $jobid) = @_;
    my $job = Bio::Tools::Run::PiseJob->job($jobid);
    return $job;
}

1;
}
General documentation
FEEDBACKTop
Mailing ListsTop
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to
the Bioperl mailing list. Your participation is much appreciated.
  bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Reporting BugsTop
Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via the
web:
  http://bugzilla.open-bio.org/
AUTHORTop
Catherine Letondal (letondal@pasteur.fr)
COPYRIGHTTop
Copyright (C) 2003 Institut Pasteur & Catherine Letondal.
All Rights Reserved.
This module is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
DISCLAIMERTop
This software is provided "as is" without warranty of any kind.
SEE ALSOTop
Bio::Tools::Run::PiseApplication
Bio::Tools::Run::PiseJob