Help In Standaloneblast Bioperl
1
0
Entering edit mode
11.1 years ago

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 • 3.5k views
ADD COMMENT
1
Entering edit mode
11.1 years ago
Fwip ▴ 500

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

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 1806 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6