aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/gn3_wgcna_results.html
blob: b60587c387ea5b4951770dc8867acd0f518adc9b (about) (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
{% extends "base.html" %}
{% block title %}WCGNA results{% endblock %}
{% block content %}
<!-- Start of body -->

<link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='xterm/xterm.min.css') }}" />


<link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />


<style type="text/css">


.container {
    min-height: 100vh;
    width: 100vw;
    padding: 20px;

}

.grid_container {


    width: 80vw;
    margin: auto;
    padding: 20px;


    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /*grid-gap: 5px;*/
    border: 1px solid black;
    grid-column-gap: 20px;

}

.control_sft_column {
    text-align: center;
}

.grid_container div:not(:last-child) {
    border-right: 1px solid #000;
}

.grid_container .control_sft_column h3 {
    font-weight: bold;
    font-size: 18px;
}

.control_net_colors {

    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}


.control_mod_eigens {
    display: grid;
    grid-template-columns: repeat(2, 200px);
}

.control-image{
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 80vw;
}
</style>
<div class="container">
    {% if  error!='null' %}
     <h4 style="text-align: center;">{{error}}</h4>

    {% else %}
    <div>
        <div>
            <h2 style="text-align:center;">Parameters used</h2>

            <table id="summary" class="display"  width="40vw" ></table>

        </div>
        <div >
            <h2 style="text-align:center">Soft Thresholds </h2>
            <div class="grid_container">

            {% for key, value in results["data"]["output"]["soft_threshold"].items()%}
            <div class="control_sft_column">
                <h3>{{key}}</h3>
                {% for val in value %}
                <p>{{val|round(3)}}</p>
                {% endfor %}
            </div>
            {% endfor %}
            </div>
        </div>

        <div>
        
            {% if image["image_generated"] %}
            <div >
                <img class="control-image" src="data:image/jpeg;base64,{{ image['image_data']| safe }}">
            </div>

            {% endif %}
<!--                 <div >
                <img class="control-image" src="data:image/jpeg;base64,{{ results['data']['output']['image_data2']| safe }}">
            </div> -->
        </div>

        <div>
            <h2 style="text-align:center;"> Module eigen genes </h2>
            <table id="eigens" class="display" width="80vw"></table>
        </div>

        <div>
            <h2 style="text-align:center;">Phenotype modules </h2>

             <table id="phenos" class="display"  width="40vw" ></table>
        </div>
    </div>

{% endif %}

</div>

{% endblock %}

{% block js %}

<script src="{{ url_for('js', filename='xterm/xterm.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 phenoModules = {{results|safe}}["data"]["output"]["net_colors"]
let phenotypes = Object.keys(phenoModules)
let phenoMods = Object.values(phenoModules)

let {col_names,mod_dataset} = {{data|safe}}
const summary = {
  modules_found:phenoMods.length,
  ...{{parameters|safe}}
  
}

    $("#summary").DataTable( {

        data: Object.keys(summary).map((key)=>{
            return [key,summary[key]]
        }),
        columns: [ {
            title: "parameter",

        },

        {
            title:" param_values"
        }
        ]
    })


    $('#eigens').DataTable( {
        data: mod_dataset,
        columns: col_names.map((name)=>{
            return {
                title:name
            }
        })
    } );
    $('#phenos').DataTable( {
        data:phenotypes.map((phenoName,idx)=>{
            return [phenoName,phenoMods[idx]]
        }),
        columns: [{
            title:"Phenotypes"
        },
        {
        title: "Modules"
        }]
    } );


</script>
{% endblock %}