[Bioperl-guts-l] [Bug 1668] New: a patch for MPIblast support in Bio::Tools::BPLite

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Thu Jul 15 22:21:57 EDT 2004


http://bugzilla.open-bio.org/show_bug.cgi?id=1668

           Summary: a patch for MPIblast support in Bio::Tools::BPLite
           Product: Bioperl
           Version: unspecified
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Bio::Search/Bio::SearchIO
        AssignedTo: bioperl-guts-l at bioperl.org
        ReportedBy: cariaso at yahoo.com


BPlite is currently unable to correctly parse an mpiblast report which has
multiple query sequences. A fix is attached to this bug report.

This bug report relates to parsing the output from this program
http://mpiblast.lanl.gov/

mpiblast reports do not have a footer. This is similar to the paracel BTK
reports, which are supported with a minor hack

my $report       = Bio::Tools::BPlite->new(-file=>$mpiblast_fn);
$report->{'BTK'} = 1;

parsing mpiblast (and presumably paracel btk) reports with multiple queries does
not currently work, but can be made to work with these 2 additions.



Bio/Tools/BPlite.pm

sub _fastForward {
    my ($self) = @_;
    return 0 if $self->{'REPORT_DONE'}; # empty report
    while(defined( $_ = $self->_readline() ) ) {
        if ($_ =~ /^Histogram|^Searching|^Parameters|^\s+Database:|^\s+Posted
date:/) {
            return 0;
        #BEGIN MODIFICATION
        } elsif( $self->{BTK} && $_ =~ /^BLAST/ ) {
            return 0;
        #END MODIFICATION
        } elsif( $_ =~ /^>/ ) {
            $self->_pushback($_);
            return 1;
        }
    }
    unless( $self->{'BTK'} ) { # Paracel BTK reports have no footer
        $self->warn("Possible error (1) while parsing BLAST report!");
        use Carp;
        Carp::cluck;
    }
}




and
Bio/Tools/BPlite/Sbjct.pm
in the subroutine nextHSP
near line 245

      elsif ($_ =~
/^>|^Histogram|^Searching|^Parameters|^\s+Database:|^CPU\stime|^\s*Lambda|^\s+Subset/)
      {
          #ps 5/28/01
          # elsif ($_ =~ /^>|^Parameters|^\s+Database:|^CPU\stime/)   {
          $self->_pushback($_);

          $self->{'HSP_ALL_PARSED'} = 1;
          last;
      }
#      #BEGIN MODIFICATION
      elsif ($_ =~ /^BLAST/)
      {
          $self->_pushback($_);
          $self->{'HSP_ALL_PARSED'} = 1;
          last;
      }
#      #END MODIFICATION
      elsif( $_ =~ /^\s*Frame/ ) {
          if ($self->report_type() eq 'TBLASTX') {
              ($qframe, $sframe) = $_ =~ /Frame = ([\+-]\d)\s+\/\s+([\+-]\d)/;
          } elsif ($self->report_type() eq 'TBLASTN') {
              ($sframe) = $_ =~ /Frame = ([\+-]\d)/;
          } else {
              ($qframe) = $_ =~ /Frame = ([\+-]\d)/;
          }
      }



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Bioperl-guts-l mailing list