[Bioperl-l] exception parsing plain old blast html
simon andrews (BI)
simon.andrews at bbsrc.ac.uk
Thu Apr 10 10:08:10 EDT 2003
> <jason at cgt.mc.duke.edu> =====
> >The parser cannot handle html blast.
>
> From: nkuipers
>
> Out of curiosity, has anyone else ever wanted to parse HTML
> BLAST output and then send the htmlized info to a browser?
> Reading in a plain blast file, parsing it, and then formatting
> the input as HTML for display seems to me a roundabout way when
> BLAST will do it for you...
We do this all the time, and we actually find that it's easier to do it working from the raw BLAST output rather than from the HTML version.
Adding back HTML tags to a raw BLAST file is a pretty trivial thing (just a set of <pre></pre> tags in its simplest form!), and if you do it yourself you have much more flexibility over which parts of the report you turn into links, and where they point. In our case we add back the internal links from hits to alignments and also add a link to all accession numbers to a fetch script which returns the full sequence from our internal databases. Once you've parsed the accessions from the report you just have to add a couple of add a couple of substitutions to your output stream when printing your page and it pretty much sorts itself out.
The other problem with using the HTML output from BLAST is that if you want to include the BLAST as part of a larger page (we add some headers and a graphical hit summary), then you have to post process the file anyway to remove the <html> <head> and <body> tags from the original before you insert it. If you're having to process the file anyway then you lose much of the advantage of having BLAST add the HTML for you.
Anyway, if you don't want to do any of this yourself there's always Bio::SearchIO::Writer::HTMLResultWriter to do it for you :-)
Simon.
--
Simon Andrews PhD
Bioinformatics Dept
The Babraham Institute
simon.andrews at bbsrc.ac.uk
+44 (0)1223 496463
More information about the Bioperl-l
mailing list