Entering edit mode
13.4 years ago
Abhi
▴
50
Getting BlastResult from bl2seq is throwing following message:
Use of uninitialized value in numeric le (<=) at /Library/Perl/5.8.8/Bio/SearchIO/IteratedSearchResultEventBuilder.pm line 315, <GEN6> line 26.
Here is the code:
use strict;
use Bio::Seq;
use Bio::SeqIO;
use Bio::DB::GenBank;
use Bio::Tools::Run::StandAloneBlastPlus;
use Bio::Search::Result::BlastResult;
use Bio::Search::Hit::HitI;
my $fac = Bio::Tools::Run::StandAloneBlastPlus->new();
my $seq_obj = Bio::SeqIO->new(-file => "all_reads.fasta", -format => "fasta", -alphabet => "dna");
my @seq_list;
while(my $seq = $seq_obj->next_seq()){
push(@seq_list, $seq);
}
my $match = 0;
for(my $i = 0; $i < @seq_list; $i++){
for(my $j = $i+1; $j < @seq_list; $j++){
my $result = $fac->bl2seq(-method=>'blastn', -query => $seq_list[$j], -subject => $seq_list[$i], -outfile=>'test.out');
$fac->rewind_results;
if($result = $fac->next_result){
print "# hits found:: ", $result->num_hits,"\n";
if(my $hit = $result->next_hit){
$match++;
}
}
}
}
$fac->cleanup();
My question is how to get rid of the message. Also even though the output file shows no hit's, the BlastResult object get's the number of hit's as 1.
Appreciate any help on running bl2seq on Blastplus.
Thanks -Abhi