<!DOCTYPE html>
<html>
    <head>
        <title>Vaxrank Report</title>
        <meta charset="UTF-8">
        <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">
        <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/base-min.css">
        <style type="text/css">
            {% include "templates/stylesheet.css" %}
        </style>
    </head>
    <body>
        <div id="main">
        	<h1 id="report-header">Vaccine Peptides Report</h1>

        	<h3 id="patient-info">PATIENT INFO</h3>
            <table class="pure-table pure-table-bordered patient-info">
                <colgroup>
                    <col class="patient-info-column-one">
                    <col class="patient-info-column-two">
                </colgroup>
                {% for key, val in patient_info.items() %}
                <tr><td>{{ key }}</td><td>{{ val }}</td></tr>
                {% endfor %}
            </table>
        	<br>

            <h3 id="args">COMMAND LINE ARGUMENTS</h3>
            <table class="pure-table pure-table-bordered args">
                <colgroup>
                    <col class="args-column-one">
                    <col class="args-column-two">
                </colgroup>
                {% for key, val in args %}
                <tr><td class="arg">{{ key }}</td><td class="arg">{{ val }}</td></tr>
                {% endfor %}
            </table>
            {% if input_json_file %}
            <br><br><h4>Report generated from saved location: {{ input_json_file }}</h4>
            {% endif %}
        	<ol class="main">

            {% if variants %}
        	{% for v in variants %}
        	<li class="variant-list-item">
                <div class="variant-span">
            		<table class="pure-table pure-table-bordered variant">
            			<colgroup>
                        	<col class="variant-column-one">
                            <col class="variant-column-two">
                        </colgroup>
                        <thead class="variant-head">
                            <tr>
                                <td class="variant-head">Variant</td>
                                <td class="variant-head">{{ v.short_description }}</td>
                            </tr>
                        </thead>
                        {% for key, val in v.variant_data.items() %}
                        <tr><td>{{ key }}</td><td>{{ val }}</td></tr>
                        {% endfor %}
                    </table>
                    <br>

                    <h4 id="effects">Predicted Effect</h4>
                    <table class="pure-table pure-table-bordered">
                        {% for key, val in v.effect_data.items() %}
                        <tr><td>{{ key }}</td><td>{{ val }}</td></tr>
                        {% endfor %}
                	</table>
                	<br>

                    {% if v.databases %}
                    <h4 id="effects">Databases</h4>
                    <table class="pure-table pure-table-bordered">
                        {% for key, val in v.databases.items() %}
                        <tr><td>{{ key }}</td><td><a href="{{ val }}">{{ val }}</a></td></tr>
                        {% endfor %}
                    </table>
                    <br>
                    {% endif %}

            		<ol class="peptides" type="i">
            			{% for p in v.peptides %}
            			<li class="peptide">
            				<table class="pure-table pure-table-bordered peptide">
                                <thead>
                                    <tr><td class="peptide-inner-header">{{ p.header_display_data.aa_before_mutation }}<span class="mutant">{{ p.header_display_data.aa_mutant }}</span>{{ p.header_display_data.aa_after_mutation }}</td></tr>
                                </thead>
                                <tr><td class="peptide-inner">
                                    <table class="pure-table pure-table-bordered peptide-inner">
                                        <colgroup>
                                            <col class="peptide-data-column-one">
                                            <col class="peptide-data-column-two">
                                        </colgroup>
                                        {% for key, val in p.peptide_data.items() %}
                                        <tr><td>{{ key }}</td><td>{{ val }}</td></tr>
                                        {% endfor %}
                                    </table>
                                </td></tr>
                                {% if include_manufacturability %}
                                <tr><td class="peptide-inner-header">Manufacturability</td></tr>
                                <tr><td class="peptide-inner">
                                    <table class="pure-table pure-table-bordered peptide-inner">
                                        <colgroup>
                                            <col class="peptide-data-column-one">
                                            <col class="peptide-data-column-two">
                                        </colgroup>
                                        {% for key, val in p.manufacturability_data.items() %}
                                        <tr><td>{{ key }}</td><td>{{ val }}</td></tr>
                                        {% endfor %}
                                    </table>
                                </td></tr>
                                {% endif %}

                                <tr><td class="peptide-inner-header">Predicted mutant epitopes</td></tr>
                                <tr><td class="peptide-inner">
                                    <table class="pure-table epitope-inner">
                                    <colgroup>
                                        <col class="epitope-data-column-one">
                                        <col class="epitope-data-column-two">
                                        <col class="epitope-data-column-three">
                                        <col class="epitope-data-column-four">
                                        <col class="epitope-data-column-five">
                                        <col class="epitope-data-column-six">
                                    </colgroup>
                                        <thead>
                                            <tr>
                                                {% for key in p.epitopes[0] %}
                                                <td>{{ key }}</td>
                                                {% endfor %}
                                            </tr>
                                        </thead>
                                        {% for e in p.epitopes %}
                                        <tr>
                                            {% for _, val in e.items() %}
                                            <td>{{ val }}</td>
                                            {% endfor %}
                                        </tr>
                                        {% endfor %}
                                    </table>
                                </td></tr>
                            </table>
                            {% if include_wt_epitopes %}
                            <div class="wt-epitopes">
                            {% if p.wt_epitopes %}
                            <h4 class="wt-epitopes">Predicted strong binders that do not overlap the mutation</h4>
                            <table class="pure-table pure-table-bordered wt-epitopes">
                                <thead>
                                    <tr>
                                        <td>Sequence</td>
                                        <td>IC50</td>
                                        <td>Allele</td>
                                    </tr>
                                </thead>
                                {% for e in p.wt_epitopes %}
                                <tr>
                                    <td>{{ e["Sequence"] }}</td>
                                    <td>{{ e["IC50"] }}</td>
                                    <td>{{ e["Allele"] }}</td>
                                </tr>
                                {% endfor %}
                            </table>
                            {% else %}
                            <h4 class="wt-epitopes">No predicted strong binders that do not overlap the mutation.</h4>
                            {% endif %}
                            </div>
                            {% endif %}
            			</li>
            			{% endfor %}
            		</ol>
                </div>
        	</li>
        	{% endfor %}
            </ol>

            {% if reviewers %}
            <table class="pure-table pure-table-bordered reviewed-by">
                <thead>
                    <tr><td>Reviewed By</td></tr>
                </thead>
                {% for r in reviewers %}
                <tr><td>{{ r }}</td></tr>
                {% endfor %}
            </table>
            <br><br>
            {% endif %}

            <table class="pure-table pure-table-bordered signature">
                <thead>
                    <tr><td>Final Review</td></tr>
                </thead>
                <tr>
                    <td class="signature-inner">
                        <table class="pure-table signature-inner">
                            <colgroup>
                                <col class="signature-column-one">
                                <col class="signature-column-two">
                            </colgroup>
                            <tr><td>Name</td><td>{{ final_review }}</td></tr>
                            <tr><td>Signature</td><td></td></tr>
                            <tr><td>Date</td><td></td></tr>
                        </table>
                    </td>
                </tr>
            </table>
            {% else %}
            <h4>No variants with sufficient vaccine peptides were found.</h4>
            {% endif %}
        </div>
    </body>
</html>
