-
Notifications
You must be signed in to change notification settings - Fork 8
/
results.html
191 lines (167 loc) · 9.38 KB
/
results.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
{% extends "layout.html" %}
{% block title %}Trace file alignment{% endblock %}
{% block nav_index %}active{% endblock %}
{% block head %}
{{ super() }}
{% endblock %}
{% block container %}
<style type="text/css">
</style>
<div class="row">
<div class="col-sm">
{% if error %}
<div class="alert alert-danger">{{ error }}</div>
<p>Traceback</p>
<pre> {{ traceback }}</pre>
{% elif results is not none %}
<div id="result">
<div class="row">
<div class="col-md-6">
<h3>Results</h3>
</div>
<div class="col-md-6 text-right">
<div class="btn-group">
<a href="/settings/{{ files_id }}/{{ task_id }}" class="btn btn-light">Resubmit</a>
<button class="btn btn-light" type="button" data-toggle="collapse" data-target="#taskInfo" aria-expanded="false" aria-controls="taskInfo">
Info
</button>
<a href="/excel/{{ task_id }}" class="btn btn-success">Download all</a>
</div>
</div>
</div>
<p id="taskInfo" class="collapse">
Global quality score: <strong>{{ settings.threshold }}</strong>
<br>End trimming quality score: <strong>{{ settings.end_threshold }}</strong>
<br>Match trace files to references by: <strong>{% if settings.search %}Best match{% else %}ID{% endif %}</strong>{% if settings.separate %}, each trace aligned separately{% endif %}
</p>
<table id="results_table" class="display">
<thead>
<tr>
<th class="d-none">Sort</th>
<th>ID</th>
<th>Group</th>
<th>Cov</th>
<th>Ident</th>
<th>Mutation</th>
<th>Silent</th>
<th>Mis</th>
<th>Nons</th>
<th>Reads</th>
<th>File Names</th>
<th>Download</th>
</tr>
</thead>
<tbody>
{% for i, (alignment, (_, row)) in enumerate(zip(alignments, results.iterrows())) %}
<tr>
<td class="d-none">{{ row["Reference ID"] }}</td>
<td>
<button class="btn btn-sm btn-primary ref-button" type="button">
{{ row["Reference ID"] }}
</button>
<div class="alignment collapse" data-alignment="{{ i }}">
<span class="residue {% if alignment.kozak_count %}no_mut{% else %}mis_mut{% endif %}
cov{{ alignment.kozak_count }}" title="{% if alignment.kozak_count %}Kozak confirmed{% else %}Kozak unconfirmed{% endif %}"
data-toggle="tooltip" data-html="true">*</span>
{% for pos in range(alignment.positions|length) %}
<span class="residue cov{{ [4, alignment.positions[pos].coverage]|min }} {{ alignment.format_position(pos)
}} " data-codon-num-ref="{{ alignment.get_codon_num(pos, False) }}" data-codon-num-new="{{ alignment.get_codon_num(pos, True)
}}" data-position="{{ pos }}" data-display-pos="{{ alignment.position_to_display(pos)
}}" data-feat="{{ alignment.aligned_reference.get_feature_for_pos(pos).id }}" data-ref="{{ alignment.positions[pos].ref
}}" data-options="{{ ', '.join(alignment.positions[pos].options) }}">{{ alignment.positions[pos].result }}
</span>
{% endfor %}
<span class="residue {% if alignment.stop_count %}no_mut{% else %}mis_mut{% endif %}
cov{{ alignment.stop_count }}" title="{% if alignment.stop_count %}stop codon confirmed{% else %}stop codon unconfirmed{% endif %}"
data-toggle="tooltip" data-html="true">*</span>
</div>
</td>
<td>{{ row["Group"] }}</td>
<td data-color-percentage="{{ row['% Coverage'] }}" data-color-bin="{{ get_color_bin(row['% Coverage'], [65, 70, 75, 80, 85, 90]) }}"
class="{% if is_multiple_populations and is_best_for_reference(results, row, '% Coverage') %}population-best{% endif %}">
{{ round(row["% Coverage"], 2) }}
</td>
<td data-color-percentage="{{ row['% Identity'] }}" data-color-bin="{{ get_color_bin(row['% Identity'], [95, 96, 97, 98, 99, 100]) }}"
class="{% if is_multiple_populations and is_best_for_reference(results, row, '% Identity') %}population-best{% endif %}">
{{ round(row["% Identity"], 2) }}
</td>
<td class="color-mutation-{{ row['Mutation Type'].lower() }}">{{ row["Mutation Type"] }}</td>
<td class="">{{ row["Silent Mutations"] }}</td>
<td class="">{{ row["Missense Mutations"] }}</td>
<td class="">{{ row["Nonsense Mutations"] }}</td>
<td class="">{{ row["Number of reads"] }}</td>
<td class="col-file-names">{{ row["File names"] }}</td>
<td><a href='/excel/{{ task_id }}/{{ i }}' class="btn btn-success cut-text" style="max-width: 120px;" >↓</a></td>
</tr>
{% endfor %}
</tbody>
</table>
<h3>Legend</h3>
<div class="row">
<div class="col-md-3">
<strong>Coverage: </strong>
<span class="cov1 legend"> 1 </span>
<span class="cov2 legend"> 2 </span>
<span class="cov3 legend"> 3 </span>
<span class="cov4 legend"> 4+</span>
</div>
<div class="col-md-6">
<strong>Mutation: </strong>
<span class="no_mut legend">None</span>
<span class="silent_mut legend">Silent</span>
<span class="mis_mut legend">Mis</span>
<span class="nons_mut legend">Nons</span>
<span class="frameshift legend">Frameshift</span>
<span class="mixed_peak legend">Mixed peak</span>
</div>
<div class="col-md-3">
<strong>Codon: </strong>
<span class="codon-ref residue cds">Reference</span>
<span class="codon-new residue cds">Sequenced</span>
</div>
</div>
</div>
{% endif %}
</div>
</div>
<!-- Button trigger modal
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#traceModal">
Launch demo modal
</button> -->
<div class="modal fade bd-example-modal-lg" id="traceModal" tabindex="-1" role="dialog" aria-labelledby="traceModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl " role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="traceModalLabel">Traces for reference ID </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div id="traceError"></div>
<div id="navPlot"></div>
<div id="refPlot"></div>
<div id="tracePlot"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
{{ super() }}
<script type="text/javascript" src="{{ url_for('static', filename='trace_viewer.js') | autoversion }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='table_display.js') | autoversion }}"></script>
<script>
$(function(){
var task_id = '{{ task_id }}'
$('#traceModal').modal({ show: false});
var table = $('#results_table');
initTable(table, task_id)
showTooltips()
tableColors()
})
</script>
{% endblock %}