<!DOCTYPE html>


<html>



<head>
    {% load static %}
    {% load static %}
    {% get_static_prefix as STATIC_PREFIX %}

    <script type="text/javascript" src="{% static 'js/tableExport.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/jquery.base64.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/jquery.tablesorter.js' %}"></script>
    <!--<script type="text/javascript" src="{% static 'js/jquery-1.11.2.min.js' %}"></script>-->
    <script type="text/javascript" src="{% static 'js/sorttable.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/excellentexport.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/jquery.chained.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/jquery.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/bootstrap.min.js' %}"></script>

    <script type="text/javascript" src="{% static 'js/jvenn.min.js' %}"></script>
    <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.css' %}" />
    <link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>

    <script type="text/javascript" src="{% static 'js/bootstrap-switch.js' %}"></script>
    <link rel="stylesheet" type="text/css" href="{% static 'css/toggle-switch.css' %}" />

</head>

<body>
    {% if connect %}

    <h3>Interaction Network for {{cog_id}}</h3>
        <ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
            <li class="active"><a href="#tab1" data-toggle="tab">String network</a></li>

            <li><a href="#tab66" data-toggle="tab" onclick="window.open('{% url 'multiple_COGs_heatmap' %}{{cog_url}}', 'orthoIDframe2'); return false">Orthogroup conservation</a></li>
        </ul>

        <div id="my-tab-content" class="tab-content">
            <div class="tab-pane active" id="tab1">


                <div id="pfam_tree_div">
                    <img src="http://string-db.org/api/image/network?all_channels_on=1&interactive=yes&network_flavor=evidence&targetmode=cogs&identifier={{cog_id}}"></img>
                </div>
                <div>
                    <h3>Interactions:</h3>

                    <ul>
                        <li>Number of COGs in the interaction network: {{ cog2description|length }}</li>
                        <li>Number of those COGs in the local database: {{ cogs_in_chlamdb|length }}</li>
                        <li>Number of those COGs in the considered organism ({{genome_accession}}): {{ cogs_in_reference|length }}</li>
                    </ul>

                    <table class="sortable">
                        <thead>
                        <tr>
                            <th>Cog 1</th>
                            <th>Description</th>
                            <th>Cog 2</th>
                            <th>Description</th>
                            <th>Score</th>

                        </tr>
                        </thead>
                        <tbody>
                        {% for values in string_interactions %}
                        <tr>
                            {% if values.0 in cogs_in_reference %}
                                <td><a href="{% url 'fam' values.0 'cog' %}" target="_top">{{values.0}}</a></td>
                            {% else %}
                                <td>{{values.0}}</td>
                            {% endif %}

                            <td><font size="1" color="red">{{ values.3 }}</font></td>

                            {% if values.1 in cogs_in_reference %}
                                <td><a href="{% url 'fam' values.1 'cog' %}" target="_top">{{values.1}}</a></td>
                            {% else %}
                                <td>{{values.1}}</td>
                            {% endif %}
                            <td><font size="1" color="red">{{ values.4}}</font></td>
                            <td>{{values.2}}</td>
                        </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>

                <div class="tab-pane" id="tab66" style="height:100%">
                    <iframe name="orthoIDframe2" id="theFrame2" scrolling="no" width="100%" height="1800px"></iframe>
                </div>

        </div>

    {% else %}
    No Internet connexion
    {% endif %}
</body>
</html>
