<!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">
                Bins that were identified in the <b>{% if meta|lookup:"profile"|lookup:"blank" %} blank {% else %}{% if meta|lookup:"profile"|lookup:"merged" == '1' %}
                merged {% else %} single {% endif %}{% endif %}</b> profile database '<b>{{ meta|lookup:"profile"|lookup:"sample_id"|humanize }}</b>' and stored in the
                database as "<b>{{ meta|lookup:"collection_name"|humanize }}</b>" collection, describe <b>{{ meta|lookup:"num_bins"|pretty }}</b> bins accountig for
                <b>{{ meta|lookup:"total_nts_in_collection"|pretty }}</b> nucleotides, which represent <b>{{ meta|lookup:"percent_contigs_nts_described_by_collection" }}%</b>
                of all nucleotides stored in the contigs database{% if not meta|lookup:"profile"|lookup:"blank" %}, and
                <b>{{ meta|lookup:"percent_profile_nts_described_by_collection" }}%</b> of nucleotides stored in the profile database{% endif %}.
            </div>
        </div>
    </header>


    <section>
        <div class="container">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h1 class="panel-title"><a data-toggle="collapse" data-parent="#basics_panel" href="#collapse-basics">Basics</a></h1>
                </div>

                <div id="collapse-basics" class="panel-collapse collapse in">

                <div class="well" style="margin: 10px;">The {% if meta|lookup:"profile"|lookup:"blank" %} blank {% else %}{% if meta|lookup:"profile"|lookup:"merged" == '1' %} merged {% else %} single {% endif %}{% endif %} profile database that was generated
                                                        with the minimum contig length of <b>{{ meta|lookup:"profile"|lookup:"min_contig_length"|pretty }}</b>
                                                        contained <b>{{ meta|lookup:"profile"|lookup:"num_contigs"|pretty }}</b> contigs, which correspond to
                                                        <b>{{ meta|lookup:"percent_contigs_contigs_described_by_profile"|pretty }}%</b> of all contigs, and
                                                        <b>{{ meta|lookup:"percent_contigs_nts_described_by_profile"|pretty }}%</b> of all nucleotides found
                                                        in the contigs database.
                                                        </div>

                <div class="row">
                    {% if not meta|lookup:"profile"|lookup:"blank" %}
                    <div class="col-lg-6 col-md-6 col-sm-6">
                      <div class="panel panel-default" style="margin-left:10px;">
                            <div class="panel-heading">
                                Profile DB for <b>{{ meta|lookup:"profile"|lookup:"sample_id"|humanize }}</b> w/ {{ meta|lookup:"profile"|lookup:"samples"|length|pretty }} samples.
                            </div>
                            <div class="panel-body">
                                <table class="table table-striped">
                                    <thead id="tblHead_basics_profile">
                                        <tr>
                                            <th>Key</th>
                                            <th>Value</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {% for entry in basics_pretty|lookup:"profile" %}
                                        <tr>
                                            <td>{{ entry.0 }}</td>
                                            <td>{{ entry.1 }}</td>
                                        </tr>
                                      {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    {% endif %}

                    {% if meta|lookup:"profile"|lookup:"blank" %}
                    <div class="col-lg-12 col-md-12 col-sm-12">
                        <div class="panel panel-default" style="margin-right:10px; margin-left:10px;">
                    {% else %}
                    <div class="col-lg-6 col-md-6 col-sm-6">
                        <div class="panel panel-default" style="margin-right:10px;">
                    {% endif %}
                            <div class="panel-heading">
                                Contigs DB
                            </div>
                            <div class="panel-body">
                                <table class="table table-striped">
                                    <thead id="tblHead_basics_contigs">
                                        <tr>
                                            <th>Key</th>
                                            <th>Value</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {% for entry in basics_pretty|lookup:"contigs" %}
                                        <tr>
                                            <td>{{ entry.0 }}</td>
                                            <td>{{ entry.1 }}</td>
                                        </tr>
                                      {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                </div>
            </div>
        </div>
    </section>


    <!-- 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 collapse">
                    <div class="panel-body">
                        <p style="color: #AAAAAA; padding: 20px;">Summary of general characteristics of each bin (<a href="{{ files|lookup:'general_bins_summary' }}">download as TAB-delimited file</a>).</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">N50</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:"taxonomy_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" data-value="{{ collection|lookup:bin|lookup:"total_length" }}"><button type="button" class="btn btn-default" data-toggle="modal" data-target="#modFiles_{{bin}}">{{ collection|lookup:bin|lookup:"total_length"|humanize_n }}</button></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:"N50" }}">{{ collection|lookup:bin|lookup:"N50"|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>

    <!-- FILES FOR GROUP -->
    <div class="modal fade" id="modFiles_{{bin}}" role="dialog" aria-labelledby="modFiles" aria-hidden="true">
      <div class="modal-dialog" style="width: 900px;">
        <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">Static files for {{ bin|humanize }}</h4>
          </div>
          <div class="modal-body">
            <table class="table table-striped" id="tblGrid_files_{{ bin }}">
                <thead id="tblHead_files_{{ bin }}">
                  <tr>
                    <th>File</th>
                    <th>Location</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td><b>Contigs FASTA</b></td>
                    <td><a href="{{ collection|lookup:bin|lookup:"files"|lookup:"contigs" }}">{{ collection|lookup:bin|lookup:"files"|lookup:"contigs" }}</a></td>
                  </tr>
                  {% for fname in collection|lookup:bin|lookup:"files" %}
                  {% if fname != "contigs" %}
                  <tr>
                    <td>{{ fname  }}</td>
                    <td><a href="{{ collection|lookup:bin|lookup:"files"|lookup:fname }}">{{ collection|lookup:bin|lookup:"files"|lookup:fname }}</a></td>
                  {% endif %}
                  {% endfor %}
                </tbody>
          </table>
            <p class="section-paragraph"></p>
          <p style="color: #AAAAAA; padding: 10px;">Files that were generated for your bin.
          </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_f }}%</td>
                    <td class="text-center">{{ collection|lookup:bin|lookup:"completeness"|lookup:source|lookup:"percent_redundancy"|humanize_f }}%</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 %}


    <!-- BINS ACROSS SAMPLES PANEL -->
    {% if not meta|lookup:"profile"|lookup:"blank" %}
    <section>
    <div class="container">
        <div class="panel panel-info" id="bins_across_samples_panel">
            <div class="panel-heading">
                <h1 class="panel-title"><a data-toggle="collapse" data-parent="#bins_across_samples_panel" href="#collapse-bins-across-samples">Across Samples ({{ meta|lookup:"profile"|lookup:"samples"|length|pretty }})</a></h1> 
            </div>

            <div id="collapse-bins-across-samples" class="panel-collapse collapse">

                <div role="tabpanel" style="margin: 10px;">
                    <!-- Nav tabs -->
                    <ul class="nav nav-tabs" role="tablist">
                    {% for item in collection_profile_items %}
                      <li role="presentation"{% if forloop.first %} class="active"{% endif %}><a href="#{{ item }}" aria-controls="{{ item }}" role="tab" data-toggle="tab">{{ item|humanize }}</a></li>
                    {% endfor %}
                    </ul>
                
                    <!-- Tab panes -->
                    <div class="tab-content">
                    {% for item in collection_profile_items %}
                        <div role="tabpanel" class="tab-pane fade{% if forloop.first %} in active{% endif %}" id="{{ item }}">

                            <p style="color: #AAAAAA; padding: 20px;">TAB-delimited matrix file for {{ item }}: <a href="{{ files|lookup:item }}">{{ files|lookup:item }}</a></p>

                            <div class="panel panel-default">
                                <div class="panel-body">
                                    <table class="table table-striped sortable" style="margin: 10px;">
                                        <thead id="tblHead_bin">
                                           <tr>
                                               <th data-defaultsort='disabled' class="text-center"></th>
                                               <th>Bin</th>
                                                {% for sample in meta|lookup:"profile"|lookup:"samples"|slice:slice_header_items_tmpl %}
                                                {% if sample|length > 5 %}
                                                <th class="text-center">{{ sample|slice:"0:5" }} <a href="#" data-toggle="tooltip" title="{{ sample }}">...</a></th>
                                                {% else %}
                                                <th class="text-center">{{ sample }}</th>
                                                {% endif %} 
                                                {% endfor %}

                                                {% if meta|lookup:"profile"|lookup:"samples"|length > max_shown_header_items %}
                                                <th class="text-center"><span data-toggle="tooltip" title="{{ num_not_shown_samples }} more">...</span></th>
                                                {% endif %} 
                                           </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>

                                                {% for sample in meta|lookup:"profile"|lookup:"samples"|slice:slice_header_items_tmpl %}
                                                    <td class="text-center" data-value="{{ collection_profile|lookup:bin|lookup:item|lookup:sample }}">{{ collection_profile|lookup:bin|lookup:item|lookup:sample|humanize_n }}</td>
                                                {% endfor %}

                                                {% if meta|lookup:"profile"|lookup:"samples"|length > max_shown_header_items %}
                                                    <td class="text-center"><span data-toggle="tooltip" title="{{ num_not_shown_samples }} more">...</span></td>
                                                {% endif %} 
                                           </tr>
                                           {% endfor %}
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                        </div>
                    {% endfor %}
                    </div>
                </div>
            </div>
        </div>
    </div>
    </section>
    {% endif %}


    <!-- BINS PERCENT RECRUITMENT PANEL -->
    {% if not meta|lookup:"profile"|lookup:"blank" %}
    <section>
        <div class="container">
            <div class="panel panel-info" id="bins_percent_recruitment_panel">
                <div class="panel-heading">
                    <h1 class="panel-title"><a data-toggle="collapse" data-parent="#bins_percent_recruitment_panel" href="#collapse-bins-percent-recruitment">Percent Recruitment</a></h1>
                </div>

                <div id="collapse-bins-percent-recruitment" class="panel-collapse collapse">
                    <div class="panel-body">
                        <p style="color: #AAAAAA; padding: 0px 20px;">This panel shows how much of the mapped data is recruited by each bin (and how much of the mapped data was not binned under 'splits_not_binned' column). The way these percents calculated is quite simple: summarize the mean coverage of each split in each bin, and normalize every bin with respect to each other. It is critical to remember that these values do not take the unasssambled data into account. This is how you should read this table: <i>"X percent of all mapped reads in Sample Y mapped to splits that were binned into bin Z"</i>.</p>
                        <p style="color: #AAAAAA; padding: 20px;">TAB-delimited matrix file for percent recruitment: <a href="{{ files|lookup:'bins_percent_recruitment' }}">{{ files|lookup:'bins_percent_recruitment' }}</a></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>Sample</th>
                                            {% for bin in bin_percent_abundance_items %}
                                            <th class="text-center">{{ bin }}</th>
                                            {% endfor %}
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {% for sample in meta|lookup:"profile"|lookup:"samples" %}
                                        <tr>
                                            <td style="vertical-align: middle;">{{ sample }}</td>
                                            {% for bin in bin_percent_abundance_items %}
                                            <td class="text-center" style="vertical-align: middle;" data-value="{{ bin_percent_recruitment|lookup:sample|lookup:bin }}">{{ bin_percent_recruitment|lookup:sample|lookup:bin|humanize_n }}%</td>
                                            {% endfor %}
                                        </tr>
                                        {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    {% endif %}


    {% if meta|lookup:"gene_coverages_data_available" %}
    <!-- FUNCTIONS PANEL -->
    <section>
    <div class="container">
        <div class="panel panel-info" id="functions_panel">
            <div class="panel-heading">
                <h1 class="panel-title"><a data-toggle="collapse" data-parent="#functions_panel" href="#collapse-functions">Genes &amp; Functions</a></h1>
            </div>

            <div id="collapse-functions" class="panel-collapse collapse">
                <div class="panel-body">

                    <p style="color: #AAAAAA; padding: 20px;">An overview of genes and functions based on the information found in the contigs database. If you haven't assigned any functions, these tables will only contain coverages of ORFs across samples.</a></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">Total Size</th>
                                        <th class="text-center">Num Genes Identified</th>
                                        <th data-defaultsort='disabled' class="text-center">Tabular data</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" data-value="{{ collection|lookup:bin|lookup:"total_length" }}"><button type="button" class="btn btn-default" data-toggle="modal" data-target="#modFiles_{{bin}}">{{ collection|lookup:bin|lookup:"total_length"|humanize_n }}</button></td>
                                        <td class="text-center" style="vertical-align: middle;" data-value="{{ collection|lookup:bin|lookup:"genes"|lookup:"num_genes_found"|humanize_n }}">{{ collection|lookup:bin|lookup:"genes"|lookup:"num_genes_found"|pretty }}</td>
                                        <td class="text-center" style="vertical-align: middle;"><a href="{{ collection|lookup:bin|lookup:"files"|lookup:"functions" }}">🔗  Link</a></td>
                                    </tr>
                                    {% endfor %}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
     </div>
    </section>
    {% else %}
    <section>
        <div class="container">
            <div class="panel panel-warning">
                <div class="panel-heading"><h3 class="panel-title">Functions <small>(none found)</small></h3></div>
            </div>
        </div>
    </section>
    {% endif %}


    {% if meta|lookup:"non_single_copy_gene_hmm_data_available" %}
    <!-- NON-SINLGE-COPY HMMs PANEL -->
    <section>
        <div class="container">
            <div class="panel panel-info" id="hmms_panel">
                <div class="panel-heading">
                    <h1 class="panel-title"><a data-toggle="collapse" data-parent="#hmms_panel" href="#collapse-hmms">Hits for non-single-copy gene HMM profiles</a></h1>
                </div>

                <div id="collapse-hmms" class="panel-collapse collapse">

                    <div class="panel-body">
                        <p style="color: #AAAAAA; padding: 20px;">This panel shows you the result of non-single copy gene hits in your bins and contigs for each HMM profile. Here is a table that shows the total number of HMM hits in each bin for each HMM search type (<a href="{{ files|lookup:'hmm_hit_totals' }}">from {{ files|lookup:'hmm_hit_totals' }}</a>):</p>


                        <!-- SINGLE TABLE FOR TOTAL NUMBER OF HMM HITS PER HMM PROFILE: -->
                        <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>
                                            {% for hmm_profile in meta|lookup:"hmm_items" %}
                                            <th class="text-center">{{ hmm_profile }}</th>
                                            {% endfor %}
                                       </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>

                                            {% for hmm_profile in meta|lookup:"hmm_items" %}
                                                <td class="text-center" data-value="{{ collection|lookup:bin|lookup:'hmms'|lookup:hmm_profile|sumvals|pretty }}">
                                                    <a href="{{ collection|lookup:bin|lookup:'files'|lookup:hmm_profile }}">{{ collection|lookup:bin|lookup:'hmms'|lookup:hmm_profile|sumvals|pretty }}</a>
                                                </td>
                                            {% endfor %}
                                       </tr>
                                       {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                        </div>

                        <p style="color: #AAAAAA; padding: 20px;">The distribution of each HMM item found in your HMM collections is shown below. Different search types will be presented in their cognate tabs.</p>

                        <div role="tabpanel" style="margin: 10px;">
                            <!-- Nav tabs -->
                            <ul class="nav nav-tabs" role="tablist">
                            {% for hmm_profile in meta|lookup:'hmm_items' %}
                              <li role="presentation"{% if forloop.first %} class="active"{% endif %}><a href="#{{ hmm_profile }}" aria-controls="{{ hmm_profile }}" role="tab" data-toggle="tab">{{ hmm_profile|humanize }}</a></li>
                            {% endfor %}
                            </ul>
                        
                            <!-- TABS -->
                            <div class="tab-content">
                            {% for hmm_profile in meta|lookup:'hmm_items' %}
                            <div role="tabpanel" class="tab-pane fade{% if forloop.first %} in active{% endif %}" id="{{ hmm_profile }}">

                                    <p style="color: #AAAAAA; padding: 20px;">HMM hits in bins for {{ hmm_profile }} (<a href="{{ files|lookup:'hmms'|lookup:hmm_profile }}">from {{ files|lookup:'hmms'|lookup:hmm_profile }}</a>):</p>

                                    <!-- INDIVIDUAL TABLES PER HMM ITEM and HMM PROFILE -->
                                    <div class="panel panel-default">
                                        <div class="panel-body">
                                        <table class="table table-striped sortable" style="margin: 10px;">
                                            <thead id="tblHead_bin">
                                               <tr>
                                                   <th data-defaultsort='disabled' class="text-center"></th>
                                                   <th>Bin</th>
                                                    {% for hmm_item in meta|lookup:"hmm_items"|lookup:hmm_profile|slice:slice_header_items_tmpl %}
                                                    {% if hmm_item|length > 5 %}
                                                    <th class="text-center">{{ hmm_item|slice:"0:5" }} <a href="#" data-toggle="tooltip" title="{{ hmm_item }}">...</a></th>
                                                    {% else %}
                                                    <th class="text-center">{{ hmm_item }}</th>
                                                    {% endif %} 
                                                    {% endfor %}

                                                    {% if meta|lookup:"hmm_items"|lookup:hmm_profile|length > max_shown_header_items %}
                                                    <th class="text-center"><span data-toggle="tooltip" title="{{ num_not_shown_hmm_items|lookup:hmm_profile }} more">...</span></th>
                                                    {% endif %} 
                                               </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>

                                                    {% for hmm_item in meta|lookup:"hmm_items"|lookup:hmm_profile|slice:slice_header_items_tmpl %}
                                                        <td class="text-center" data-value="{{ collection|lookup:bin|lookup:'hmms'|lookup:hmm_profile|lookup:hmm_item }}">{{ collection|lookup:bin|lookup:'hmms'|lookup:hmm_profile|lookup:hmm_item|pretty }}</td>
                                                    {% endfor %}

                                                    {% if meta|lookup:"hmm_items"|lookup:hmm_profile|length > max_shown_header_items %}
                                                        <td class="text-center"><span data-toggle="tooltip" title="{{ num_not_shown_hmm_items|lookup:hmm_profile }} more">...</span></td>
                                                    {% endif %} 
                                               </tr>
                                               {% endfor %}
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                            {% endfor %}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    {% else %}
    <section>
        <div class="container">
            <div class="panel panel-warning">
                <div class="panel-heading"><h3 class="panel-title">Hidden Markov Model Hits <small>(none found)</small></h3></div>
            </div>
        </div>
    </section>
    {% endif %}


    <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>
