<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="Anvi'o">
    <base target="_blank">

    <title>Anvi'o: {{ meta|lookup:"profile"|lookup:"sample_id"|humanize }}</title>

    <!-- Bootstrap Core CSS -->
    <link href=".html/css/bootstrap.css" rel="stylesheet">
    <link href=".html/bootstrap-sortable/Contents/bootstrap-sortable.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href=".html/css/anvio.css" rel="stylesheet">
</head>

<body>
    <!-- Navigation -->
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li>
                        <a href="http://merenlab.org/projects/anvio">Anvi'o Project Page</a>
                    </li>
                    <li>
                        <a href="https://github.com/meren/anvio">Anvi'o Repository</a>
                    </li>
                    <li>
                        <a href="https://github.com/meren/anvio/issues">Report an Issue</a>
                    </li>
                    <li>
                        <a href="http://merenlab.org/people">Contact</a>
                    </li>
                    <li>
                        <a href="https://github.com/meren/anvio/releases">Anvi'o version: {{ meta|lookup:"anvio_version" }}</a>
                    </li>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container -->
    </nav>


    <header class="image-bg-fluid-height">
        <div class="header-summary-div">
            <div style="width: 200px;">
                <img class="img-responsive img-left"src=".html/pics/logo.png" alt="">
            </div>
            <div class="header-text">
                <b>A very quick overlook</b> at bins stored in the "<b>{{ meta|lookup:"collection_name"|humanize }}</b>" collection. <br /><br /><small><i>For the final summary of your project, do not forget to run anvi-summarize without the '--quick' flag</i></small>.
            </div>
        </div>
    </header>


    <!-- BINS PANEL -->
    <section>
        <div class="container">
            <div class="panel panel-info" id="bins_panel">
                <div class="panel-heading">
                    <h1 class="panel-title"><a data-toggle="collapse" data-parent="#bins_panel" href="#collapse-bins">Summary ({{ meta|lookup:"num_bins"|pretty }})</a></h1>
                </div>

                <div id="collapse-bins" class="panel-collapse">
                    <div class="panel-body">
                        <p style="color: #AAAAAA; padding: 20px;">Summary of each bin (note: this is a "quick" overlook, and results in this table will be incomplete).</p>

                        <div class="panel panel-default">
                            <div class="panel-body">
                                <table class="table table-striped sortable" id="tblGrid_bin">
                                    <thead id="tblHead_bin">
                                        <tr>
                                            <th data-defaultsort='disabled' class="text-center"></th>
                                            <th>Bin</th>
                                            <th class="text-center">Source</th>

                                            {% if meta|lookup:"contigs"|lookup:"genes_annotation_source" %}
                                            <th class="text-center">Taxonomy</th>
                                            {% else %}
                                            <th class="text-center" data-defaultsort='disabled'>Taxonomy</th>
                                            {% endif %}

                                            <th class="text-center">Total Size</th>
                                            <th class="text-center">Num Contigs</th>
                                            <th class="text-center">GC Content</th>
                                            <th class="text-center">Compl.</th>
                                            <th class="text-center">Red.</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {% for bin in meta|lookup:"bins" %}
                                        <tr>
                                            <td style="vertical-align: middle; width: 18px;"><div style="width:18px; height: 18px; background-color: {{ collection|lookup:bin|lookup:"color" }}; fload:left; border-radius: 3px;">&nbsp;</div></td>
                                            <td style="vertical-align: middle;">{{ bin }}</td>
                                            <td class="text-center"  style="vertical-align: middle; font-style: italic;">{{ collection|lookup:bin|lookup:"source" }}</td>

                                            {% if meta|lookup:"contigs"|lookup:"genes_annotation_source" %}
                                            <td class="text-center" data-value="{{ collection|lookup:bin|lookup:"taxon" }}"><button type="button" class="btn btn-default" data-toggle="modal" data-target="#modTaxonomy_{{bin}}"><i>{{ collection|lookup:bin|lookup:"taxon" }}</i></button></td>
                                            {% else %}
                                            <td class="text-center">N/A</td>
                                            {% endif %}

                                            <td class="text-center" style="vertical-align: middle;" data-value="{{ collection|lookup:bin|lookup:"total_length" }}">{{ collection|lookup:bin|lookup:"total_length"|humanize_n }}</td>
                                            <td class="text-center" style="vertical-align: middle;" data-value="{{ collection|lookup:bin|lookup:"num_contigs" }}">{{ collection|lookup:bin|lookup:"num_contigs"|pretty }}</td>
                                            <td class="text-center" style="vertical-align: middle;" data-value="{{ collection|lookup:bin|lookup:"GC_content" }}">{{ collection|lookup:bin|lookup:"GC_content"|humanize_n }}%</td>
                                            {% if meta|lookup:"completeness_data_available" %}
                                            <td class="text-center" data-value="{{ collection|lookup:bin|lookup:"percent_complete" }}"><button type="button" class="btn btn-default" data-toggle="modal" data-target="#modCompleteness_{{bin}}">{{ collection|lookup:bin|lookup:"percent_complete"|humanize_n }}%</button></td>
                                            <td class="text-center" style="vertical-align: middle;" data-value="{{ collection|lookup:bin|lookup:"percent_redundancy"|humanize_n }}">{{ collection|lookup:bin|lookup:"percent_redundancy"|humanize_n }}%</td>
                                            {% else %}
                                            <td class="text-center" style="vertical-align: middle;">N\A</td>
                                            <td class="text-center" style="vertical-align: middle;">N\A</td>
                                            {% endif %}
                                        </tr>
                                        {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>


    {% for bin in meta.collection %}

    <!-- TAXONOMY FOR GROUP -->
    <div class="modal fade" id="modTaxonomy_{{bin}}" role="dialog" aria-labelledby="modFiles" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title">Taxonomy calls for {{ bin|humanize }}</h4>
          </div>
          <div class="modal-body">
            <table class="table table-striped" id="tblGrid_tax_{{ bin }}">
                <thead id="tblHead_tax_{{ bin }}">
                  <tr>
                    <th>Taxon call</th>
                    <th>Relative occurrence</th>
                  </tr>
                </thead>
                <tbody>
                  {% for taxon_call in collection|lookup:bin|lookup:"taxon_calls" %}
                  <tr>
                    <td>{{ taxon_call.0 }}</td>
                    <td>{{ taxon_call.1|humanize_n }}%</td>
                  </tr>
                  {% endfor %}
                </tbody>
          </table>
            <p class="section-paragraph"></p>
          <p style="color: #AAAAAA; padding: 10px;">Taxonomy calls for splits in your {{ collection|lookup:bin|lookup:"num_contigs" }} contigs
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          </div>
        </div>
      </div>
    </div>

    <!-- COMPLETENESS INFO FOR GROUP -->
    {% if meta|lookup:"completeness_data_available" %}
    <div class="modal fade" id="modCompleteness_{{bin}}" role="dialog" aria-labelledby="modCompleteness" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title">Completeness estimations for "{{ bin|humanize }}"</h4>
          </div>
          <div class="modal-body">
            <table class="table table-striped" id="tblGrid_completeness_{{ bin }}">
                <thead id="tblHead_completeness_{{ bin }}">
                  <tr>
                    <th>Source</th>
                    <th class="text-center">Percent completeness</th>
                    <th class="text-center">Percent redundancy</th>
                  </tr>
                </thead>
                <tbody>
                  {% for source in collection|lookup:bin|lookup:"completeness" %}
                  <tr>
                    <td><a href="{{ collection|lookup:bin|lookup:'files'|lookup:source }}">{{ source|humanize }}</a></td>
                    <td class="text-center">{{ collection|lookup:bin|lookup:"completeness"|lookup:source|lookup:"percent_complete"|humanize_n }}%</td>
                    <td class="text-center">{{ collection|lookup:bin|lookup:"completeness"|lookup:source|lookup:"percent_redundancy"|humanize_n }}%</td>
                  </tr>
                  {% endfor %}
                </tbody>
          </table>
            <p class="section-paragraph"></p>
          <p style="color: #AAAAAA; padding: 10px;">See the documentation for more information on single-copy gene data.
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          </div>
        </div>
      </div>
    </div>
    {% endif %}

    {% endfor %}



    <div style="margin-bottom:200px"></div>

    <!-- jQuery -->
    <script src=".html/js/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src=".html/js/bootstrap.min.js"></script>

    <!-- Table sorter, source: https://github.com/drvic10k/bootstrap-sortable -->
    <script src=".html/bootstrap-sortable/Scripts/bootstrap-sortable.js"></script>

    <!-- Activate tooltips... -->
    <script type="text/javascript">
    $(document).ready(function() {
        $("body").tooltip({ selector: '[data-toggle=tooltip]' });
    });
</script>
</body>
</html>
