Bio::Tools::Run::PiseApplication.3pm

Langue: en

Autres versions - même langue

Version: 2008-11-10 (debian - 07/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

Bio::Tools::Run::PiseApplication - A class manage Pise programs information, configuring parameters and submit jobs.

SYNOPSIS

   use Bio::Tools::Run::AnalysisFactory::Pise;
 
   # Build a Pise factory       
   my $factory = new Bio::Tools::Run::AnalysisFactory::Pise();
 
   # 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

A class to manage Pise programs information, configuring parameters and submit jobs. It is the super-class of all the Bio::Tools::Run::PiseApplication::program classes.

This class is preferably created through the Bio::Tools::Run::AnalysisFactory::Pise factory:

   my $factory = Bio::Tools::Run::AnalysisFactory::Pise->new();
   my $program = $factory->program('mfold');
 
 

By submitting a job, you create a Bio::Tools::Run::PiseJob instance with the parameters you have just set. Bio::Tools::Run::PiseJob class handles a specific job state and results.

   my $factory = Bio::Tools::Run::AnalysisFactory::Pise->new(
                                           -email => 'me@myhome');
   my $program = $factory->program('water', 
                                     -sequencea => $seqa,
                                     -seqall => $seqb);
 
   # run: submit and waits for completion
   my $job = $program->run();
 
   # for long jobs
   my $job = $program->submit(); # only submit the request
   my $jobid = $job->jobid;
   # later, from another script
   my $job = Bio::Tools::Run::PiseJob->fromUrl($jobid);
   if ($job->terminated) {
       print $job->stdout;
   }
 
 

Pise parameters setting.

The @params list should contain a list of -parameter => value pairs.
   my @params = (-query => $file, -protein_db => "genpept");
   my $program = $factory->program('blast2', @params);
 
 

or directly :

   my $program = $factory->program('blast2', query => $file, protein_db => "genpept");
 
 

Each program parameter is described in the documentation of the corresponding Bio::Tools::Run::PiseApplication::program documentation.

You can change parameters at any time by calling the corresponding method, e.g, changing the parameter E in blast2:

   my $program = $factory->program('blast2', -protein_db => "genpept");
   $program->query($seq);
   $program->Expect($value);
 
 

Parameter of Pise type ``Sequence'' and ``InFile'' may be given as string, filename, or filehandle. Parameter of type ``Sequence'' may also be given as Bio::Seq or Bio::SimpleAlign objects.

Job output

See Bio::Tools::Run::PiseJob for how to fetch results and chain programs.

Location and email parameters

Email can be set at factory creation.

The location parameter stands for the actual CGI location. 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');
   $program->run();
 
 
4 when running:
   $job = $program->run(-location => 'http://somewhere/Pise/cgi-bin/water.pl');
 
 

FEEDBACK

Mailing Lists

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 Bugs

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/
 
 

AUTHOR

Catherine Letondal (letondal@pasteur.fr) 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.

DISCLAIMER

This software is provided ``as is'' without warranty of any kind.

SEE ALSO

Bio::Tools::Run::AnalysisFactory::Pise Bio::Tools::Run::PiseJob

new

  Title   : new()
  Usage   : my $program = Bio::Tools::Run::PiseApplication->new($location, 
                                                                $email);
  Function: Creates a Bio::Tools::Run::PiseApplication::program object, 
            where program stands for any 
            of the Pise programs.
            This method should not be used directly, but rather by 
            a Bio::Tools::Run::AnalysisFactory::Pise instance.
  Example :
  Returns : An instance of Bio::Tools::Run::PiseApplication::program.
 
 

location

  Title   : location
  Usage   : my $location = $program->location;
  Function: Called from Bio::Tools::Run::PiseJob to get/set program/Pise 
            configuration informations from the 
            Bio::Tools::Run::PiseApplication::program class.
  Example :
  Returns : A string containing the url of the Pise server CGI.
 
 

email

  Title   : email()
  Usage   : my $email = $program->email();
  Function: Called from Bio::Tools::Run::PiseJob to get/set program/Pise 
            configuration informations from the 
            Bio::Tools::Run::PiseApplication::program class.
  Example :
  Returns : A string containing the user email for submissions.
 
 

verbose

  Title   : verbose()
  Usage   : $program->verbose(1);
  Function: Ask the object to tells more.
  Example :
  Returns : Actual value.
 
 

param_type

  Title   : param_type()
  Usage   : my $type = $program->param_type($param);
  Function: Tells the Pise parameter type of $param (e.g: Sequence, 
            String, Excl, ...).
  Example :
  Returns : A string containing the Pise parameter type.
 
 

run

  Title   : run()
  Usage   : $program->run();
            $program->run(10);
  Function: Submit the job and waits for completion. You may provide an
            interval for completion checking.
  Example :
  Returns : The instance of Bio::Tools::Run::Pisejob that has been run.
 
 

submit

  Title   : submit()
  Usage   : $program->submit();
  Function: Submit the job.
  Example :
  Returns : The instance of Bio::Tools::Run::Pisejob that has been run.
 
 

results_type

  Title   : results_type()
  Usage   : $program->results_type($type);
  Function: Enables to change result delivery from one email per file
            to url notification or attached files. $type is either: url, 
            attachment, email. This information will be provided to the job
            when detached and submitted through the run method.
  Example :
  Returns :
 
 

paraminfo

  Title   : paraminfo()
  Usage   : $program->paraminfo();
  Function: Displays parameters and prompts.
  Example :
  Returns :
 
 

_init_params

  Title   : _init_params
  Usage   : $self->_init_params(@params);
  Function: Internal. To be called from Pise::program::new method after
            all the data structures have been initialized.
  Example :
  Returns :
 
 

_OK_FIELD

  Title   : _OK_FIELD()
  Usage   : if ($self->_OK_FIELD($param)) ...
  Function: Checks if $param is a known parameter for the specific program.
  Example :
  Returns : TRUE/FALSE