This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Help In Standaloneblast Bioperl

Hi, I am new to bioperl. I have been trying to run blast, I get my blast output, I am not sure, how to use $factory in bioperl

I have blast installed and has been added to my PATH variable.

use Bio::SeqIO
use Bio::Tools::Run::StandAloneBlast

@params=(-p=>'blastn',-d=>'swissprot',-o=>'output');
my $in = Bio::SeqIO->new(-format=>'fasta',-file=>$fasta,);
`makeblastdb -in $fasta -dbtype 'nucl' -out $fasta`;
@params = (program  => 'blastn', database => $fasta);
my $factory=Bio::Tools::Run::StandAloneBlast->new(@params);
my $result = $factory->(`blastn -query $fasta -db $fasta -out 'query_vs'` );

I do get file.

I am not sure, if I am doing it correctly or not. Definitely doing wrong, as I am getting below error:

Not a CODE reference at ./bio.pl line 56, <GEN0> line 38.

Running on command line was different but doing blast from Bio Perl is not at all getting into my head.

I have browsed few examples, Standalone Blast 2 Short Sequences on biostars, but looks like I have been missing key concept.

If I do not use $factory and run the command on backticks, it is the same on commant line, what difference does factory make?

Any guidance shall be highly appreciated.

OS: Ubuntu 12.04

IDE: Komodo

bioperl blast

1 answer

The last line is running the blast program on the command line, then passing the result to a function that doesn't exist. This is definitely not how you use it.

Check the documentation here: http://search.cpan.org/~cjfields/BioPerl-1.6.1/Bio/Tools/Run/StandAloneBlast.pm or here for StandAloneBlastPlus (my preference): http://www.bioperl.org/wiki/HOWTO:BlastPlus

@Fwip Thank you pointing out the error. I got it worked with standAloneBlastPlus module.

Glad you got it working! I was hoping to write out a more detailed guide, but was pressed for time.

Log in to answer this question.