# HG changeset patch # User Jan Kanis # Date 1404911077 -7200 # Node ID e17aae23cc1c270604d083c33cf284f5f02750a2 # Parent ea3bc0b9a3d9400594227f17b3f950ad4d546b4f report query parameters for each query diff -r ea3bc0b9a3d9 -r e17aae23cc1c blast2html.html.jinja --- a/blast2html.html.jinja Tue Jul 08 17:51:22 2014 +0200 +++ b/blast2html.html.jinja Wed Jul 09 15:04:37 2014 +0200 @@ -396,6 +396,18 @@ {% else %} +
+ +

Nucleotide Blast results

+ + + {% for param, value in params %} + + {% endfor %} +
{{param}}:{{value}}
+ +
+ {% if blast.BlastOutput_iterations.findall('Iteration') | length > 1 %}

Queries

@@ -420,7 +432,7 @@
- {% for param, value in params %} + {% for param, value in result|params %} {% endfor %}
{{param}}:{{value}}
diff -r ea3bc0b9a3d9 -r e17aae23cc1c blast2html.py --- a/blast2html.py Tue Jul 08 17:51:22 2014 +0200 +++ b/blast2html.py Wed Jul 09 15:04:37 2014 +0200 @@ -224,6 +224,12 @@ key=lambda h: max(blastxml_len(hsp) for hsp in h.Hit_hsps.Hsp), reverse=True) +@filter('params') +def result_params(iteration): + return (('Query number', iteration['Iteration_iter-num']), + ('Query ID', iteration['Iteration_query-ID']), + ('Definition line', iteration['Iteration_query-def']), + ('Length', blastxml_len(iteration))) class BlastVisualize: @@ -258,10 +264,7 @@ def render(self, output): template = self.environment.get_template(self.templatename) - params = (('Query ID', self.blast["BlastOutput_query-ID"]), - ('Query definition', self.blast["BlastOutput_query-def"]), - ('Query length', self.blast["BlastOutput_query-len"]), - ('Program', self.blast.BlastOutput_version), + params = (('Program', self.blast.BlastOutput_version), ('Database', self.blast.BlastOutput_db), )