-
Notifications
You must be signed in to change notification settings - Fork 4
/
dataset.html
339 lines (292 loc) · 11.9 KB
/
dataset.html
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics - Personal -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-176192306-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-176192306-1');
</script>
<!-- Global site tag (gtag.js) - Google Analytics - SBRG -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-176090948-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-176090948-2');
</script>
<title> Dataset Home </title>
<!-- Metadata -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<!-- Bootstrap CDN -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<!-- Font -->
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700&display=swap" rel="stylesheet">
<!-- CSS -->
<style>
* {
font-family: 'Roboto', 'Helvetica', 'Segoe UI', sans-serif;
}
.header {
background-color: #5D5C61;
color: white;
margin-bottom: 0rem;
padding: 0.4rem;
padding-left: 0.7rem;
}
.header a {
color: white;
}
.header a:hover {
color: #A8D0E6;
}
.dropdown-menu {
background-color: #5D5C61;
}
.dropdown-item {
color: white;
}
#left_col {
background-color: #A8D0E6;
padding: 1rem;
}
#left_col_content {
position: sticky;
top: 4.5rem;
}
.card {
background-color: #5D5C61;
}
.im_head_meta_cat {
margin-bottom: 0rem;
font-size: 12px;
font-weight: bold;
color: white;
}
.im_head_meta_val {
color: white;
}
.im_head_meta_val a {
color: #A8D0E6;
}
.tabulator-frozen-left {
font-weight: bold;
}
.tabulator-header {
color: black;
}
.bd-lead {
overflow-wrap: break-word;
word-wrap: break-word;
-webkit-hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
</style>
</head>
<body>
<!-- Page Content -->
<div class="container-fluid" style="min-width: 650px; max-width: 1600px">
<!-- Navbar -->
<div class="header row navbar-dark sticky-top">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">
<img src="images/modulytics_logo.png" width="30" height="30" class="d-inline-block align-top" alt=""
loading="lazy">
iModulonDB
</a>
</div>
<ul class="nav navbar-dark">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true"
aria-expanded="false">Download</a>
<div class="dropdown-menu">
<a id="data_dl" class="dropdown-item">Full Dataset</a>
<a id="gene_dl" class="dropdown-item">Gene Annotations & TRN</a>
<a id="meta_dl" class="dropdown-item">Experimental Conditions</a>
<a id="imtb_dl" class="dropdown-item">iModulon Table</a>
</div>
</li>
<li class="nav-item">
<a id="gene_search" class="nav-link" href="search.html">Search</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html">About</a>
</li>
</ul>
</div>
<div class="row">
<!-- Left column: Header -->
<div id="left_col" class="col-md-3">
<div id="left_col_content">
<h1 id="title" class="bd-title bd-lead"></h1>
<div class="card p-2" id="header"></div>
</div>
</div>
<!-- Main body -->
<div class="col-md-9 p-3">
<h5 class="text-center">iModulons</h5>
<!-- iModulon Table -->
<div id="iM_table" style="width: 100%"></div>
<hr/>
<!-- Footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-sm-3">
<a href="http://systemsbiology.ucsd.edu/">
<img class="img-fluid" src="images/sbrg-logo.png">
</a>
</div>
<div class="col-sm-9 m-auto">
<p class="copyright text-muted small">
iModulonDB is maintained by the Systems Biology Research Group at the University of
California, San Diego. <br/>
</p>
</div>
</div>
</div>
</footer>
</div>
</div>
</div>
<!-- Scripts for Bootstrap: jQuery, Popper.js, Bootstrap JS-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>
<!-- Required CDNs: URLSearchParams, Papa Parse, Tabulator -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/url-search-params/1.1.0/url-search-params.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.1.0/papaparse.min.js"></script>
<link href="https://unpkg.com/[email protected]/dist/css/tabulator_simple.min.css" rel="stylesheet"/>
<script src="https://unpkg.com/[email protected]/dist/js/tabulator.min.js"></script>
<!-- Populate the page -->
<script>
// get the URL search params to know which dataset to generate
var params = new URLSearchParams(window.location.search);
var prefix = 'organisms/' + params.get('organism') + '/' + params.get('dataset') + '/';
var link_suffix = "?organism=" + params.get('organism') + "&dataset=" + params.get('dataset');
// update the download links
if (params.get('dataset') == 'precise1k') {
document.getElementById('data_dl').setAttribute('href', 'https://www.dropbox.com/s/p9wfadei4heup1v/p1k_data_files.zip?dl=0');
} else {
document.getElementById('data_dl').setAttribute('href', prefix + 'data_files.zip');
}
document.getElementById('gene_dl').setAttribute('href', 'organisms/' + params.get('organism') + '/annotation/gene_files.zip');
document.getElementById('meta_dl').setAttribute('href', prefix + 'data_files/sample_table.csv');
document.getElementById('imtb_dl').setAttribute('href', prefix + 'data_files/iM_table.csv');
document.getElementById('gene_search').setAttribute('href', 'search.html' + link_suffix);
// populate the dataset info
$.get(prefix + 'dataset_meta.csv', function (meta) {
var metadata = Papa.parse(meta).data;
// dataset title
var title = metadata[1][1];
document.title = 'iModulonDB: ' + title.replace(/(<([^>]+)>)/ig, '');
if (title.slice(-8) != ' Dataset') {
title = title + ' Dataset';
}
$('#title').append(title);
// header text
for (i = 1; i < metadata.length - 1; i++) {
$('#header').append('<p class="im_head_meta_cat">' + metadata[i][0].toUpperCase() + '</p>')
$('#header').append('<p class="im_head_meta_val">' + metadata[i][1] + '</p>');
}
});
// populate the table
$.get(prefix + 'data_files/iM_table.csv', function (table_data) {
// get the data, convert to objects
var data = Papa.parse(table_data, {dynamicTyping: true}).data;
var tabledata = []
for (i = 1; i < data.length - 1; i++) { //rows, excluding header
var obj = {};
for (j = 0; j < data[0].length; j++) { //cols
if (typeof data[i][j] === 'string') {
if (data[i][j].includes('<a')) {
data[i][j] = data[i][j].split('<a')[0]
}
}
obj[data[0][j]] = data[i][j];
}
tabledata.push(obj);
}
// columns object
var columns = [
{title: "iModulon Name", field: "name", frozen: true, formatter: "textarea", widthGrow: 2},
{
title: "Regulator", field: "regulator_readable", formatter: "textarea",
width: 150, sorterParams: {alignEmptyValues: "bottom"}, widthGrow: 2
},
{title: "Function", field: "function", formatter: "textarea", widthGrow: 3},
{
title: "Category", field: "category", formatter: "textarea",
sorter: function (a, b, aRow, bRow, column, dir, sorterParams) {
return aRow.getData().category_num - bRow.getData().category_num;
},
widthGrow: 2
},
{title: "N", field: "n_genes", variableHeight: true},
{
title: "Explained Variance",
field: "exp_var",
formatter:function(cell, formatterParams, onRendered){
//cell - the cell component
//formatterParams - parameters set for the column
//onRendered - function to call when the formatter has been rendered
return (cell.getValue()*100).toFixed(4) + "%";
},
variableHeight: true
},
{
title: "Precision",
field: "precision",
formatter: "money",
formatterParams: {precision: 3},
variableHeight: true
},
{
title: "Recall",
field: "recall",
formatter: "money",
formatterParams: {precision: 3},
variableHeight: true
}
]
// generate the table
var table = new Tabulator('#iM_table', {
layout: "fitColumns",
data: tabledata,
columns: columns,
initialSort: [
{column: "name", dir: "asc"},
{column: "regulator_readable", dir: "asc"},
{column: "exp_var", dir: "desc"}
],
/*[ //old version
{column: "Regulator", dir: "asc"},
{column: "Category", dir: "asc"},
],*/
rowClick: function (e, row) { //link to the page in a database
var link = 'iModulon.html?';
link += 'organism=' + params.get('organism') + '&';
link += 'dataset=' + params.get('dataset') + '&';
link += 'k=' + row.getData().k;
window.location.href = link;
},
tooltips: function (cell) {
return "Click to view iModulon dashboard";
}
});
table.redraw();
});
</script>
</body>
</html>