# HG changeset patch # User Jan Kanis # Date 1406805994 -7200 # Node ID 591dc9c248247023e04e5b1dca3f6be0731db935 # Parent 7f3f8c10f44b121de28c7aaf2f3b35d6f7697b60 tentative fix for Rikilt issue 10: don't sort hits ourselves but use blastxml ordering diff -r 7f3f8c10f44b -r 591dc9c24824 blast2html.py --- a/blast2html.py Thu Jul 31 13:09:30 2014 +0200 +++ b/blast2html.py Thu Jul 31 13:26:34 2014 +0200 @@ -219,10 +219,8 @@ @filter def hits(result): - # sort hits by longest hotspot first - return sorted(result.Iteration_hits.findall('Hit'), - key=lambda h: max(blastxml_len(hsp) for hsp in h.Hit_hsps.Hsp), - reverse=True) + # Use findall so we get an empty list if there are no Hit elements at all + return result.Iteration_hits.findall('Hit') @filter('params') def result_params(iteration): diff -r 7f3f8c10f44b -r 591dc9c24824 test-data/blast xml example1.html --- a/test-data/blast xml example1.html Thu Jul 31 13:09:30 2014 +0200 +++ b/test-data/blast xml example1.html Thu Jul 31 13:26:34 2014 +0200 @@ -757,32 +757,6 @@ -
-
-
-
-
- - -
-
-
-
-
- - +
+
+
+
+
+ + +
+
+
+
+
+ + 1C2W_B -
- Chain 1, Structure Of The Methanococcus Jannaschii Ribosome-secyebeta Channel Complex (50s Ribosomal Subunit) -
- 18.3 - 36.7 - 81% - 11.9 - 92% - 3J44_1 - - -
- Chain 1, Promiscuous Behavior Of Proteins In Archaeal Ribosomes Revealed By Cryo-em: Implications For Evolution Of Eukaryotic Ribosomes (50s Ribosomal Rna) -
- 18.3 - 36.7 - 81% - 11.9 - 92% - 3J2L_1 - -
@@ -2261,6 +2235,19 @@ 4BYW_5 +
+ Chain 1, Structure Of The Methanococcus Jannaschii Ribosome-secyebeta Channel Complex (50s Ribosomal Subunit) +
+ 18.3 + 36.7 + 81% + 11.9 + 92% + 3J44_1 + +
@@ -2313,6 +2300,19 @@ 3ZEX_B +
+ Chain 1, Promiscuous Behavior Of Proteins In Archaeal Ribosomes Revealed By Cryo-em: Implications For Evolution Of Eukaryotic Ribosomes (50s Ribosomal Rna) +
+ 18.3 + 36.7 + 81% + 11.9 + 92% + 3J2L_1 + +
@@ -6266,134 +6266,6 @@
-
- - - -
-

Chain 1, Structure Of The Methanococcus Jannaschii Ribosome-secyebeta Channel Complex (50s Ribosomal Subunit)

-

- Sequence ID: gi|551701574|pdb|3J44|1 - Length: 3049 - Number of Matches: 2 -

-
- - -
-

- Range 1: 651 to 663 -

- - - - - - - - - - - - -
ScoreExpectIdentitiesGapsStrand
18.3341 bits (9)11.901312/13 (92%)0/13 (0%)Plus/Plus
- -
Query        1  CGTCCGTCGTGAA  13
-                |||||||| ||||
-Subject    651  CGTCCGTCTTGAA  663
-
-
-

- Range 2: 2705 to 2713 -

- - - - - - - - - - - - -
ScoreExpectIdentitiesGapsStrand
18.3341 bits (9)11.90139/9 (100%)0/9 (0%)Plus/Plus
- -
Query        4  CCGTCGTGA  12
-                |||||||||
-Subject   2705  CCGTCGTGA  2713
-
- -
- -
- - - -
-

Chain 1, Promiscuous Behavior Of Proteins In Archaeal Ribosomes Revealed By Cryo-em: Implications For Evolution Of Eukaryotic Ribosomes (50s Ribosomal Rna)

-

- Sequence ID: gi|428697991|pdb|3J2L|1 - Length: 3049 - Number of Matches: 2 -

-
- - -
-

- Range 1: 651 to 663 -

- - - - - - - - - - - - -
ScoreExpectIdentitiesGapsStrand
18.3341 bits (9)11.901312/13 (92%)0/13 (0%)Plus/Plus
- -
Query        1  CGTCCGTCGTGAA  13
-                |||||||| ||||
-Subject    651  CGTCCGTCTTGAA  663
-
-
-

- Range 2: 2705 to 2713 -

- - - - - - - - - - - - -
ScoreExpectIdentitiesGapsStrand
18.3341 bits (9)11.90139/9 (100%)0/9 (0%)Plus/Plus
- -
Query        4  CCGTCGTGA  12
-                |||||||||
-Subject   2705  CCGTCGTGA  2713
-
- -
-
@@ -6826,6 +6698,70 @@
+
+ + + +
+

Chain 1, Structure Of The Methanococcus Jannaschii Ribosome-secyebeta Channel Complex (50s Ribosomal Subunit)

+

+ Sequence ID: gi|551701574|pdb|3J44|1 + Length: 3049 + Number of Matches: 2 +

+
+ + +
+

+ Range 1: 651 to 663 +

+ + + + + + + + + + + + +
ScoreExpectIdentitiesGapsStrand
18.3341 bits (9)11.901312/13 (92%)0/13 (0%)Plus/Plus
+ +
Query        1  CGTCCGTCGTGAA  13
+                |||||||| ||||
+Subject    651  CGTCCGTCTTGAA  663
+
+
+

+ Range 2: 2705 to 2713 +

+ + + + + + + + + + + + +
ScoreExpectIdentitiesGapsStrand
18.3341 bits (9)11.90139/9 (100%)0/9 (0%)Plus/Plus
+ +
Query        4  CCGTCGTGA  12
+                |||||||||
+Subject   2705  CCGTCGTGA  2713
+
+ +
+
@@ -7280,6 +7216,70 @@
+
+ + + +
+

Chain 1, Promiscuous Behavior Of Proteins In Archaeal Ribosomes Revealed By Cryo-em: Implications For Evolution Of Eukaryotic Ribosomes (50s Ribosomal Rna)

+

+ Sequence ID: gi|428697991|pdb|3J2L|1 + Length: 3049 + Number of Matches: 2 +

+
+ + +
+

+ Range 1: 651 to 663 +

+ + + + + + + + + + + + +
ScoreExpectIdentitiesGapsStrand
18.3341 bits (9)11.901312/13 (92%)0/13 (0%)Plus/Plus
+ +
Query        1  CGTCCGTCGTGAA  13
+                |||||||| ||||
+Subject    651  CGTCCGTCTTGAA  663
+
+
+

+ Range 2: 2705 to 2713 +

+ + + + + + + + + + + + +
ScoreExpectIdentitiesGapsStrand
18.3341 bits (9)11.90139/9 (100%)0/9 (0%)Plus/Plus
+ +
Query        4  CCGTCGTGA  12
+                |||||||||
+Subject   2705  CCGTCGTGA  2713
+
+ +
+