Run_stats.tpl 14.5 KB
Newer Older
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
{*
Copyright (C) 2009 INRA
 
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*}

{extends file='AnalysisTemplate.tpl'}
{block name=params}
	{assign var="params" value=" "|explode:$analyse.params}
	{foreach from=$analyse_results key=sample item=sample_results}
	{assign var="sample" value=$sample}
	{/foreach}
	<ul>
		{if in_array("minSubReadLength", $params)}
		{assign var="minSubReadLength" value=$params|@array_keys:"minSubReadLength"}
		<li class="parameter">Subreads shorter than {$params[$minSubReadLength[0]+1]} (in base pairs) are filtered out and excluded from analysis.</li>
		{/if}
		{if in_array("readScore", $params)}
		{assign var="polymerase_read_qual" value=$params|@array_keys:"readScore"}
		<li class="parameter">Polymerase reads with lower quality than {$params[$polymerase_read_qual[0]+1]} are filtered out and excluded from analysis. </li>
		{/if}
		{if in_array("minLength", $params)}
		{assign var="polymerase_read_length" value=$params|@array_keys:"minLength"}
		<li class="parameter">Polymerase reads shorter than {$params[$polymerase_read_length[0]+1]} (in base pairs) are filtered out and excluded from analysis.</li>
		{/if}
		{if in_array("barcode_file", $params)}
		{assign var="barcode_file" value=$params|@array_keys:"barcode_file"}
		<li class="parameter">Input barcode file : {$params[$barcode_file[0]+1]}.</li>
		{/if}
		{if in_array("barcode_score", $params)}
		{assign var="barcode_score" value=$params|@array_keys:"barcode_score"}
		<li class="parameter">Min identical base for barcode : {$params[$barcode_score[0]+1]}.</li>
		{/if}
	</ul>
{/block}


{block name=results_title} Reports {/block}
{block name=results}
51
	{assign var="analyse_results_sorted" value=$analyse_results["ONT_sample"]|@ksort}
52
53
54
55
	{assign var="metrics" value=$analyse_results["metrics"]}
	{assign var="basic" value=$analyse_results["ONT_sample"].basic}
	{assign var="quality" value=$analyse_results["ONT_sample"].quality}
	{assign var="plots" value=$analyse_results["ONT_sample"].plots}
56
	{assign var="plots_barcode" value=$analyse_results["ONT_sample"].plots_barcode}
57
58
59
60
61
62
63
64
	
	{assign var='basic_headers' value=','|explode:$metrics['basic'].headers}
	{assign var='basic_count' value=$basic_headers|@count}
    
	{assign var='quality_headers' value=','|explode:$metrics['quality'].headers}
	{assign var='quality_count' value=$quality_headers|@count}
	
	{assign var='plots_headers' value=','|explode:$metrics['plots'].headers}
65
66
67
68
69
70
71
72
73
	{assign var='plots_count' value=$plots_headers|@count}
	
	{assign var='plots_barcode_headers' value=','|explode:$metrics['plots_barcode'].headers}
	{assign var='plots_barcode_count' value=$plots_barcode_headers|@count}
    
	{assign var='barcode_headers' value=','|explode:$metrics['barcode'].headers|@ksort}
	{assign var='barcode_headers_count' value=$barcode_headers|@count}
    {assign var='barcode_name_sample' value=','|explode:$metrics['barcode'].names|@ksort}
    {assign var='barcode_name_count' value=$barcode_name_sample|@count}
74
75
    
    {*debug*}
76
	
77
78
79
80
81
82
		<legend>Analyse results report - Sample name : {$descriptions.sample_1}</legend>
		
		{assign var='data_col' value=2}
		<div class="row">
			{if $metrics['basic']}
				<div class="col-md-4 col-lg-4">
83
					<table id="ont_table_basic" class="table table-striped table-bordered dataTable">
84
					<thead><tr><th colspan="2"><h4>Basic metrics report</h4></thead></tr></th>
85
86
87
						<tbody>
						{foreach from=$basic_headers key=k item=head}
							<tr>
88
89
								{if ($head == 'median_yield_per_sec')}
									<td><label>{$head|replace:'_':' '}</label></td>
90
91
									<td>{($basic.$head)|number_format:2:',':' '}</td>
								{else}
92
									<td><label>{$head|replace:'_':' '}</label></td>
93
94
95
96
97
98
99
100
101
102
103
									<td>{($basic.$head)|number_format:0:',':' '}</td>
								{/if}
							</tr>
							{$data_col = $data_col + 1}
						{/foreach}
						</body>
					</table>
				</div>
			{/if}
			{if $metrics['quality']}
				<div class="col-md-4 col-lg-4">
104
					<table id="ont_table_quality" class="table table-striped table-bordered dataTable">
105
106
107
108
						<thead><tr><th colspan="2"><h4>Quality report</h4></thead></tr></th>
					<tbody>
						{foreach from=$quality_headers key=k item=head}
							<tr>
109
110
								{if ($head == 'median_read_quality')  or ($head == 'median read quality')}
									<td><label>{$head|replace:'_':' '}</label></td>
111
									<td>{($quality.$head)|number_format:2:',':' '}</td>
112
113
114
								{elseif ($head == 'N50_read_length_utils') or ($head == 'N50_read_length_useful_data')}
									<td><label>N50 read length useful data</label></td>
									<td>{($quality.$head)|number_format:0:',':' '}
115
								{elseif $head|strstr:"nb_read"}
116
									<td><label>{$head|replace:'_':' '|replace:'utils':'useful data'}</label></td>
117
									<td>{($quality.$head)|number_format:0:',':' '} ({($quality.$head / $basic.nb_reads*100)|number_format:2:',':' '}%)</td>
118
119
								{elseif $head|strstr:"total_bases"}
									<td><label>{$head|replace:'_':' '|replace:'utils':'useful data'}</label></td>
120
121
122
123
124
125
126
127
128
129
130
									<td>{($quality.$head)|number_format:0:',':' '} ({($quality.$head / $basic.total_bases*100)|number_format:2:',':' '}%)</td>
								{/if}
							</tr>
							{$data_col = $data_col + 1}
						{/foreach}
					</tbody>
					</table>
				</div>
			{/if}
			{if $metrics['plots']}
				<div class="col-md-3 col-lg-3">
131
					<table id="ont_table_plot" class="table table-striped table-bordered dataTable">
132
133
134
135
						<thead><tr><th colspan="2"><h4>Plots report</h4></h4></thead></tr></th>
					<tbody>
						{foreach from=$plots_headers key=k item=head}
							<tr>
136
									<td><label>{$head|replace:'_':' '|replace:'utils':'useful data'}</label></td>
137
138
139
140
									<td><a class="imglink" href="{$plots.$head}" ><i class="glyphicon glyphicon-picture"></i></a></td>
							</tr>
							{$data_col = $data_col + 1}
						{/foreach}
141
142
143
						{if $barcode_name_count > 1 }
						{foreach from=$plots_barcode_headers key=k item=head}
							<tr>
144
									<td><label>{$head|replace:'_':' '|replace:'utils':'useful data'}</label></td>
145
146
147
148
149
									<td><a class="imglink" href="{$plots_barcode.$head}" ><i class="glyphicon glyphicon-picture"></i></a></td>
							</tr>
							{$data_col = $data_col + 1}
						{/foreach}
						{/if}
150
151
152
153
154
					</tbody>
					</table>
				</div>
			{/if}
		</div>
155
	
156
157
158
159
	
	
	
	
Maxime Manno's avatar
Maxime Manno committed
160
	<br><br>
161
	{*If there are barcodes file in the run*}
162
	{if $barcode_name_count > 1 }	
163
	
164
	<table id="ont_stats_datatable" class="table table-striped table-bordered dataTable analysis-result-table">
165
166
		<thead>
			<tr>
167
				{assign var="nb_samples" value=$barcode_name_count}
168
				<th class="string-sort" rowspan="2" id="th_id_1"><center>Sample {if $nb_samples > 1 }({$nb_samples}){/if}</center></th>
169
        		<th colspan="{$barcode_headers_count}"><center>Barcode ONT results</center></th>
170
171
172
173
			</tr>
			<tr>
				{assign var="th_id" value=2}
				{foreach from=$barcode_headers key=k item=head}
174
					{if $head == 'total_bases'}
175
						<th class = "numeric-sort" id="th_id_{$th_id}">Total bases</th>
176
					{elseif $head == 'nb_reads'}
177
						<th class = "numeric-sort"  id="th_id_{$th_id}">Nb reads</th>
178
					{elseif $head == 'median_read_length'}
179
						<th class = "numeric-sort"  id="th_id_{$th_id}">Median read length</th>
180
					{elseif $head == 'median_read_quality'}
181
						<th class = "numeric-sort"  id="th_id_{$th_id}">Median read quality</th>
182
					{elseif $head == 'N50_read_length'}
183
						<th class = "numeric-sort"  id="th_id_{$th_id}">N50 read length</th>
184
					{elseif $head == 'barcode_score'}
185
						<th class = "numeric-sort"  id="th_id_{$th_id}">Barcode score</th>
186
					{elseif $head == 'median_yield_per_sec'}
187
188
189
190
191
192
193
						<th class = "numeric-sort"  id="th_id_{$th_id}">Median yield per sec</th>
					{elseif ($head == 'nb_read_utils') or ($head == 'nb_read_useful_data')}
						<th class = "numeric-sort"  id="th_id_{$th_id}">Nb reads useful data</th>
					{elseif ($head == 'total_bases_utils') or ($head == 'total_bases_useful_data')}
						<th class = "numeric-sort"  id="th_id_{$th_id}">Total bases useful data</th>
					{elseif ($head == 'N50_read_length_useful_data')}
						<th class = "numeric-sort"  id="th_id_{$th_id}">N50 read length useful data</th>
194
195
196
197
198
199
200
201
202
					{/if}
					{$th_id = $th_id +1}
				{/foreach}
			</tr>
		</thead>
		<tbody>
			{$i = 1}
			{assign var="totalReads" value=0}
			{assign var="totalBases" value=0}
203
204
205
206
207
208
			
            {foreach from=$analyse_results_sorted key=sample item=sample_results}
            	{if $sample|in_array:$barcode_name_sample}
            		<tr>
						<td id='sample_{$i}_col_1' class="sample_name">{$sample}</td>
						{$col_id = 2}
209
						{foreach from=$barcode_headers key=k item=head}
210
211
						
							{if $head == 'total_bases'}
Maxime Manno's avatar
Maxime Manno committed
212
								<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
213
							{elseif $head == 'nb_reads'}
Maxime Manno's avatar
Maxime Manno committed
214
								<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
215
							{elseif $head == 'median_read_length'}
Maxime Manno's avatar
Maxime Manno committed
216
								<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
217
							{elseif $head == 'median_read_quality'}
Maxime Manno's avatar
Maxime Manno committed
218
								<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:1:',':' '}</th>
219
							{elseif $head == 'N50_read_length'}
Maxime Manno's avatar
Maxime Manno committed
220
								<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
221
							{elseif $head == 'barcode_score'}
Maxime Manno's avatar
Maxime Manno committed
222
								<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:1:',':' '}</th>
223
							{elseif $head == 'median_yield_per_sec'}
Maxime Manno's avatar
Maxime Manno committed
224
								<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
225
							{elseif ($head == 'nb_read_utils') or ($head == 'nb_read_useful_data')}
Maxime Manno's avatar
Maxime Manno committed
226
								<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
227
							{elseif ($head == 'total_bases_utils') or ($head == 'total_bases_useful_data')}
Maxime Manno's avatar
Maxime Manno committed
228
								<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
229
							{elseif ($head == 'N50_read_length_useful_data')}
Maxime Manno's avatar
Maxime Manno committed
230
								<th id="sample_{$i}_col_{$col_id}">{($sample_results.$head)|number_format:0:',':' '}</th>
231
232
233
							{/if}
							
							{$col_id = $col_id + 1}
234
						{/foreach}
235
236
237
238
239
					</tr>
					{$i = $i + 1}
          		{/if}
            {/foreach}

240
		</tbody>
Maxime Manno's avatar
Maxime Manno committed
241
	   {*	
242
	   	<tfoot>
243
			<tr>	
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
				<th>Total : </th>
				<th>&nbsp;</th>
				{foreach from=$barcode_headers key=k item=head}
					{if $head == 'Reads'}
						<th>{$totalReads|number_format:0:',':' '}</th>
					{elseif $head == 'Bases'}
						<th>{$totalBases|number_format:0:',':' '}</th>
					{/if}
				{/foreach}
			</tr>
			<tr>
				<th>Mean : </th>
				<th>&nbsp;</th>
				{foreach from=$barcode_headers key=k item=head}
					{if $head == 'Reads'}
						<th>{($totalReads/$nb_samples)|number_format:0:' ':' '}</th>
					{elseif $head == 'Bases'}
						<th>{($totalBases/$nb_samples)|number_format:0:' ':' '}</th>
					{/if}
				{/foreach}
			</tr>
			<tr>
				<th>All metrics :  <input type="checkbox" id="check_all_metrics"></th>
				<th>&nbsp;</th>
				{$th_id = 2}
				{foreach from=$barcode_headers key=k item=head}
					<th><center><input type="checkbox" id="chk_col_{$th_id}"></center></th>
					{$th_id = $th_id +1}
				{/foreach}
			</tr>
			<tr>
				<th align="left" colspan="{$th_id}">
					With selection :
					<button type="button" class="btn btn-default multiple-selection-btn" id="create_graph"><i class="glyphicon glyphicon-signal"></i> Compare</button>
				</th>
			</tr>
		</tfoot>
Maxime Manno's avatar
Maxime Manno committed
281
		*}
282
	</table>
Maxime Manno's avatar
Maxime Manno committed
283
	<br><br>
284
285
	{/if}

286
287
288



289
290
291
292
293
	<div class="tx-nG6-pi1-help">
		<img src="" alt="" class="img" />
		<p>Help for Basic metrics report :</p>
		<span class="meta">
			<ul>
294
				<li><strong>Nb reads</strong> : 
maxime mano's avatar
maxime mano committed
295
					The total number of reads for this Flow Cell (including the reads that are filtered during the basecalling).
296
				</li>
297
				<li><strong>Total bases</strong> : 
298
299
					The number of bases for this Flow Cell.
				</li>
300
301
				<li><strong>Median/Mean read length</strong> : 
					The median or mean length of the total reads (bases).
302
				</li>
303
				<li><strong>N50 read length</strong> : 
304
305
					50% of all bases come from reads longer than this value.
				</li>
306
				<li><strong>Median yield per sec</strong> : 
307
308
309
310
311
312
313
314
315
316
					The median number of bases per second for the pores of this Flow Cell.
				</li>
			</ul>
		</span>
	</div>
	<div class="tx-nG6-pi1-help">
		<img src="" alt="" class="img" />
		<p>Help for Quality report :</p>
		<span class="meta">
			<ul>
317
				<li><strong>Median read quality</strong> : 
318
319
					The median quality (qscore ONT) for this Flow Cell.
				</li>
320
				<li><strong>Nb read/bases useful data</strong> : 
321
322
					The total number of reads/bases for the reads that have a quality > 7 and a length > 3000bp.
				</li>
323
324
325
				<li><strong>N50 read length useful data</strong> : 
					50% of all bases come from reads longer than this value for the reads that have a quality > 7 and a length > 3000bp.
				</li>
326
327
328
329
330
331
332
333
334
			</ul>
		</span>
	</div>
	
	<div class="tx-nG6-pi1-help">
		<img src="" alt="" class="img" />
		<p>Help for Plots report :</p>
		<span class="meta">
			<ul>
335
				<li><strong>Cumulate yield per hour</strong> : 
336
337
					The cumulate number of bases per hour for this Flow Cell.
				</li>
338
				<li><strong>outrm </strong> : 
339
340
					The outsiders have been removed.
				</li>
341
				<li><strong>Distribution length</strong> : 
342
343
					The length distribution of reads for this Flow Cell.
				</li>
344
				<li><strong>Distribution qscore</strong> : 
345
346
					The quality (qscore ONT) distribution of reads for this Flow Cell.
				</li>
347
				<li><strong> Length vs qscore density</strong> : 
348
349
					The length and qscore distribution of reads with density for this Flow Cell.
				</li>
350
				{if $barcode_name_count > 1 }
351
				<li><strong> Qscore boxplot</strong> : 
352
353
					Boxplots for each barcode of the mean qscore of reads for this Flow Cell.
				</li>
354
				<li><strong> Qscore per time intervals boxplot</strong> : 
355
356
357
					Boxplots for each barcode of the mean qscore of reads per interval of time for this Flow Cell.
				</li>
				{/if}
358
359
360
			</ul>
		</span>
	</div>
361
362
363
364
365
366
367
368
369
370
371
372
373
	{if $barcode_name_count > 1 }
		<div class="tx-nG6-pi1-help">
			<img src="" alt="" class="img" />
			<p>Help for Barcode ONT results :</p>
			<span class="meta">
			<ul>
				<li><strong>Barcode score</strong> :
					The quality score of the barcode alignment.
				</li>
			</ul>
			</span>
		</div>
	{/if}
374
375
{/block}