Skip to content
Snippets Groups Projects
Commit 3e49424b authored by gsalin's avatar gsalin
Browse files

add total/mean values for demultiplex_ont

parent f4a00f4d
No related branches found
No related tags found
1 merge request!160update demulitplexont analysis in NG6
......@@ -36,6 +36,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{assign var="stats_metrics" value=$analyse_results["stats_metrics"]|@ksort}
{assign var="stats_headers" value=','|explode:$analyse_results["metrics"].stats_names.headers}
{assign var="stats_names" value=['format' => 'Format','num_seqs' => 'NB Sequences','sum_len' => 'Total Length','avg_len' => 'Mean Length','min_len' => 'Min Length','max_len' => 'Max Length','N50' => 'N50']}
{assign var="totalNbSequences" value=0}
{assign var="totalLength" value=0}
{assign var="totalAvgLength" value=0}
{assign var="totalMinLength" value=0}
{assign var="totalMaxLength" value=0}
{assign var="totalN50" value=0}
<table id="ont_stats_datatable" class="table table-striped table-bordered dataTable analysis-result-table" style="white-space:nowrap;">
<thead>
......@@ -45,14 +51,45 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{/foreach}
</thead>
<tbody>
{foreach from=$stats_metrics key=fastq item=fastq_metrics}
<tr><th>{$fastq}</th>
{foreach from=$stats_headers key=k item=stat}
<td>{$fastq_metrics[$stat]}</td>
{/foreach}
</tr>
{/foreach}
</tbody>
{foreach from=$stats_metrics key=fastq item=fastq_metrics}
<tr><th>{$fastq}</th>
{foreach from=$stats_headers key=k item=stat}
{if $stat == "num_seqs"}{$totalNbSequences=$totalNbSequences+$fastq_metrics[$stat]|replace:',':''|replace:'.':','}{/if}
{if $stat == "sum_len"}{$totalLength=$totalLength+$fastq_metrics[$stat]|replace:',':''|replace:'.':','}{/if}
{if $stat == "avg_len"}{$totalAvgLength=$totalAvgLength+$fastq_metrics[$stat]|replace:',':''|replace:'.':','}{/if}
{if $stat == "min_len"}{$totalMinLength=$totalMinLength+$fastq_metrics[$stat]|replace:',':''|replace:'.':','}{/if}
{if $stat == "max_len"}{$totalMaxLength=$totalMaxLength+$fastq_metrics[$stat]|replace:',':''|replace:'.':','}{/if}
{if $stat == "N50"}{$totalN50=$totalN50+$fastq_metrics[$stat]|replace:',':''|replace:'.':','}{/if}
<td>{$fastq_metrics[$stat]|replace:',':''|replace:'.':','|number_format:0:' ':' '}</td>
{/foreach}
</tr>
{/foreach}
</tbody>
{if $analyse_results|@count > 1 }
<tfoot>
<tr>
<th></th>
<th>Total</th>
<th>{$totalNbSequences|number_format:0:' ':' '}</th>
<th>{$totalLength|number_format:0:' ':' '}</th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<th></th>
<th>Mean</th>
<th>{($totalNbSequences/($stats_metrics|@count))|number_format:0:' ':' '}</th>
<th>{($totalLength/($stats_metrics|@count))|number_format:0:' ':' '}</th>
<th>{($totalAvgLength/($stats_metrics|@count))|number_format:0:' ':' '}</th>
<th>{($totalMinLength/($stats_metrics|@count))|number_format:0:' ':' '}</th>
<th>{($totalMaxLength/($stats_metrics|@count))|number_format:0:' ':' '}</th>
<th>{($totalN50/($stats_metrics|@count))|number_format:0:' ':' '}</th>
</tr>
</tfoot>
{/if}
</table>
{* Help block *}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment