{% extends "tab-child.html" %}

{% block content %}
{% set directions = ['forward', 'reverse'] %}

<div class="row">
    <div class="col-lg-12">
        <h1>Demultiplexed sequence counts summary</h1>
        {{ result_data }}
    </div>
</div>

<div class="row">
    {% for direction in directions %}
        <div class="col-lg-6">
            <h3>{{ direction|capitalize }} Reads Frequency Histogram</h3>
            <div class="text-center">
                {% if show_plot[direction] %}
                    <a href="demultiplex-summary-{{ direction }}.pdf">
                        <img src="demultiplex-summary-{{ direction }}.png">
                        <p>Download as PDF</p>
                    </a>
                {% else %}
                    <p>No reads in this direction</p>
                {% endif %}
            </div>
        </div>
    {% endfor %}
</div>

<div class="row">
    <div class="col-lg-12">
        <h1>Per-sample sequence counts</h1>
        <h4>
            Total Samples:&nbsp;
            {% for direction in directions %}
                {% if n_samples[direction] %}
                    {{ n_samples[direction] }} ({{ direction }})&nbsp;
                {% endif %}
            {% endfor %}
        </h4>
        {{ result }}
        <a href="per-sample-fastq-counts.tsv">Download as TSV</a>
    </div>
</div>
{% endblock %}
