Bio::T...eBlast(3pm)
π Bio::Tools::Run::StandAloneBlast π
okay bestie, gather round, because this is the manual page for Bio::Tools::Run::StandAloneBlast (that's the 3pm one, perl module manual energy β¨) β and it's a whole thing, so let's get into it.
β¨ NAME β¨
Bio::Tools::Run::StandAloneBlast β it's the object that lets you run the NCBI BLAST program suite locally, on your own machine, like the main character you are π. Specifically it runs blastall, blastpgp, and bl2seq. There's also experimental support for WU-Blast and NCBI rpsblast, which is giving "we tried, it's cute, don't @ us" π¦.
β¨ SYNOPSIS β¨
Alright, here's the whole vibe in code. Copy-paste-able, no cap:
# 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.
β¨ DESCRIPTION β¨
so this DESCRIPTION is only ever about Bio::Tools::Run::StandAloneBlast, the Bioperl object that runs the NCBI standAlone BLAST package. Blast itself is a big and complex program β like, genuinely a lot β so for more info on BLAST, pls go read the BLAST documentation that ships with the BLAST distribution. BLAST lives at ftp://ncbi.nlm.nih.gov/blast/ π.
okay here's a source of confusion that we need to address, because documenting a BLAST interface is messy: the word "program" gets used in at least three different ways in the BLAST docs π. So in this DESCRIPTION, "program" means the BLAST routine set by the BLAST -p parameter, the one you can set to blastn, blastp, tblastx, etc. We'll say Blast "executable" when we mean the actual different executable files that might get called β i.e. blastall, blastpgp or bl2seq. And on top of all that, there are several BLAST capabilities that also get called "programs", which are implemented by using specific combinations of BLAST executables, programs and parameters. Those ones we'll call by their specific names β e.g. PSIBLAST and PHIBLAST. Words are hard, we cope π
.
Before you can run StandAloneBlast you gotta do a few things: install BLAST on your system, edit and set the environmental variable $BLASTDIR or your $PATH variable so it points at the BLAST directory, and make sure users have execute privileges for the BLAST program. Like, all three. Don't skip steps bestie π.
If the databases that BLAST is gonna search are located in the data subdirectory of the blast program directory (that's the default installation location), StandAloneBlast will find them on its own π«Ά. But if the database files are chilling anywhere else, you'll need to set the environmental variable $BLASTDATADIR to point to that directory.
The use of the StandAloneBlast module goes like this: first you create a local blast "factory object". The constructor can be passed an optional array of (non-default) parameters for the factory to use, like:
@params = (-program => 'blastn', -database => 'ecoli.nt');
$factory = Bio::Tools::Run::StandAloneBlast->new(@params);
Any parameter you don't explicitly set stays at the default of the BLAST executable. Heads up that each BLAST executable has somewhat different parameters and options β see the BLAST Documentation for a description, or run the BLAST executable from the command line followed solely with a - to see a list of options and default values for that executable; e.g.
>blastall -
BLAST parameters can be changed and/or examined at any time after the factory has been created. The program checks that any parameter/switch being set/read is valid β . Except where specifically noted, StandAloneBlast uses the same single-letter, case-sensitive parameter names as the actual blast program. Currently there are no checks included to verify that parameters are of the proper type (e.g. string or numeric) or that their values are within the proper range β so like, you're on your own for that, be normal about it π.
As an example, to change the value of the Blast parameter 'e' ('e' is the parameter for expectation-value cutoff):
$expectvalue = 0.01;
$factory->e($expectvalue);
ngl, for improved script readibility you can modify the name of the (ncbi) BLAST parameters however you want, as long as the initial letter (and case) of the parameter is preserved, e.g.:
$factory->expectvalue($expectvalue);
Unfortunately π some of the BLAST parameters are not the single letter you'd expect (eg "iteration round" in blastpgp is 'j'). Again you can check by using, for example:
> blastpgp -
Wublast parameters need to be complete (ie. don't truncate them to their first letter), but they are case-insensitive. okay periodt π .
Once the factory has been created and the appropriate parameters set, you can call one of the supported blast executables. The input sequence(s) to these executables may be fasta file(s) as described in the BLAST documentation.
$inputfilename = 't/testquery.fa';
$blast_report = $factory->blastall($inputfilename);
In addition, sequence input may be in the form of either a Bio::Seq object or (a reference to) an array of Bio::Seq objects, e.g.:
$input = Bio::Seq->new(-id => "test query",
-seq => "ACTACCCTTTAAATCAGTGGGGG");
$blast_report = $factory->blastall($input);
NOTE: Use of the BPlite method has been deprecated and is no longer supported. it's giving retired, bestie, don't use it π.
For blastall and non-psiblast blastpgp runs, the report object is a Bio::SearchIO object, selected by the user with the parameter _READMETHOD. The leading underscore is needed to distinguish this option from options which are passed to the BLAST executable. The default parser is Bio::SearchIO::blast. In any case, the "raw" blast report is also available β the filename is set by the 'outfile' parameter and has the default value of "blastreport.out" β.
For psiblast execution in the BLAST "jumpstart" mode, the program must be passed (in addition to the query sequence itself) an alignment containing the query sequence (in the form of a SimpleAlign object) as well as a "mask" specifying at what residues position-specific scoring matrices (PSSMs) are to used and at what residues default scoring matrices (eg BLOSUM) are to be used. See psiblast documentation for more details π. The mask itself is a string of 0's and 1's which is the same length as each sequence in the alignment and has a "1" at locations where (PSSMs) are to be used and a "0" at all other locations. So for example:
$str = Bio::AlignIO->new(-file => "cysprot.msf",
-format => 'msf');
$aln = $str->next_aln();
$len = $aln->length_aln();
$mask = '1' x $len;
# simple case where PSSM's to be used at all residues
$report = $factory->blastpgp("cysprot1.fa", $aln, $mask);
For bl2seq execution, StandAloneBlast.pm can be combined with AlignIO.pm to directly produce a SimpleAlign object from the alignment of the two sequences produced by bl2seq, as in:
# Get 2 sequences
$str = Bio::SeqIO->new(-file=>'t/amino.fa' , -format => 'Fasta');
my $seq3 = $str->next_seq();
my $seq4 = $str->next_seq();
# Run bl2seq on them
$factory = Bio::Tools::Run::StandAloneBlast->new(-program => 'blastp',
-outfile => 'bl2seq.out');
my $bl2seq_report = $factory->bl2seq($seq3, $seq4);
# Use AlignIO.pm to create a SimpleAlign object from the bl2seq report
$str = Bio::AlignIO->new(-file=> 'bl2seq.out',-format => 'bl2seq');
$aln = $str->next_aln();
For more examples of syntax and use of StandAloneBlast.pm, the user is encouraged to run the scripts standaloneblast.pl in the bioperl examples/tools directory and StandAloneBlast.t in the bioperl t/ directory π.
β¨ 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 one of the Bioperl mailing lists. Your participation is much appreciated π«Ά.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
πΈ Support
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible β the more context you give, the faster someone can help you out, fr fr π₯.
π Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
β¨ AUTHOR - Peter Schattner β¨
Email schattner at alum.mit.edu
β¨ MAINTAINER - Torsten Seemann β¨
Email torsten at infotech.monash.edu.au
β¨ CONTRIBUTORS β¨
- Sendu Bala
bix@sendu.me.uk(reimplementation)
β¨ APPENDIX β¨
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _.
𧬠new
Title: new
Usage:
my $obj = Bio::Tools::Run::StandAloneBlast->new();
Function: Builds a new Bio::Tools::Run::StandAloneBlast object.
Returns: Bio::Tools::Run::StandAloneNCBIBlast or StandAloneWUBlast.
Args:
-quiet => boolean # make program execution quiet
-_READMETHOD => 'BLAST' (default, synonym 'SearchIO') || 'blast_pull'
# the parsing method, case insensitive
Essentially all BLAST parameters can be set via StandAloneBlast.pm. Some of the most commonly used parameters are listed below. All parameters have defaults and are optional except for -p in those programs that have it. For a complete listing of settable parameters, run the relevant executable BLAST program with the option - as in blastall -. Note that the input parameters (-i, -j, -input) should not be set directly by you: this module sets them when you call one of the executable methods.
Blastall
-pβ Program Name [String]. Input should be one of"blastp","blastn","blastx","tblastn", or"tblastx".-dβ Database [String] default =nr. The database specified must first be formatted withformatdb. Multiple database names (bracketed by quotations) will be accepted. An example would be-d "nr est".-eβ Expectation value (E) [Real] default =10.0.-oβ BLAST report Output File [File Out] Optional, default =./blastreport.out; set byStandAloneBlast.pm.-Sβ Query strands to search against database (forblast[nx], andtblastx).3is both,1is top,2is bottom [Integer] default =3.
Blastpgp (including Psiblast)
-jβ is the maximum number of rounds (default1; i.e., regular BLAST)-hβ is the e-value threshold for including sequences in the score matrix model (default0.001)-cβ is the "constant" used in the pseudocount formula specified in the paper (default10)-Bβ Multiple alignment file for PSI-BLAST "jump start mode" Optional-Qβ Output File for PSI-BLAST Matrix in ASCII [File Out] Optional
rpsblast
-dβ Database [String] default = (none - you must specify a database). The database specified must first be formatted withformatdb. Multiple database names (bracketed by quotations) will be accepted. An example would be-d "Cog Smart".-eβ Expectation value (E) [Real] default =10.0.-oβ BLAST report Output File [File Out] Optional, default =./blastreport.out; set byStandAloneBlast.pm.
Bl2seq
-pβ Program name:blastp,blastn,blastx. Forblastx1st argument should be nucleotide [String] default =blastp.-oβ alignment output file [File Out] default =stdout.-eβ Expectation value (E) [Real] default =10.0.-Sβ Query strands to search against database (blastnonly).3is both,1is top,2is bottom [Integer] default =3.
WU-Blast
-pβ Program Name [String]. Input should be one of"wublastp","wublastn","wublastx","wutblastn", or"wutblastx".-dβ Database [String] default =nr. The database specified must first be formatted withxdformat.-Eβ Expectation value (E) [Real] default =10.0.-oβ BLAST report Output File [File Out] Optional, default =./blastreport.out; set byStandAloneBlast.pm.
π executable
Title: executable
Usage:
my $exe = $blastfactory->executable('blastall');
Function: Finds the full path to the executable.
Returns: string representing the full path to the exe.
Args:
- [optional] name of executable to set path to
- [optional] boolean flag whether or not warn when exe is not found
π program_dir
Title: program_dir
Usage:
my $dir = $factory->program_dir();
Function: Abstract get method for dir of program.
Returns: string representing program directory.
Args: none.
π _setinput
Title: _setinput
Usage: Internal function, not to be called directly.
Function: Create input file(s) for Blast executable.
Example: (none given β the void is the vibe π)
Returns: name of file containing Blast data input.
Args: Seq object reference or input file name.
πΈ Bio::Tools::Run::WrapperBase methods πΈ
π‘οΈ no_param_checks
Title: no_param_checks
Usage:
$obj->no_param_checks($newval)
Function: Boolean flag as to whether or not we should trust the sanity checks for parameter values.
Returns: value of no_param_checks.
Args: newvalue (optional).
πΎ save_tempfiles
Title: save_tempfiles
Usage:
$obj->save_tempfiles($newval)
Function: (no description in the original β iconic minimalism π )
Returns: value of save_tempfiles.
Args: newvalue (optional).
π outfile_name
Title: outfile_name
Usage:
my $outfile = $tcoffee->outfile_name();
Function: Get/Set the name of the output file for this run (if you wanted to do something special).
Returns: string.
Args: [optional] string to set value to.
π tempdir
Title: tempdir
Usage:
my $tmpdir = $self->tempdir();
Function: Retrieve a temporary directory name (which is created).
Returns: string which is the name of the temporary directory.
Args: none.
π§Ή cleanup
Title: cleanup
Usage:
$tcoffee->cleanup();
Function: Will cleanup the tempdir directory after a PAML run.
Returns: none.
Args: none.
πͺ io
Title: io
Usage:
$obj->io($newval)
Function: Gets a Bio::Root::IO object.
Returns: Bio::Root::IO.
Args: none.
And that's the whole page, bestie! This was generated with perl v5.36.0 on 2023-01-22 for Bio::T...eBlast(3pm). Stay slay, stay blasted (in the bioinformatics way), and may your e-values always be tiny. πβ¨π§¬
π¦ where this page comes from
- debian bookworm: libbio-perl-run-perl 1.7.3-9 Β· Perl
- ubuntu noble: libbio-perl-run-perl 1.7.3-9 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms