BioPerl-Run

 view release on metacpan or  search on metacpan

lib/Bio/Tools/Run/StandAloneBlast.pm  view on Meta::CPAN

#
# BioPerl module for Bio::Tools::Run::StandAloneBlast
#
# Copyright Peter Schattner
#
# You may distribute this module under the same terms as perl itself

# POD documentation - main docs before the code

=head1 NAME

Bio::Tools::Run::StandAloneBlast - Object for the local execution 
of the NCBI BLAST program suite (blastall, blastpgp, bl2seq). 
There is experimental support for WU-Blast and NCBI rpsblast.

=head1 SYNOPSIS

 # Local-blast "factory object" creation and blast-parameter
 # initialization:
 @params = (-database => 'swissprot', -outfile => 'blast1.out');
 $factory = Bio::Tools::Run::StandAloneBlast->new(@params);

 # Blast a sequence against a database:
 $str = Bio::SeqIO->new(-file=>'t/amino.fa', -format => 'Fasta');
 $input = $str->next_seq();
 $input2 = $str->next_seq();
 $blast_report = $factory->blastall($input);

 # Run an iterated Blast (psiblast) of a sequence against a database:
 $factory->j(3);    # 'j' is blast parameter for # of iterations
 $factory->outfile('psiblast1.out');
 $factory = Bio::Tools::Run::StandAloneBlast->new(@params);
 $blast_report = $factory->blastpgp($input);

 # Use blast to align 2 sequences against each other:
 $factory = Bio::Tools::Run::StandAloneBlast->new(-outfile => 'bl2seq.out');
 $factory->bl2seq($input, $input2);

 # Experimental support for WU-Blast 2.0
 my $factory = Bio::Tools::Run::StandAloneBlast->new(-program =>"wublastp",
                                                     -database =>"swissprot",
                                                     -e => 1e-20); 
 my $blast_report = $factory->wublast($seq);

 # Experimental support for NCBI rpsblast
 my $factory = Bio::Tools::Run::StandAloneBlast->new(-db => 'CDD/Cog', 
                                                     -expect => 0.001);
 $factory->F('T'); # turn on SEG filtering of query sequence
 my $blast_report = $factory->rpsblast($seq);

 # Use the experimental fast Blast parser, 'blast_pull'
 my $factory = Bio::Tools::Run::StandAloneBlast->new(-_READMETHOD =>'blast_pull',
                                                     @other_params);

 # Various additional options and input formats are available,
 # see the DESCRIPTION section for details.

=head1 DESCRIPTION

This DESCRIPTION only documents Bio::Tools::Run::StandAloneBlast, a
Bioperl object for running the NCBI standAlone BLAST package. Blast
itself is a large & complex program - for more information regarding
BLAST, please see the BLAST documentation which accompanies the BLAST
distribution. BLAST is available from ftp://ncbi.nlm.nih.gov/blast/.

A source of confusion in documenting a BLAST interface is that the
term "program" is used in - at least - three different ways in the
BLAST documentation. In this DESCRIPTION, "program" will refer to the
BLAST routine set by the BLAST C<-p> parameter that can be set to blastn,
blastp, tblastx etc. We will use the term Blast "executable" to refer
to the various different executable files that may be called - ie.
blastall, blastpgp or bl2seq. In addition, there are several BLAST
capabilities, which are also referred to as "programs", and are
implemented by using specific combinations of BLAST executables,
programs and parameters. They will be referred by their specific
names - eg PSIBLAST and PHIBLAST.

Before running StandAloneBlast it is necessary: to install BLAST 
on your system, to edit set the environmental variable $BLASTDIR 
or your $PATH variable to point to the BLAST directory, and to 
ensure that users have execute privileges for the BLAST program.  

If the databases which will be searched by BLAST are located in the 
data subdirectory of the blast program directory (the default 
installation location), StandAloneBlast will find them; however, 
if the database files are located in any other location, environmental 
variable $BLASTDATADIR will need to be set to point to that directory.

The use of the StandAloneBlast module is as follows: Initially, a
local blast "factory object" is created. The constructor may be passed



( run in 0.588 second using v1.01-cache-2.11-cpan-71847e10f99 )