Commit ffaa9b76 authored by Maxime Manno's avatar Maxime Manno 🍜
Browse files

Update ONT Runstats visualisation

parent 14d919ed
...@@ -18,32 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -18,32 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{extends file='AnalysisTemplate.tpl'} {extends file='AnalysisTemplate.tpl'}
{block name=params} {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}
...@@ -58,6 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -58,6 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{/if} {/if}
{assign var="template_status" value=$analyse_results["metrics"].analyse_info.template_status} {assign var="template_status" value=$analyse_results["metrics"].analyse_info.template_status}
{assign var="metrics" value=$analyse_results["metrics"]} {assign var="metrics" value=$analyse_results["metrics"]}
{* If it is the version 2.0 of the Runstats analysis *}
{if $template_status == "2.0"} {if $template_status == "2.0"}
{assign var="sample_name" value=$analyse_results["metrics"].analyse_info.Sample_name} {assign var="sample_name" value=$analyse_results["metrics"].analyse_info.Sample_name}
{assign var="rawdata" value=$analyse_results[$sample_name].rawdata} {assign var="rawdata" value=$analyse_results[$sample_name].rawdata}
...@@ -158,7 +134,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -158,7 +134,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<td><label>{$head|replace:'_':' '|replace:'utils':'useful data'}</label></td> <td><label>{$head|replace:'_':' '|replace:'utils':'useful data'}</label></td>
<td><a class="imglink" href="{$plots.$head}" ><i class="glyphicon glyphicon-picture"></i></a></td> <td><a class="imglink" href="{$plots.$head}" ><i class="glyphicon glyphicon-picture"></i></a></td>
</tr> </tr>
{$data_col = $data_col + 1}
{/foreach} {/foreach}
{if $barcode_name_count > 1 } {if $barcode_name_count > 1 }
{foreach from=$plots_barcode_headers key=k item=head} {foreach from=$plots_barcode_headers key=k item=head}
...@@ -166,7 +141,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -166,7 +141,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<td><label>{$head|replace:'_':' '|replace:'utils':'useful data'}</label></td> <td><label>{$head|replace:'_':' '|replace:'utils':'useful data'}</label></td>
<td><a class="imglink" href="{$plots_barcode.$head}" ><i class="glyphicon glyphicon-picture"></i></a></td> <td><a class="imglink" href="{$plots_barcode.$head}" ><i class="glyphicon glyphicon-picture"></i></a></td>
</tr> </tr>
{$data_col = $data_col + 1}
{/foreach} {/foreach}
{/if} {/if}
</tbody> </tbody>
...@@ -175,88 +149,58 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -175,88 +149,58 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{/if} {/if}
</div> </div>
{* If it is the version 2.0 of the Runstats analysis *}
{else} {else}
{assign var='data_col' value=2}
<div class="row"> <div class="row">
{if $metrics['rawdata']} <div class="col-md-6 col-lg-6">
<div class="col-md-4 col-lg-4"> {if $metrics['rawdata'] and $metrics['Q7'] and $metrics['Q7']}
<table id="ont_table_rawdata" class="table table-striped table-bordered dataTable"> <table id="ont_table_rawdata" class="table table-striped table-bordered dataTable" style="white-space:nowrap;">
<thead><tr><th colspan="2"><h4>Rawdata metrics report</h4></thead></tr></th> <thead>
<tr><th colspan="4"><h4><center>ONT Metrics report</center</h4></th></tr>
<tr>
<th colspan="1"><h4>Metrics</h4></th>
<th colspan="1"><h4>Rawdata</h4></th>
<th colspan="1"><h4>Q7</h4></th>
<th colspan="1"><h4>Q9</h4></th>
</tr>
</thead>
<tbody> <tbody>
{foreach from=$rawdata_headers key=k item=head} {foreach from=$rawdata_headers key=k item=head}
{assign var="headQ7" value=$head|cat:"_Q7"}
{assign var="headQ9" value=$head|cat:"_Q9"}
<tr> <tr>
{if ($head == 'mean_read_quality')} {if ($head == 'mean_read_quality')}
<td><label>{$head|replace:'_':' '}</label></td> <td><label>{$head|replace:'_':' '}</label></td>
<td>{($rawdata.$head)|number_format:2:',':' '}</td> <td>{($rawdata.$head)|number_format:2:',':' '}</td>
{else} <td>{($Q7.$headQ7)|number_format:2:',':' '}</td>
<td>{($Q9.$headQ9)|number_format:2:',':' '}</td>
{elseif ($head == 'nb_reads')}
<td><label>{$head|replace:'_':' '}</label></td> <td><label>{$head|replace:'_':' '}</label></td>
<td>{($rawdata.$head)|number_format:0:',':' '}</td> <td>{($rawdata.$head)|number_format:0:',':' '}</td>
{/if} <td>{($Q7.$headQ7)|number_format:0:',':' '} ({($Q7.$headQ7 / $rawdata.nb_reads*100)|number_format:2:',':' '}%)</td>
</tr> <td>{($Q9.$headQ9)|number_format:0:',':' '} ({($Q9.$headQ9 / $rawdata.nb_reads*100)|number_format:2:',':' '}%)</td>
{$data_col = $data_col + 1} {elseif ($head == 'total_bases')}
{/foreach}
</body>
</table>
</div>
{/if}
{if $metrics['Q7'] and $metrics['Q7']}
<div class="col-md-4 col-lg-4">
<table id="ont_table_filtered" class="table table-striped table-bordered dataTable">
<thead><tr><th colspan="2"><h4>Filtered Q7 metrics report</h4></thead></tr></th>
<tbody>
{foreach from=$Q7_headers key=k item=head}
<tr>
{if ($head == 'mean_read_quality_Q7')}
<td><label>{$head|replace:'_':' '}</label></td>
<td>{($Q7.$head)|number_format:2:',':' '}</td>
{elseif ($head == 'N50_read_length_Q7')}
<td><label>N50 read length Q7</label></td>
<td>{($Q7.$head)|number_format:0:',':' '}
{elseif $head|strstr:"nb_reads_Q7"}
<td><label>{$head|replace:'_':' '}</label></td>
<td>{($Q7.$head)|number_format:0:',':' '} ({($Q7.$head / $rawdata.nb_reads*100)|number_format:2:',':' '}%)</td>
{elseif $head|strstr:"total_bases_Q7"}
<td><label>{$head|replace:'_':' '}</label></td>
<td>{($Q7.$head)|number_format:0:',':' '} ({($Q7.$head / $rawdata.total_bases*100)|number_format:2:',':' '}%)</td>
{else}
<td><label>{$head|replace:'_':' '}</label></td>
<td>{($Q7.$head)|number_format:0:',':' '}
{/if}
</tr>
{$data_col = $data_col + 1}
{/foreach}
</tbody>
<thead><tr><th colspan="2"><h4>Filtered Q9 metrics report</h4></thead></tr></th>
<tbody>
{foreach from=$Q9_headers key=k item=head}
<tr>
{if ($head == 'mean_read_quality_Q9')}
<td><label>{$head|replace:'_':' '}</label></td>
<td>{($Q9.$head)|number_format:2:',':' '}</td>
{elseif ($head == 'N50_read_length_Q9')}
<td><label>N50 read length Q9</label></td>
<td>{($Q9.$head)|number_format:0:',':' '}
{elseif $head|strstr:"nb_reads_Q9"}
<td><label>{$head|replace:'_':' '}</label></td>
<td>{($Q9.$head)|number_format:0:',':' '} ({($Q9.$head / $rawdata.nb_reads*100)|number_format:2:',':' '}%)</td>
{elseif $head|strstr:"total_bases_Q9"}
<td><label>{$head|replace:'_':' '}</label></td> <td><label>{$head|replace:'_':' '}</label></td>
<td>{($Q9.$head)|number_format:0:',':' '} ({($Q9.$head / $rawdata.total_bases*100)|number_format:2:',':' '}%)</td> <td>{($rawdata.$head)|number_format:0:',':' '}</td>
<td>{($Q7.$headQ7)|number_format:0:',':' '} ({($Q7.$headQ7 / $rawdata.total_bases*100)|number_format:2:',':' '}%)</td>
<td>{($Q9.$headQ9)|number_format:0:',':' '} ({($Q9.$headQ9 / $rawdata.total_bases*100)|number_format:2:',':' '}%)</td>
{else} {else}
<td><label>{$head|replace:'_':' '}</label></td> <td><label>{$head|replace:'_':' '}</label></td>
<td>{($Q9.$head)|number_format:0:',':' '} <td>{($rawdata.$head)|number_format:0:',':' '}</td>
<td>{($Q7.$headQ7)|number_format:0:',':' '}</td>
<td>{($Q7.$headQ7)|number_format:0:',':' '}</td>
{/if} {/if}
</tr> </tr>
{$data_col = $data_col + 1}
{/foreach} {/foreach}
</tbody> </tbody>
</table> </table>
</div>
{/if} {/if}
{if $metrics['plots']} </div>
<div class="col-md-3 col-lg-3"> <div class="col-md-3 col-lg-3">
{if $metrics['plots']}
<table id="ont_table_plot" class="table table-striped table-bordered dataTable"> <table id="ont_table_plot" class="table table-striped table-bordered dataTable">
<thead><tr><th colspan="2"><h4>Plots report</h4></h4></thead></tr></th> <thead><tr><th colspan="2"><h4><center>Plots report</center></h4></h4></thead></tr></th>
<tbody> <tbody>
{foreach from=$plots_headers key=k item=head} {foreach from=$plots_headers key=k item=head}
<tr> <tr>
...@@ -286,7 +230,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -286,7 +230,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{/if} {/if}
{/if} {/if}
</tr> </tr>
{$data_col = $data_col + 1}
{/foreach} {/foreach}
{if $barcode_name_count > 1 } {if $barcode_name_count > 1 }
{foreach from=$plots_barcode_headers key=k item=head} {foreach from=$plots_barcode_headers key=k item=head}
...@@ -294,15 +237,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -294,15 +237,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<td><label>{$head|replace:'_':' '}</label></td> <td><label>{$head|replace:'_':' '}</label></td>
<td><a class="imglink" href="{$plots_barcode.$head}" ><i class="glyphicon glyphicon-picture"></i></a></td> <td><a class="imglink" href="{$plots_barcode.$head}" ><i class="glyphicon glyphicon-picture"></i></a></td>
</tr> </tr>
{$data_col = $data_col + 1}
{/foreach} {/foreach}
{/if} {/if}
</tbody> </tbody>
</table> </table>
</div>
{/if} {/if}
</div> </div>
</div>
{/if} {/if}
<br><br> <br><br>
...@@ -411,47 +352,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -411,47 +352,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{/foreach} {/foreach}
</tbody> </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> </table>
<br><br> <br><br>
{/if} {/if}
...@@ -495,6 +395,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -495,6 +395,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
Filtered data composed by reads with length > 3000 and quality > 7. Filtered data composed by reads with length > 3000 and quality > 7.
</li> </li>
{/if} {/if}
{if $template_status == "2.0"}
<li><strong>Q7</strong> :
Filtered data composed by reads with quality > 7.
</li>
<li><strong>Q9</strong> :
Filtered data composed by reads with quality > 9.
</li>
{/if}
</ul> </ul>
</span> </span>
</div> </div>
......
Markdown is supported
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