[Bioperl-l] RemoteBlast - hit table and html format

Madeleine Lemieux mlemieux at bioinfo.ca
Fri Apr 29 15:44:41 EDT 2005

Nathan and Paul,

The answers to your respective questions are related.

Paul: RemoteBlast returns a Blast object that contains the results 
parsed from the response retrieved from the NCBI. The parser handles 
pairwise alignments perfectly but doesn't deal so well with the tabular 
data that is returned when 
Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'ALIGNMENT_VIEW'} = 
'Tabular' (which is how you change the view option) is specified.

To get the raw HTML returned by the NCBI, you have to intercept the 
result before the parsing happens. Look for the following bit of code 
in RemoteBlast.pm:
     if( $response->is_success ) {
         my $size = -s $tempfile;
         if( $size > 1000 ) {
             my $blastobj;
             if( $self->readmethod =~ /BPlite/ ) {
                 $blastobj = new Bio::Tools::BPlite(-file => $tempfile);
             } else {
                 $blastobj = new Bio::SearchIO(-file => $tempfile,
                                               -format => 'blast');
             #save tempfile
             return $blastobj;

The file $tempfile contains the HTML before parsing. If you replace the 
code in the if($size > 1000) block with whatever processing you prefer, 
if any, that should do it.

Nathan: Any graphical browser will do to look at the contents of 
$tempfile. If you're not getting pairwise alignments, any browser at 
all will do in fact. Just point the browser at
If your users are familiar with a particular browser, this might be the 
most comfortable and easy solution for them. Alternatively, most recent 
text editors also display HTML properly (TextEdit on Mac, Word, etc.).

Hope this helps!

More information about the Bioperl-l mailing list