[Bioperl-l] Output of a BLAST parse to text file

T.Hori tiago.hori at gmail.com
Sun Apr 10 22:56:43 UTC 2011


Hi Guys,

I am really new to BioPerl, so this may be a stuoid question. Let's
say I use the example from the BioPerl.org:

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->query_name,
            " Hit=",        $hit->name,
            " Length=",     $hsp->length('total'),
            " Percent_id=", $hsp->percent_identity, "\n";
        }
      }
    }
  }
}

That gives me several hits as results on the standard output. I am
starting to learn BioPerl for what I think is a dauting task. I have a
colletion of 20K ESTs and I have to find the best Human hit for
everyone of those sequences. So I am starting by learning how to parse
BLAST results. I was wondering how I would go about having the output
of the parse go to tab-delimeted text file instead of the standard
output.

Any help would be greatly appreciated.

Thanks,

Tiago



More information about the Bioperl-l mailing list