[Bioperl-l] BLAST in Bioperl - Can't call method "next_result"
Casandra
crrcri at ibmb.csic.es
Fri Feb 24 15:40:48 UTC 2012
Hi, I am installing BLAST to use it into BioPerl but I'm having some
problems and I can't find how to fix them:
I follow the steps in here: http://www.ncbi.nlm.nih.gov/books/NBK52640/
(at least I think I did it right) for mac.
and I downloaded swissprot.gz db to try with the following script:
#!/bin/perl -w
use Bio::Seq;
use Bio::SearchIO;
use Bio::Tools::Run::StandAloneBlast;
$blast_obj = Bio::Tools::Run::StandAloneBlast->new(-program =>
'blastp', -database => '~/scripts/ncbi-blast-2.2.25+/db/swissprot.fa');
$seq_obj = Bio::Seq->new(-id =>"test query", -seq =>"MMSMLGGL");
$report_obj = $blast_obj->blastall($seq_obj);
$result_obj = $report_obj->next_result;
print $result_obj->num_hits;
That I wrote based on http://www.bioperl.org/wiki/HOWTO:Beginners
BLAST section.
But I'm not sure if this step that they say " The example code assumes
that you used the formatdb program to index the database sequence file
"db.fa"" I did it properly. I just downloaded the swissprot db, keep
it into /db directory and adapt the script to this. I haven't used
this "formatdb" so I don't know if this script is not updated or if it
should run anyway.
This is what I get:
Mercuri:BioPerl Casandra$ perl bp_blast.pl
--------------------- WARNING ---------------------
MSG: No whitespace allowed in FASTA ID [test query]
---------------------------------------------------
--------------------- WARNING ---------------------
MSG: No whitespace allowed in FASTA ID [test query]
---------------------------------------------------
Use of uninitialized value in join or string at /Library/Perl/Updates/
5.8.8/darwin-thread-multi-2level/File/Spec/Unix.pm line 86.
--------------------- WARNING ---------------------
MSG: cannot find path to blastall
---------------------------------------------------
Can't call method "next_result" on an undefined value at bp_blast.pl
line 13.
Just for curiosity, when I change
$report_obj = $blast_obj->blastall($seq_obj);
to
$report_obj = $blast_obj->blast($seq_obj);
I get this message instead:
Mercuri:BioPerl Casandra$ perl bp_blast.pl
Can't locate object method "next_result" via package "Bio::Seq" at
bp_blast.pl line 13.
Thanks a lot
More information about the Bioperl-l
mailing list