# HG changeset patch # User Jan Kanis # Date 1400148741 -7200 # Node ID c8347745bbadd08e1eb03d43cbc31e94caef9c75 # Parent 6995a6f34f3f8e21021b3e60b3f157d27330f4cb use Iteration_message tag; also work with unexpected Hit_id values diff -r 6995a6f34f3f -r c8347745bbad blast2html.html.jinja --- a/blast2html.html.jinja Thu May 15 11:05:39 2014 +0200 +++ b/blast2html.html.jinja Thu May 15 12:12:21 2014 +0200 @@ -414,7 +414,9 @@

No Hits

- This query did not match anywhere + + +
Message:{{result.Iteration_message}}
{% else %} diff -r 6995a6f34f3f -r c8347745bbad blast2html.py --- a/blast2html.py Thu May 15 11:05:39 2014 +0200 +++ b/blast2html.py Thu May 15 12:12:21 2014 +0200 @@ -63,11 +63,20 @@ @filter def hitid(hit): - return hit.Hit_id.text.split('|', 2)[1] + hitid = hit.Hit_id.text + s = hitid.split('|', 2) + if len(s) >= 2: + return s[1] + return hitid @filter def seqid(hit): - return hit.Hit_id.text.split('|', 2)[2] + hitid = hit.Hit_id.text + s = hitid.split('|', 2) + if len(s) >= 3: + return s[2] + return hitid + @filter def alignment_pre(hsp):