[Bioperl-l] Converting BLAST alignments to HTML

Charles Hauser chauser@duke.edu
05 Sep 2002 09:44:55 -0400


I'm parsing blast reports and would like to store significant HSP
alignments as html to load into a database. 

With the code below I can grab the alignment, but is it possible to
convert this to html, i.e. I want the alignment (see below) to be stored
as <pre>....</pre>? 


regards, 

Charles 



my $blast_report = new Bio::SearchIO (-format => 'blast', 
              -file   => '../20020630/BLAST/aa2.bx'); 
while( my $result = $blast_report->next_result ) { 
     while( my $hit = $result->next_hit ) { 
         next if $hit->significance > 1e-10; 
         while (my $hsp = $hit->next_hsp) {         
             $aln = $hsp->get_aln();   
       }   
    } 
} 




Query: 4   RGIISIFVADEPGLINRVAGVFARRGANIESLAVGLTVDKALFTVVVAGKANVVANLVKQ
183
           R  IS+FV DE G+INR+AGVFARRG NIESLAVGL  DKALFT+VV G   V+  +V+Q
Sbjct: 76  RHTISVFVGDESGIINRIAGVFARRGYNIESLAVGLNEDKALFTIVVLGTDKVLQQVVEQ
135

Query: 184 LGKLVKVRYVEDITSTNRIEREMLLLKLRVPAGSTRAEVLELAAVFRARVVDVGDETLSL
363
           L KLV V  VED++    +ERE++L+KL     STR+E++ L  +FRA++VD  +++L++
Sbjct: 136 LNKLVNVIKVEDLSKEPHVERELMLIKLNADP-STRSEIMWLVDIFRAKIVDTSEQSLTI
194

Query: 364 CVTGDPGKLTAMIKVMSKFGIEQLTRTXRICLRRGEALLERSAGIPEQIAVPLPEAAKVK
543
            VTGDPGK+ A+   + KFGI+++ RT +I LRR +  +  +A      A   P   K +
Sbjct: 195 EVTGDPGKMVALTTNLEKFGIKEIARTGKIALRREK--MGETAPFWRFSAASYPHLVK-E
251

Query: 544 AASSNGAPKAAAA-----GEERGADVYVVDD-ADLKGVWDVDNVLSPTYSASGAGALPAD
705
           ++ A K   A G DVY V+   D K V D +     +SG
Sbjct: 252 SSHETVAEKTKLALTGNGNASSGGDVYPVEPYNDFKPVLDAHWGMVYDEDSSG-------
304

Query: 706 FKPYTLSIEVQDVPGVLNQVTMVFSRRGYNVQSLAVGPSEREGLSRIVMVVPGKVSSPDG
885
            + +TLS+ V +VPGVLN +T   SRRGYN+QSLAVGP+E+EGLSRI  V+PG
Sbjct: 305 LRSHTLSLLVANVPGVLNLITGAISRRGYNIQSLAVGPAEKEGLSRITTVIPGT------
358

Query: 886 SSGISPLLKQLSKLVFVQ 939
              I  L++QL KL+ +Q
Sbjct: 359 DENIDKLVRQLQKLIDLQ 376