Commit 3aaf88b8 authored by maxime mano's avatar maxime mano
Browse files

Add the Runstats template for the analysis of ONT data

parent 0fc44600
{*
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}
{assign var="analyse_results_sorted" value=$analyse_results|@ksort}
{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}
{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}
{assign var='plots_count' value=$quality_headers|@count}
{assign var='barcode_headers' value=','|explode:$metrics2['barcode_results'].headers|@ksort}
{assign var='barcode_results_count' value=$barcode_headers|@count}
{assign var='barcode_name_sample' value=','|explode:$metrics2['barcode_results'].barcode_sample|@ksort}
{*debug*}
<div>
<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">
<table id="ont_table_basic" class="table table-striped table-bordered dataTable analysis-result-table">
<thead><tr><th colspan="2"><h4>Basic matrics report</h4></thead></tr></th>
<tbody>
{foreach from=$basic_headers key=k item=head}
<tr>
{if ($head == 'median_yield_per_sec') or ($head == 'mean_yield_per_sec')}
<td><label>{$head}</label></td>
<td>{($basic.$head)|number_format:2:',':' '}</td>
{else}
<td><label>{$head}</label></td>
<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">
<table id="ont_table_quality" class="table table-striped table-bordered dataTable analysis-result-table">
<thead><tr><th colspan="2"><h4>Quality report</h4></thead></tr></th>
<tbody>
{foreach from=$quality_headers key=k item=head}
<tr>
{if ($head == 'median_read_quality') or ($head == 'mean_read_quality')}
<td><label>{$head}</label></td>
<td>{($quality.$head)|number_format:2:',':' '}</td>
{elseif $head|strstr:"nb_read_Q"}
<td><label>{$head}</label></td>
<td>{($quality.$head)|number_format:0:',':' '} ({($quality.$head / $basic.nb_reads*100)|number_format:2:',':' '}%)</td>
{else}
<td><label>{$head}</label></td>
<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">
<table id="ont_table_plot" class="table table-striped table-bordered dataTable analysis-result-table">
<thead><tr><th colspan="2"><h4>Plots report</h4></h4></thead></tr></th>
<tbody>
{foreach from=$plots_headers key=k item=head}
<tr>
<td><label>{$head}</label></td>
<td><a class="imglink" href="{$plots.$head}" ><i class="glyphicon glyphicon-picture"></i></a></td>
</tr>
{$data_col = $data_col + 1}
{/foreach}
</tbody>
</table>
</div>
{/if}
</div>
</div>
{*If there are barcodes file in the run*}
{if $barcode_results_count > 1 }
<table id="rs_subreads_datatable" class="table table-striped table-bordered dataTable analysis-result-table">
<thead>
<tr>
<th rowspan="2"><center><input type="checkbox" id="chk_all_sample"/></center></th>
{assign var="nb_samples" value=$barcode_name_sample|@count}
<th class="string-sort" rowspan="2" id="th_id_1"><center>Sample {if $nb_samples > 1 }({$nb_samples}){/if}</center></th>
<th colspan="{$barcode_results_count}"><center>Barcode SubReads results (Before filters)</center></th>
</tr>
<tr>
{assign var="th_id" value=2}
{foreach from=$barcode_headers key=k item=head}
{if $head == 'Reads'}
<th class = "numeric-sort" id="th_id_{$th_id}">NB SubReads</th>
{elseif $head == 'Bases'}
<th class = "numeric-sort" id="th_id_{$th_id}">NB Bases</th>
{/if}
{$th_id = $th_id +1}
{/foreach}
</tr>
</thead>
<tbody>
{$i = 1}
{assign var="totalReads" value=0}
{assign var="totalBases" value=0}
{foreach from=$analyse_results_sorted key=sample item=sample_results}
{if ($sample!="metrics2") and ($sample!="metrics")}
{foreach from=$barcode_name_sample item=sample}
<tr>
<td><center><input type="checkbox" id="chk_sample_{$i}" value="sample"/></center></td>
<td id='sample_{$i}_col_1' class="sample_name">{$sample}</td>
{$col_id = 2}
{foreach from=$barcode_headers key=k item=head}
{if $head == 'Reads'}
<td id="sample_{$i}_col_{$col_id}">{$sample_results[$sample].$head|number_format:0:',':' '}</td>
{$totalReads = $totalReads + $sample_results[$sample].$head}
{elseif $head == 'Bases'}
<td id="sample_{$i}_col_{$col_id}">{$sample_results[$sample].$head|number_format:0:',':' '}</td>
{$totalBases = $totalBases + $sample_results[$sample].$head}
{/if}
{$col_id = $col_id + 1}
{/foreach}
</tr>
{$i = $i + 1}
{/foreach}
{/if}
{/foreach}
{*
<div>
{$data_col = 2}
<div class="row">
<div class="col-md-2 col-lg-2">
<h4>Barcode SubReads results (Before filters)</h4>
<ul class="list-unstyled">
{foreach from=$barcode_headers key=k item=head}
<span class="checkbox"><label><input type="checkbox" data-column="{$data_col}" class="toogle-vis" checked/> {$head}</label></span>
{$data_col = $data_col + 1}
{/foreach}
</ul>
</div>
</div>
</div>
*}
</tbody>
<tfoot>
<tr>
<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>
</table>
{/if}
<div class="tx-nG6-pi1-help">
<img src="" alt="" class="img" />
<p>Help for Basic metrics report :</p>
<span class="meta">
<ul>
<li><strong>nb_reads</strong> :
The number of reads for this Flow Cell.
</li>
<li><strong>total_bases</strong> :
The number of bases for this Flow Cell.
</li>
<li><strong>median_read_length</strong> :
The median length of the total reads (bases).
</li>
<li><strong>N50_read_length</strong> :
50% of all bases come from reads longer than this value.
</li>
<li><strong>median_yield_per_sec</strong> :
The median number of bases per second for the pores of this Flow Cell.
</li>
<li><strong>nb_actif_channel</strong> :
The number of activ channels during the sequencing.
</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>
<li><strong>median_read_quality</strong> :
The median quality (qscore ONT) for this Flow Cell.
</li>
<li><strong>nb_read_Q>N</strong> :
The total number of reads that have a quality > N.
</li>
<li><strong>total_bases_Q>N</strong> :
The total number of bases for the reads that have a quality > N.
</li>
</ul>
</span>
</div>
<div class="tx-nG6-pi1-help">
<img src="" alt="" class="img" />
<p>Help for Plots report :</p>
<span class="meta">
<ul>
<li><strong>cumulyieldperhour</strong> :
The cumulate number of bases per hour for this Flow Cell.
</li>
<li><strong>outrm_</strong> :
The outsiders have been removed.
</li>
<li><strong>outrm_distriblength</strong> :
The length distribution of reads for this Flow Cell.
</li>
<li><strong>outrm_distribqscore</strong> :
The quality (qscore ONT) distribution of reads for this Flow Cell.
</li>
<li><strong>outrm_lengthvsqscore_density</strong> :
The length and qscore distribution of reads with density for this Flow Cell.
</li>
</ul>
</span>
</div>
{/block}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment