<!DOCTYPE html>


<html>
<head>
  {% include "chlamdb/header.html" %}

	<script>
		var cog_func_dict = {{cog_func_dict|safe}};

		var columns = [
			{title: "ID"},
			{title: "Category"},
			{title: "Description"},
		];

		function build_set(val, dict) {
			let link = "<a href=/fam_cog/"+val+">"+val+"</a>";
			let raw_data = dict[val];
			categories = raw_data[0].
				map(it => cog_func_dict[it]+" ("+it+")").
				join("<br>");
			description = raw_data[1];
			return [link, categories, description];
		}
	</script>

{% load crispy_forms_tags %}
<head>

  <div class="container-fluid" id="main_container">
    <div class="row">
      <div id="wrapper">
          <div id="page-content-wrapper">
            <div class="row">
              <div class="col-lg-12">
                 {% include "chlamdb/menu.html" %}
                 {% if display_form %}
                    {% include "chlamdb/extract_nav_tabs_template.html" with type="COG" active_tab="venn" %}
                    <br>
                    <p class="page-title"><b>Visual representation of unique and shared COGs among selected genomes </b><a href="https://zdb.readthedocs.io/en/latest/tutorial/website.html#comparisons" id="show-option" target="_blank"  title="Venn diagramm with a maximum of 6 genomes"><i class="fab fa-info-circle"  style="size: 5em;" ></i></a></p></center>
    

                      {% block content %}
                      <form action="{% url "venn_cog" %}" method="post">
                          {% csrf_token %}
                          {% crispy form_venn %}
                      </form>
                      {% endblock %}

                    </div>
                 {% endif %}

               {% if envoi_venn %}
               <div class="row" style="padding-top:30px; background-color: rgba(245, 245, 245, 0.986)">
              <div class="panel panel-success" style="margin: 1em;"  >
                <div class="panel-heading" style="width:100%">
                  <h5 class="panel-title">Help to interpret the results</h5>
                </div>
                <p style="margin: 10px 10px 10px 10px">
                  The interactive Venn diagram let you visualize how many COG annotated genes are shared among the selected genomes or a subset of genomes of interest, and how many are unique to each genome.
                  The table contains a list of the COG definitions, their description and the category to which belong.
                  Additionally, the total number of COG annotated genes identified in each genome can be visualized in the barplot, while the number of unique or shared ones can be appreciated in the last plot.
                  <br> <br> Clicking on the reported numbers the list of identified COG definitions is displayed below.
                </p>
              </div>
                  {% include "chlamdb/venn_template_orthogroups.html" with series=series description_dico=cog2description %}

              {% endif %}
              </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
{% include "chlamdb/style_menu.html" %}
</html>
