Commits

JanKanis  committed b3b5ee5

update test

  • Participants
  • Parent commits a22c909

Comments (0)

Files changed (5)

File blast2html.py

     default_template = path.join(path.dirname(__file__), 'blast2html.html.jinja')
 
     parser = argparse.ArgumentParser(description="Convert a BLAST XML result into a nicely readable html page",
-                                     usage="{0} [-i] INPUT [-o OUTPUT]".format(sys.argv[0]))
+                                     usage="{0} [-i] INPUT [-o OUTPUT] [--genelink-template URL_TEMPLATE]".format(sys.argv[0]))
     input_group = parser.add_mutually_exclusive_group(required=True)
     input_group.add_argument('positional_arg', metavar='INPUT', nargs='?', type=argparse.FileType(mode='r'),
                              help='The input Blast XML file, same as -i/--input')
                         help='The template file to use. Defaults to blast_html.html.jinja')
     
     dblink_group = parser.add_mutually_exclusive_group()
-    dblink_group.add_argument('--genelink-template', default='http://www.ncbi.nlm.nih.gov/nucleotide/{accession}?report=genbank&log$=nuclalign',
+    dblink_group.add_argument('--genelink-template', metavar='URL_TEMPLATE',
+                              default='http://www.ncbi.nlm.nih.gov/nucleotide/{accession}?report=genbank&log$=nuclalign',
                               help="""A link template to link hits to a gene bank webpage. The template string is a 
                               Python format string. It can contain the following replacement elements: {id[N]}, {fullid}, 
                               {defline[N]}, {fulldefline}, {accession}, where N is a number. id[N] and defline[N] will be 
 
     if six.PY2:
         # The argparse.FileType wrapper doesn't support an encoding
-        # argument or such, so for python 2 we need to wrap or reopen
-        # the output. The input files are already read as utf-8 by the
+        # argument, so for python 2 we need to wrap or reopen the
+        # output. The input files are already read as utf-8 by the
         # respective libraries.
 
         # One option is using codecs, but the codecs' writelines()
         # method doesn't support streaming but collects all output and
-        # writes at once. On the other hand the io module is slower
-        # (though not significantly).
+        # writes at once (see Python issues #5445 and #21910). On the
+        # other hand the io module is slower (though not
+        # significantly).
 
         # args.output = codecs.getwriter('utf-8')(args.output)
         args.output = io.open(args.output.name, 'w')

File blast2html.xml

     <tests>
         <test>
             <param name="input" value="blast xml example1.xml"/>
-            <output name="out_file1" file="blast xml example1.html"/>
+            <output name="output" file="blast xml example1.html"/>
         </test>
         <test>
             <param name="input" value="blast xml example2.xml"/>
-            <output name="out_file1" file="blast xml example2.html"/>
+            <output name="output" file="blast xml example2.html"/>
         </test>
         <test>
             <param name="input" value="blast xml example3.xml"/>
-            <output name="out_file1" file="blast xml example3.html"/>
+            <output name="output" file="blast xml example3.html"/>
         </test>
         <test>
             <param name="input" value="blast xml example4.xml"/>
-            <output name="out_file1" file="blast xml example4.html"/>
+            <output name="output" file="blast xml example4.html"/>
         </test>
     </tests>
     

File test-data/blast xml example3.html

                   <td>100%</td>
                   <td>7.011e-08</td>
                   <td>100%</td>
-                  <td><a href="http://example.com/example-genebank?id=Subject_3">Subject_3</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_3?report=genbank&amp;log$=nuclalign">Subject_3</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description3-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank?id=Subject_3">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_3?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>DJ437711|GenBank|insert_MIR604|Corn_Event_MIR604,_Left_Border_region|-5751164067366620000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank?id=Subject_3">Subject_3</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_3?report=genbank&amp;log$=nuclalign">Subject_3</a>
                     <span class=b>Length:</span> 323
                     <span class=b>Number of Matches:</span> 1
                   </p>
                   <td>100%</td>
                   <td>7.011e-08</td>
                   <td>100%</td>
-                  <td><a href="http://example.com/example-genebank?id=Subject_6">Subject_6</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_6?report=genbank&amp;log$=nuclalign">Subject_6</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description6-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank?id=Subject_6">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_6?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>AB209952.1|GenBank|insert_GTS-40-3-2|Glycine_max_transgenic_cp4epsps_gene_for_5-enol-pyruvylshikimate-3-phospate_synthase_class_2_precursor,_complete_cds|-9105899556052450000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank?id=Subject_6">Subject_6</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_6?report=genbank&amp;log$=nuclalign">Subject_6</a>
                     <span class=b>Length:</span> 2457
                     <span class=b>Number of Matches:</span> 1
                   </p>
                   <td>85%</td>
                   <td>2.981e-06</td>
                   <td>100%</td>
-                  <td><a href="http://example.com/example-genebank?id=Subject_2">Subject_2</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_2?report=genbank&amp;log$=nuclalign">Subject_2</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description18-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank?id=Subject_2">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_2?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>AJ308515.1|GenBank|insert_GTS-40-3-2|Synthetic_construct_for_NOS_3&#39;UTR/plant_junction_region.|-9105899556052450000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank?id=Subject_2">Subject_2</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_2?report=genbank&amp;log$=nuclalign">Subject_2</a>
                     <span class=b>Length:</span> 1045
                     <span class=b>Number of Matches:</span> 1
                   </p>
                   <td>100%</td>
                   <td>7.011e-08</td>
                   <td>100%</td>
-                  <td><a href="http://example.com/example-genebank?id=Subject_3">Subject_3</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_3?report=genbank&amp;log$=nuclalign">Subject_3</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description19-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank?id=Subject_3">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_3?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>DJ437711|GenBank|insert_MIR604|Corn_Event_MIR604,_Left_Border_region|-5751164067366620000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank?id=Subject_3">Subject_3</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_3?report=genbank&amp;log$=nuclalign">Subject_3</a>
                     <span class=b>Length:</span> 323
                     <span class=b>Number of Matches:</span> 1
                   </p>
                   <td>100%</td>
                   <td>7.011e-08</td>
                   <td>100%</td>
-                  <td><a href="http://example.com/example-genebank?id=Subject_6">Subject_6</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_6?report=genbank&amp;log$=nuclalign">Subject_6</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description22-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank?id=Subject_6">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_6?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>AB209952.1|GenBank|insert_GTS-40-3-2|Glycine_max_transgenic_cp4epsps_gene_for_5-enol-pyruvylshikimate-3-phospate_synthase_class_2_precursor,_complete_cds|-9105899556052450000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank?id=Subject_6">Subject_6</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_6?report=genbank&amp;log$=nuclalign">Subject_6</a>
                     <span class=b>Length:</span> 2457
                     <span class=b>Number of Matches:</span> 1
                   </p>
                   <td>100%</td>
                   <td>9.338e-08</td>
                   <td>92%</td>
-                  <td><a href="http://example.com/example-genebank?id=Subject_7">Subject_7</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_7?report=genbank&amp;log$=nuclalign">Subject_7</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description47-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank?id=Subject_7">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_7?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>AY326434|GenBank|insert_MON810|Synthetic_construct_truncated_CRYIA(b)_(cryIA(b))_gene,_partial_CDS|-2635190737607180000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank?id=Subject_7">Subject_7</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_7?report=genbank&amp;log$=nuclalign">Subject_7</a>
                     <span class=b>Length:</span> 4180
                     <span class=b>Number of Matches:</span> 1
                   </p>
                   <td>100%</td>
                   <td>9.338e-08</td>
                   <td>92%</td>
-                  <td><a href="http://example.com/example-genebank?id=Subject_8">Subject_8</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_8?report=genbank&amp;log$=nuclalign">Subject_8</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description48-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank?id=Subject_8">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_8?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>EUG|RIKILT|plasmid_pV-ZMBK07|plasmid_pV-ZMBK07|-2635190737607180000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank?id=Subject_8">Subject_8</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_8?report=genbank&amp;log$=nuclalign">Subject_8</a>
                     <span class=b>Length:</span> 4983
                     <span class=b>Number of Matches:</span> 1
                   </p>
                   <td>100%</td>
                   <td>6.629e-23</td>
                   <td>86%</td>
-                  <td><a href="http://example.com/example-genebank?id=Subject_7">Subject_7</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_7?report=genbank&amp;log$=nuclalign">Subject_7</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description55-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank?id=Subject_7">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_7?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>AY326434|GenBank|insert_MON810|Synthetic_construct_truncated_CRYIA(b)_(cryIA(b))_gene,_partial_CDS|-2635190737607180000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank?id=Subject_7">Subject_7</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_7?report=genbank&amp;log$=nuclalign">Subject_7</a>
                     <span class=b>Length:</span> 4180
                     <span class=b>Number of Matches:</span> 1
                   </p>
                   <td>100%</td>
                   <td>6.629e-23</td>
                   <td>86%</td>
-                  <td><a href="http://example.com/example-genebank?id=Subject_8">Subject_8</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_8?report=genbank&amp;log$=nuclalign">Subject_8</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description56-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank?id=Subject_8">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_8?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>EUG|RIKILT|plasmid_pV-ZMBK07|plasmid_pV-ZMBK07|-2635190737607180000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank?id=Subject_8">Subject_8</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/Subject_8?report=genbank&amp;log$=nuclalign">Subject_8</a>
                     <span class=b>Length:</span> 4983
                     <span class=b>Number of Matches:</span> 1
                   </p>

File test-data/blast xml example4.html

                   <td>100%</td>
                   <td>1.513e-07</td>
                   <td>100%</td>
-                  <td><a href="http://example.com/example-genebank/AB209952.1/">5</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/5?report=genbank&amp;log$=nuclalign">5</a></td>
                 </tr>
                 <tr>
                   <td><div><a href="#hit1-2"
                   <td>100%</td>
                   <td>1.513e-07</td>
                   <td>100%</td>
-                  <td><a href="http://example.com/example-genebank/DJ437711/">2</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/2?report=genbank&amp;log$=nuclalign">2</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description1-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank/AB209952.1/">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/5?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>AB209952.1|GenBank|insert_GTS-40-3-2|Glycine_max_transgenic_cp4epsps_gene_for_5-enol-pyruvylshikimate-3-phospate_synthase_class_2_precursor,_complete_cds|-9105899556052450000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank/AB209952.1/">gnl|BL_ORD_ID|5</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/5?report=genbank&amp;log$=nuclalign">gnl|BL_ORD_ID|5</a>
                     <span class=b>Length:</span> 2457
                     <span class=b>Number of Matches:</span> 1
                   </p>
 
                 <div class=linkheader>
                   <div class=right><a href="#description1-2">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank/DJ437711/">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/2?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>DJ437711|GenBank|insert_MIR604|Corn_Event_MIR604,_Left_Border_region|-5751164067366620000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank/DJ437711/">gnl|BL_ORD_ID|2</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/2?report=genbank&amp;log$=nuclalign">gnl|BL_ORD_ID|2</a>
                     <span class=b>Length:</span> 323
                     <span class=b>Number of Matches:</span> 1
                   </p>
                   <td>100%</td>
                   <td>1.513e-07</td>
                   <td>100%</td>
-                  <td><a href="http://example.com/example-genebank/AB209952.1/">5</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/5?report=genbank&amp;log$=nuclalign">5</a></td>
                 </tr>
                 <tr>
                   <td><div><a href="#hit3-2"
                   <td>100%</td>
                   <td>1.513e-07</td>
                   <td>100%</td>
-                  <td><a href="http://example.com/example-genebank/DJ437711/">2</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/2?report=genbank&amp;log$=nuclalign">2</a></td>
                 </tr>
                 <tr>
                   <td><div><a href="#hit3-3"
                   <td>85%</td>
                   <td>9.334e-06</td>
                   <td>100%</td>
-                  <td><a href="http://example.com/example-genebank/AJ308515.1/">1</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/1?report=genbank&amp;log$=nuclalign">1</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description3-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank/AB209952.1/">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/5?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>AB209952.1|GenBank|insert_GTS-40-3-2|Glycine_max_transgenic_cp4epsps_gene_for_5-enol-pyruvylshikimate-3-phospate_synthase_class_2_precursor,_complete_cds|-9105899556052450000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank/AB209952.1/">gnl|BL_ORD_ID|5</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/5?report=genbank&amp;log$=nuclalign">gnl|BL_ORD_ID|5</a>
                     <span class=b>Length:</span> 2457
                     <span class=b>Number of Matches:</span> 1
                   </p>
 
                 <div class=linkheader>
                   <div class=right><a href="#description3-2">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank/DJ437711/">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/2?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>DJ437711|GenBank|insert_MIR604|Corn_Event_MIR604,_Left_Border_region|-5751164067366620000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank/DJ437711/">gnl|BL_ORD_ID|2</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/2?report=genbank&amp;log$=nuclalign">gnl|BL_ORD_ID|2</a>
                     <span class=b>Length:</span> 323
                     <span class=b>Number of Matches:</span> 1
                   </p>
 
                 <div class=linkheader>
                   <div class=right><a href="#description3-3">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank/AJ308515.1/">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/1?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>AJ308515.1|GenBank|insert_GTS-40-3-2|Synthetic_construct_for_NOS_3&#39;UTR/plant_junction_region.|-9105899556052450000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank/AJ308515.1/">gnl|BL_ORD_ID|1</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/1?report=genbank&amp;log$=nuclalign">gnl|BL_ORD_ID|1</a>
                     <span class=b>Length:</span> 1045
                     <span class=b>Number of Matches:</span> 1
                   </p>
                   <td>88%</td>
                   <td>3.148e-06</td>
                   <td>95%</td>
-                  <td><a href="http://example.com/example-genebank/EUG/">7</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/7?report=genbank&amp;log$=nuclalign">7</a></td>
                 </tr>
                 <tr>
                   <td><div><a href="#hit6-2"
                   <td>88%</td>
                   <td>3.148e-06</td>
                   <td>95%</td>
-                  <td><a href="http://example.com/example-genebank/AY326434/">6</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/6?report=genbank&amp;log$=nuclalign">6</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description6-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank/EUG/">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/7?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>EUG|RIKILT|plasmid_pV-ZMBK07|plasmid_pV-ZMBK07|-2635190737607180000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank/EUG/">gnl|BL_ORD_ID|7</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/7?report=genbank&amp;log$=nuclalign">gnl|BL_ORD_ID|7</a>
                     <span class=b>Length:</span> 4983
                     <span class=b>Number of Matches:</span> 1
                   </p>
 
                 <div class=linkheader>
                   <div class=right><a href="#description6-2">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank/AY326434/">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/6?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>AY326434|GenBank|insert_MON810|Synthetic_construct_truncated_CRYIA(b)_(cryIA(b))_gene,_partial_CDS|-2635190737607180000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank/AY326434/">gnl|BL_ORD_ID|6</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/6?report=genbank&amp;log$=nuclalign">gnl|BL_ORD_ID|6</a>
                     <span class=b>Length:</span> 4180
                     <span class=b>Number of Matches:</span> 1
                   </p>
                   <td>100%</td>
                   <td>3.564e-15</td>
                   <td>86%</td>
-                  <td><a href="http://example.com/example-genebank/EUG/">7</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/7?report=genbank&amp;log$=nuclalign">7</a></td>
                 </tr>
                 <tr>
                   <td><div><a href="#hit7-2"
                   <td>100%</td>
                   <td>3.564e-15</td>
                   <td>86%</td>
-                  <td><a href="http://example.com/example-genebank/AY326434/">6</a></td>
+                  <td><a href="http://www.ncbi.nlm.nih.gov/nucleotide/6?report=genbank&amp;log$=nuclalign">6</a></td>
                 </tr>
               </table>
 
 
                 <div class=linkheader>
                   <div class=right><a href="#description7-1">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank/EUG/">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/7?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>EUG|RIKILT|plasmid_pV-ZMBK07|plasmid_pV-ZMBK07|-2635190737607180000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank/EUG/">gnl|BL_ORD_ID|7</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/7?report=genbank&amp;log$=nuclalign">gnl|BL_ORD_ID|7</a>
                     <span class=b>Length:</span> 4983
                     <span class=b>Number of Matches:</span> 1
                   </p>
 
                 <div class=linkheader>
                   <div class=right><a href="#description7-2">Descriptions</a></div>
-                  <a class="linkheader" href="http://example.com/example-genebank/AY326434/">Gene Bank</a>
+                  <a class="linkheader" href="http://www.ncbi.nlm.nih.gov/nucleotide/6?report=genbank&amp;log$=nuclalign">Gene Bank</a>
                 </div>
 
                 <div class=title>
                   <p class=hittitle>AY326434|GenBank|insert_MON810|Synthetic_construct_truncated_CRYIA(b)_(cryIA(b))_gene,_partial_CDS|-2635190737607180000</p>
                   <p class=titleinfo>
-                    <span class=b>Sequence ID:</span> <a href="http://example.com/example-genebank/AY326434/">gnl|BL_ORD_ID|6</a>
+                    <span class=b>Sequence ID:</span> <a href="http://www.ncbi.nlm.nih.gov/nucleotide/6?report=genbank&amp;log$=nuclalign">gnl|BL_ORD_ID|6</a>
                     <span class=b>Length:</span> 4180
                     <span class=b>Number of Matches:</span> 1
                   </p>

File test-data/refresh_test_results.sh

 
 set -eu
 
-"$@" ../blast2html.py -i "blast xml example1.xml" -o "blast xml example1.html"
-"$@" ../blast2html.py -i "blast xml example2.xml" -o "blast xml example2.html"
-"$@" ../blast2html.py -i "blast xml example3.xml" -o "blast xml example3.html" --genelink-template 'http://example.com/example-genebank?id={fullid}'
-"$@" ../blast2html.py -i "blast xml example4.xml" -o "blast xml example4.html" --db-config-dir .
+for i in 1 2 3 4
+do
+    "$@" ../blast2html.py -i "blast xml example$i.xml" -o "blast xml example$i.html"
+done
 
+"$@" ../blast2html.py -i "blast xml example3.xml" -o "blast xml example3b.html" --genelink-template 'http://example.com/example-genebank?id={fullid}'
+"$@" ../blast2html.py -i "blast xml example4.xml" -o "blast xml example4b.html" --db-config-dir .
+