[Bioperl-l] Runnig bl2seq throws error + Failure to parse BlastResult
Jason Stajich
jason.stajich at gmail.com
Tue Jun 28 21:02:39 UTC 2011
I'm sorry but I don't understand your question, are you worried that the num_hits is 1 simply? I think this is a function of a forced result from bl2seq -- can you better explain what you are trying to do or provide your sequence file so the issue you are concerned with can be replicated.
Are you trying to construct an all-vs-all pairwise distances based on bl2seq?
On Jun 28, 2011, at 1:26 PM, Das, Abhiram wrote:
> 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
More information about the Bioperl-l
mailing list