[Bioperl-l] Runnig bl2seq throws error + Failure to parse BlastResult
Das, Abhiram
abhiram.das at gatech.edu
Tue Jun 28 20:26:53 UTC 2011
Hi,
Running the following code throws the message:
"Use of uninitialized value in numeric le (<=) at /Library/Perl/5.8.8/Bio/SearchIO/IteratedSearchResultEventBuilder.pm line 315, <GEN6> line 26."
Even though the output file shows no hit's, the BlastResult->num_hits returns 1.
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");
#loop through each seq in the seq-obj and blast it with the next sequence
my @seq_list;
while(my $seq = $seq_obj->next_seq()){
push(@seq_list, $seq);
}
my $eval = 0.000001;
my $word = 16;
my $match = 0;
no strict;
for(my $i = 0; $i < @seq_list; $i++){
for(my $j = $i+1; $j < @seq_list; $j++){
$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();
Appreciate any help.
Thanks
-Abhi
More information about the Bioperl-l
mailing list