Mercurial > repos > jankanis > blast2html
comparison blast_html.py @ 14:0b33898bba45
small bugfixes (one for python 3.4)
| author | Jan Kanis <jan.code@jankanis.nl> |
|---|---|
| date | Mon, 12 May 2014 17:32:01 +0200 |
| parents | c2d63adb83db |
| children | 648b3b7437da |
comparison
equal
deleted
inserted
replaced
| 13:c2d63adb83db | 14:0b33898bba45 |
|---|---|
| 69 return hit.Hit_id.text.split('|', 2)[2] | 69 return hit.Hit_id.text.split('|', 2)[2] |
| 70 | 70 |
| 71 @filter | 71 @filter |
| 72 def alignment_pre(hsp): | 72 def alignment_pre(hsp): |
| 73 return ( | 73 return ( |
| 74 "Query {:>7s} {} {}\n".format(hsp['Hsp_query-from'], hsp.Hsp_qseq, hsp['Hsp_query-to']) + | 74 "Query {:>7s} {} {}\n".format(hsp['Hsp_query-from'].text, hsp.Hsp_qseq, hsp['Hsp_query-to'].text) + |
| 75 " {:7s} {}\n".format('', hsp.Hsp_midline) + | 75 " {:7s} {}\n".format('', hsp.Hsp_midline) + |
| 76 "Subject{:>7s} {} {}".format(hsp['Hsp_hit-from'], hsp.Hsp_hseq, hsp['Hsp_hit-to']) | 76 "Subject{:>7s} {} {}".format(hsp['Hsp_hit-from'].text, hsp.Hsp_hseq, hsp['Hsp_hit-to'].text) |
| 77 ) | 77 ) |
| 78 | 78 |
| 79 @filter('len') | 79 @filter('len') |
| 80 def hsplen(node): | 80 def hsplen(node): |
| 81 return int(node['Hsp_align-len']) | 81 return int(node['Hsp_align-len']) |
| 103 | 103 |
| 104 colors = ('black', 'blue', 'green', 'magenta', 'red') | 104 colors = ('black', 'blue', 'green', 'magenta', 'red') |
| 105 | 105 |
| 106 max_scale_labels = 10 | 106 max_scale_labels = 10 |
| 107 | 107 |
| 108 templatename = 'visualise.html.jinja' | 108 templatename = 'blast_html.html.jinja' |
| 109 | 109 |
| 110 def __init__(self, input): | 110 def __init__(self, input): |
| 111 self.input = input | 111 self.input = input |
| 112 | 112 |
| 113 self.blast = objectify.parse(self.input).getroot() | 113 self.blast = objectify.parse(self.input).getroot() |
