[Bioperl-l] Bio::Tools::Blast update

Steve Chervitz Steve_Chervitz@affymetrix.com
Wed, 20 Jun 2001 01:12:50 -0700


Just wanted to give people an update about the status of my overhaul of 
Bio::Tools::Blast. I've made some good progress on it lately and 
probably will be ready to check the new code into the main trunk soon 
for beta testing.

A design decision came up that I'd like people's opinion on. Here's a 
snippet of what you can do with my new code to generate a table of Blast 
results:

# Analogous to SeqIO but operating on Blast reports/objects.
# This does not handle running new analyses, just parsing existing ones.

use Bio::Tools::BlastIO;
use Bio::Tools::BlastIO::SbjctTableWriter;

my $in     = Bio::Tools::BlastIO->new();
my $writer = Bio::Tools::BlastIO::SbjctTableWriter->new();
my $out    = Bio::Tools::BlastIO->new( -writer => $writer,
                                        -file   => ">blast-table.txt" );

while ( my $blast = $in->next_blast() ) {
     $out->write_blast($blast);
}

This works well enough for crunching through Blast results, but as for 
integrating with SeqAnalysisParserI, it might be better to have a more 
generic SeqAnalysisIO system that could be adapted for other types of 
results besides Blast:

# Analogous to SeqIO but operating on AnalysisResult objects.

use Bio::SeqAnalysisIO;

my $in = Bio::SeqAnalysisIO->new('-method' => 'blast');

while( my $analysis = $in->next_analysis() ) {
   while( my $feature = $analysis->next_feature() ) {
      print "Feature from ", $feature->start," to ", $feature->end, "\n";
   }
}

A nice thing about this is that it extends the Bioperl IO pattern to 
analysis results. However, this would be an alternative to the 
SeqAnalysisParserFactory system that's in place now. If we have 
something that works, why create yet another system? Perhaps a full IO 
system is only appropriate for some analysis results, such as Blast.

Opinions welcome.

Steve

Steve_Chervitz@affymetrix.com