diff blast2html.py @ 118:7f3f8c10f44b

fix for Rikilt issues 8, 11, 12, 14
author Jan Kanis <jan.code@jankanis.nl>
date Thu, 31 Jul 2014 13:09:30 +0200
parents f5066973029a
children 591dc9c24824
line wrap: on
line diff
--- a/blast2html.py	Thu Jul 31 14:55:07 2014 +0200
+++ b/blast2html.py	Thu Jul 31 13:09:30 2014 +0200
@@ -342,7 +342,7 @@
                        maxscore = "{0:.1f}".format(max(hsp_val('Hsp_bit-score'))),
                        totalscore = "{0:.1f}".format(sum(hsp_val('Hsp_bit-score'))),
                        cover = "{0:.0%}".format(cover_count / query_length),
-                       e_value = "{0:.4g}".format(min(hsp_val('Hsp_evalue'))),
+                       e_value = "{0:.4}".format(float(min(hsp_val('Hsp_evalue')))),
                        # FIXME: is this the correct formula vv?
                        # float(...) because non-flooring division doesn't work with lxml elements in python 2.6
                        ident = "{0:.0%}".format(float(min(float(hsp.Hsp_identity) / blastxml_len(hsp) for hsp in hsps))))
@@ -383,7 +383,7 @@
             return text if display_nolink else ''
 
         classattr = 'class="{0}" '.format(jinja2.escape(cssclass)) if cssclass is not None else ''
-        return jinja2.Markup("<a {0}href=\"{1}\">{2}</a>".format(classattr, jinja2.escape(link), jinja2.escape(text)))
+        return jinja2.Markup("<a {0}target=\"_top\" href=\"{1}\">{2}</a>".format(classattr, jinja2.escape(link), jinja2.escape(text)))
 
 
 genelinks_entry = namedtuple('genelinks_entry', 'dbname template')