comparison templates/template1.tmpl @ 0:5dfd84907521 draft

planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/blast_report_basic commit bc359460bb66db7946cc68ccbd47cd479624c4a1-dirty
author dfornika
date Tue, 03 Mar 2020 00:14:34 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:5dfd84907521
1 #silent import time
2 #set $display_m = 20
3 #set $header = '<tr class="header"><th>Accession</th><th>Description</th><th>Score</th><th>% Coverage</th><th>% Identity</th></tr>'
4 <html>
5 <head>
6 <style>
7 body {
8 font-size:0.75em;
9 }
10 table, tr {
11 width: 100%;
12 }
13 table {
14 border-collapse: collapse;
15 border: 1px solid black;
16 }
17 tr.header {
18 background-color: lightgrey;
19 }
20 th {
21 border: 1px solid black;
22 }
23 td {
24 border-left: 1px solid black;
25 border-right: 1px solid black;
26 border-bottom: 1px dashed grey;
27 }
28 td.descr {
29 font-size: 80%;
30 }
31 h3 {
32 page-break-before: always;
33 color: blue;
34 }
35 h3.first {
36 page-break-before: avoid;
37 }
38 span.super {
39 color: navy;
40 font-size: 75%;
41 vertical-align: top;
42 }
43 </style>
44 <script>
45 function toggle(id){
46 var element = document.getElementById(id)
47 console.log(id)
48 if (element.style.display == 'none') {
49 //console.log(element.tagName);
50 if (element.tagName == 'TBODY') element.style.display = 'table-row-group';
51 else if (element.tagName == 'TD') element.style.display = 'table-cell';
52 else element.style.display = 'block';
53 } else {
54 element.style.display = 'none';
55 }
56 }
57 </script>
58 </head>
59 <body>
60 #set $q = 0
61 #for $query in $queries
62 #set $bin_symbols = dict([($bin,$i) for $i, $bin in enumerate($query.bins, 1)])
63 #set $m = 0
64 <h3 id="${query.query_id}" #if $q == 0 then'class="first"' else '' #>$query.query_id</h3>
65 <br/>
66 <table id="${query.query_id}_matches">
67 #if len($query.matches) == 0:
68 <tr class="header"><th colspan="5">No matches to report</th></tr>
69 </table>
70 #else:
71 $header
72 #for $match in $query.matches:
73 #if $m == $display_m
74 <tbody id="${query.query_id}_extra" style="display:none">
75 #end if
76 <tr>
77 <td>$match.subject_acc <span class="super">#echo ', '.join(sorted([str($bin_symbols[$bin]) for $bin in $match.bins]))#</span></td>
78 <td class="descr">$match.subject_descr</td>
79 <td>$match.score</td>
80 <td>$match.p_cov</td>
81 <td>$match.p_ident</td>
82 </tr>
83 #set $m += 1
84 #end for
85 #if $m >= $display_m
86 </tbody>
87 <td id="${query.query_id}_show" align="center" colspan="6" >Displaying ${display_m}/$m matches. <a href="#${query.query_id}_extra" onclick="toggle('${query.query_id}_extra'); toggle('${query.query_id}_show'); toggle('${query.query_id}_hide');">Show the remaining results.</a></td>
88 <td id="${query.query_id}_hide" align="center" colspan="6" style="display:none"><a href="#${query.query_id}" onclick="toggle('${query.query_id}_extra'); toggle('${query.query_id}_show'); toggle('${query.query_id}_hide');">Hide the last #echo $m - $display_m # results.</a></td>
89 <tr>
90 </tr>
91 #end if
92 </table>
93 #if len($bin_symbols) > 0:
94 <p>#echo ', '.join(['<span class="super">%s</span> %s'%($bin_symbols[$bin],$bin) for $bin in $query.bins])#</p>
95 #end if
96 #end if
97 #if $query.pident_filtered > 0:
98 <p>$query.pident_filtered results filtered by % Identity.</p>
99 #end if
100 #if $query.kw_filtered > 0:
101 <p>$query.kw_filtered results filtered by description keywords: #echo ', '.join(list(["%s matches to '%s'" % (str($query.kw_filtered_breakdown[$kw]),$kw) for $kw in $query.kw_filtered_breakdown])) #.</p>
102 #end if
103 <p>Report produced on #echo time.strftime("%d/%m/%Y") #.</p>
104 <hr noshade size="1" color="blue">
105 #set $q += 1
106 #end for
107 </body>
108 </html>