sub save_output { my ($self, $filename) = @_; if( ! defined $filename ) { $self->throw("Can't save blast output. You must specify a filename to save to."); } #should be set when retrieving blast my $blastfile = $self->file; #open temp file and output file, have to filter out some HTML open(TMP, $blastfile) or $self->throw("cannot open $blastfile"); open(SAVEOUT, ">$filename") or $self->throw("cannot open $filename"); my $seentop=0; while() { next if (/
/);    
        if( /^(?:[T]?BLAST[NPX])\s*.+$/i ||
               /^RPS-BLAST\s*.+$/i ) {
               $seentop=1;
           }
           next if !$seentop;
        if( $seentop ) {
            print SAVEOUT;
        }
    }
    close SAVEOUT;
    close TMP;
    return 1;

}