[Bioperl-l] parsing blastx reports w/ SearchIO & SearchIO::Writer::HSPTableWriter ?

Charles Hauser chauser@duke.edu
14 Aug 2002 14:21:32 -0400


Hi,

As part of an annotation project I would like to parse con...
blast reports and export the data into a database (postgre...
thought I would try to migrate my scripts over to use the ...

 
 I want to impose a few criteria using:
       $hsp->P <= 1e-10 (BPlite terminology)
       $hsp->percent, length
 
 I would like to report:
       Only the top 5 hits for each query
       GI number for the hit
       return a full list of params per:  HSPTableWriter
 
 I am not clear how to implement HSPTableWriter in conjunction with
 setting the selection criteria.
 
 Sample script:
 
 #!/usr/bin/perl  -w
 
 use strict;
 use Bio::SearchIO;
 use Bio::SearchIO::Writer::HSPTableWriter;
 
 my $in = new Bio::SearchIO(-format = 'blast', 
                                -file   = '../20020630/BLAST/TEST');
  
 while ( my $result = $in->next_result() ) {
     while( my $hit = $result->next_hit ) {
 # process the Bio::Search::HitI object
       next if $hit->significance >= 1e-10;  
         while( my $hsp = $hit->next_hsp ) {
 # process the Bio::Search::HSPI object
           if( $hsp->length('total') >= 100 && $hsp->percent_identity
>=50 ) {
 
 
 here I would like to store values in a hash ( I can do that )to use
 later to populate the database, but would also like to print a report
 using HSPTableWriter if that makes sense.
           }
         }  
     }
 }
 
 
 regards,
 
 Charles