[Bioperl-l] Runnig bl2seq throws error + Failure to parse BlastResult

Smithies, Russell Russell.Smithies at agresearch.co.nz
Tue Jun 28 21:03:17 UTC 2011


Did you try printing the result with Data::Dumper to see what's in it?

use Data::Dumper;

if($result = $fac->next_result){
  print Dumper $result;
  .
  .
  .
  .

--Russell

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of Das, Abhiram
> Sent: Wednesday, 29 June 2011 8:27 a.m.
> To: bioperl-l at bioperl.org
> Subject: [Bioperl-l] Runnig bl2seq throws error + Failure to parse
> BlastResult
> 
> 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
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================




More information about the Bioperl-l mailing list