# HG changeset patch # User Jan Kanis # Date 1400077229 -7200 # Node ID 53cd304c5f26b9ac05a9798c6fb52881e4a66a30 # Parent 67ddcb807b7dfedcabbb1f9fd92fa5ef4ef954c4 Add index for multiple results; fix layout of query ruler for edge case The query ruler did not layout nicely if the last segment was too short to contain the text. For very short last segments the text is now displayed after the ruler. diff -r 67ddcb807b7d -r 53cd304c5f26 blast_html.html.jinja --- a/blast_html.html.jinja Tue May 13 18:06:36 2014 +0200 +++ b/blast_html.html.jinja Wed May 14 16:20:29 2014 +0200 @@ -54,6 +54,12 @@ #nodata { font-weight: bold; } + + .index div.indexentry { + margin: .6em; + font-weight: bold; + font-size: 100%; + } .headerdata { font-size: 90%; @@ -94,7 +100,7 @@ .graphic { background-color: white; border: 2px solid black; - padding: .5em 1.5em; + padding: 1.5em; margin: auto; } @@ -157,6 +163,9 @@ margin: .5em 0 .5em 0; color: white; } + .scale .graphicitem { + position: relative; + } .scale .graphicitem div { margin: 0 1px; padding: 0 2px; @@ -170,6 +179,13 @@ .scale .graphicitem:last-child div { margin-right: 0px; } + .scale .graphicitem .lastlabel { + position: absolute; + top: 0px; + left: 100%; + background-color: transparent; + color: red; + } a.matchresult { display: block; @@ -349,9 +365,25 @@ {% else %} + + {% if blast.BlastOutput_iterations.findall('Iteration') | length > 1 %} +
+

Queries

+ + {% for result in blast.BlastOutput_iterations.Iteration %} + + {% endfor %} + +
+ {% endif %} + {% for result in blast.BlastOutput_iterations.Iteration %} -
+

Nucleotide Sequence ({{result|len}} letters)

@@ -401,11 +433,18 @@
query:
- {% for s in result|queryscale %} -
-
{{s.label}}
+
+ {% for s in result|queryscale %} +
+ {% if s.width > 3.0 %} +
{{s.label}}
+ {% else %} +
 
+
{{s.label}}
+ {% endif %} +
+ {% endfor %}
- {% endfor %}
diff -r 67ddcb807b7d -r 53cd304c5f26 blast_html.py --- a/blast_html.py Tue May 13 18:06:36 2014 +0200 +++ b/blast_html.py Wed May 14 16:20:29 2014 +0200 @@ -232,9 +232,11 @@ percent_multiplier = 100 / query_length for i in range(1, query_length+1): if i % skip == 0: - yield dict(label = i, width = skip * percent_multiplier) + yield dict(label = i, width = skip * percent_multiplier, shorter = False) if query_length % skip != 0: - yield dict(label = query_length, width = (query_length % skip) * percent_multiplier) + yield dict(label = query_length, + width = (query_length % skip) * percent_multiplier, + shorter = True) @filter def hit_info(self, result):