[Bioperl-l] [StandAloneBLAST] Use more than one CPU + avoid BLAST reload
Jason Stajich
jason at bioperl.org
Tue Dec 4 18:51:34 UTC 2007
You can pass in an array reference of sequences instead of a single sequence
object and the module will build a multi-FASTA database. You can also pass
in a filename instead of a Sequence object and the file can be an already
built multi-FASTA database. This is described in the documentation:
http://search.cpan.org/~birney/bioperl-1.4/Bio/Tools/Run/StandAloneBlast.pm#blastall
You can also just run BLAST without StandAloneBlast part as I do an just
build your multifile ahead of time with SeqIO and do
# wublast
my $cmd = "blastp -i MULTIFASTA -d DATABASE --cpus 2 |";
# or NCBI blast
# my $cmd = "blastall -a 2 -i MULTIFASTA -p blastp -d DATABASE |";
my $fh;
open($fh, $cmd)
my $searchio = Bio::SearchIO->new(-format => 'blast', -fh => $fh);
The advantage of StandAloneBlast in theory is it takes care of the temporary
file creation (sequncefiles) and cleanup. Personally I find I want easier
access to my programs that are simple cmdline like this. You can do similar
things withe SSEARCH or FASTA searching too.
-jason
On Dec 3, 2007 4:05 PM, Sendu Bala <bix at sendu.me.uk> wrote:
> Sven Boekhoff wrote:
> > HI!
> > I just started working with Perl and BioPerl. I'm quite impressed what
> > can be easily done with this module. Today I found that my second CPU
> > ist not used, but the first one run's at 100%. I tried to include the
> > "-a"-parameter, but I was not successful:
> >
> > my @params = (
> > -database => 'my_db',
> > -a => '2',
> > -outfile => 'blast1.out'
> > );
> >
> > How do I have to use it?
>
> This should work in the CVS version of StandAloneBlast. In other
> versions, perhaps try using $object->a(2);
>
>
> > Second question: In my perlscript I start BLAST-searches in a loop.
> > Everytime BLAST has finished its search, the memory is cleared and BLAST
> > is started again. I think most of the time is used to reload the
> > database. Is it somehow possible to keep the database loaded (e.g. by
> > starting a second search) or is BLAST reloaded anyway?
>
> I hope someone will correct me for being wrong, but I think you'd have
> to that with a 2-way pipe. StandAloneBlast only uses output to a file
> and input from that file, finishing with the executable inbetween. I've
> thought about improving it with a 2-way pipe, but never got around to
> it, being apprehensive about stability on all platforms.
>
> The more obvious solution, which may be possible depending on exactly
> what you're doing, is to avoid the loop and just supply Blast all your
> input in one go.
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
--
Jason Stajich
jason at bioperl.org
http://bioperl.org/wiki/User:Jason
More information about the Bioperl-l
mailing list