[Bioperl-l] Search::IO example from HOWTO

Tiago Hori tiago.hori at gmail.com
Tue Feb 5 15:33:32 UTC 2013


Hi All,

I am trying to run tha example from the Search::IO how to use strict;
use Bio::SearchIO;

my $in = new Bio::SearchIO(-format => 'blast'
               -file => 'test.txt');

while( my $result = $in->next_result ) {
  ## $result is a Bio::Search::Result::ResultI compliant object
  while( my $hit = $result->next_hit ) {
    ## $hit is a Bio::Search::Hit::HitI compliant object
    while( my $hsp = $hit->next_hsp ) {
      ## $hsp is a Bio::Search::HSP::HSPI compliant object
      if( $hsp->length('total') > 50 ) {
        if ( $hsp->percent_identity >= 75 ) {
          print "Query=",   $result->query_name,
            " Hit=",        $hit->name,
            " Length=",     $hsp->length('total'),
            " Percent_id=", $hsp->percent_identity, "\n";
        }
      }
    }  
  }
}

And I get this error:Odd number of elements in hash assignment at 
/usr/local/share/perl/5.14.2/Bio/SearchIO.pm line 189.

Can anybody help!

Cheers,

T.






More information about the Bioperl-l mailing list