aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/gn3_ctl_results.html
blob: 450f9ad900fda483ada3256b9b62e29bf25660fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{% extends "index_page.html" %}
{% block title %}Ctl results{% endblock %}
{% block content %}
<link REL="stylesheet" TYPE="text/css" href="{{ url_for('css', filename='bootstrap/css/bootstrap.css') }}" />
<link REL="stylesheet" TYPE="text/css" href="{{ url_for('css', filename='bootstrap/css/bootstrap.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
<style type="text/css">
.carousel-control-next,
.carousel-control-prev

/*, .carousel-indicators */
    {
    filter: invert(100%);
}
</style>
<div style="margin-top:10px">

{% if error %}
    <div>
        <h4 style="text-align:center;color:red">{{error}}</h4>
    </div> 

{% else %}
    <div>
    <div>
        <div style="text-align: center;">
            <h3>CTL/QTL Plots for Individual Traits</h3>
            <h4> {{ctl_plots|length}} phenotypes as input</h4>
        </div>
        <div id="carouselExampleControls" class="carousel slide" data-interval="false">
            <div class="carousel-inner">
                {% for ctl_plot in ctl_plots %}
                <div class="item{% if loop.index == 1 %} active{% endif %}">
                    <img style="width:1000px;height: 600px;" class="center-block" src="data:image/jpeg;base64,{{ ctl_plot | safe }}" alt="First slide">
                </div>
                {% endfor %}
                <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                </a>
                <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
                    <span class="carousel-control-next-icon" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                </a>
            </div>
        </div>
    </div>
    <div>
        <div style="text-align:center;">
            <h2>Ctl line plot</h2>
            <h4>Plot the CTL for genome-wide CTL on all traits (the output of CTLscan).</h4>
        </div>
        <div class="row">
            <div class="col-8">
                <img style="width:100%;height: 600px;" class="center-block" src="data:image/jpeg;base64,{{ image_data | safe }}">
            </div>
            <div class="col-4">
                <ol style="height: 100%;display:flex;flex-direction: column;align-items: center;justify-content: center;">
                    {% for trait in phenotypes %}
                    {% set trait_data = trait.split(':') %}
                    <li><a href="/show_trait?trait_id={{trait_data[0]}}&dataset={{trait_data[1]}}">{{trait_data[0]}}</a></li>
                    {% endfor %}
                </ol>
            </div>
        </div>
    </div>
    <h2 style="text-align:center">Significant CTL </h2>
    <table id="significance" width="80vw"></table>
    <div style="text-align: center;margin-top: 20px;">
        <h3 style="text-align:center;">Network figure</h3>
        <div style="margin-top: 20px;">
            <p>Use tools like cytoscape to visualize the network</p>
            <a href="/ctl_network_files/{{network_file_name}}/sif" class="btn btn-secondary btn-lg mx-2">Download Sif file</a>
            <a href="/ctl_network_files/{{network_file_name}}/nodes" class="btn btn-secondary btn-lg mx-2">Download Node file</a>
        </div>
    </div>
</div>

{% endif %}
</div>


<script src="{{ url_for('js', filename='bootstrap/js/bootstrap.min.js') }}" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTables/js/jquery.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTables/js/jquery.dataTables.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/scroller/js/dataTables.scroller.min.js') }}"></script>
<script type="text/javascript">
let { data_set_rows, col_names } = {{ significance_data | safe }}


$('#significance').DataTable({
    data: data_set_rows,
    columns: col_names.map((name) => {
        return {
            title: name
        }
    })
});
</script>
{% endblock %}