[ create a new paste ] login | about

Link: http://codepad.org/QfnUhlXX    [ raw code | output | fork ]

Perl, pasted on Nov 11:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict;
use Bio::SearchIO; 
my $in = new Bio::SearchIO(-format => 'blast', 
                           -file   => 'report.bls');
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->id,
            "Hit= ",        $hit->name,
            "Length= ",     $hsp->length('total'),
            "Percent_id= ", $hsp->percent_identity, "\n";
     }
    }
   }  
  }
}


Output:
1
2
Can't locate Bio/SearchIO.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i486-linux /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i486-linux /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at line 2.
BEGIN failed--compilation aborted at line 2.


Create a new paste based on this one


Comments: