-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
363 lines (328 loc) · 14.8 KB
/
index.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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Visualize DNA Sequences</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- For convenient offline development: uncomment, comment out again before release. -->
<!-- <link rel="stylesheet" href="css/bootstrap.min.css"> -->
</head>
<body>
<!-- Settings -->
<div class="container mt-5">
<div class="row">
<div class="col">
<h1>Visualizing DNA Sequences</h1>
<p class="text-muted">Need help? Explanation at the bottom! <a href="#explanation">Click here to scroll.</a></p>
<p class="text-muted">Want to see an example? <a href="https://danielbiegler.github.io/visualize-dna-sequences/demo">Demo here.</a></p>
</div>
</div>
<hr>
<div class="row">
<div class="col">
<h5 class="text-left mb-3">Base-Config:</h5>
</div>
</div>
<div class="row text-center">
<div class="col-sm-4 col-lg-2 offset-lg-1 col-6 mt-3">
<label for="a-dir"><b>A</b>=</label>
<select id="a-dir" class="form-control">
<option value="N" selected>UP</option>
<option value="S">DOWN</option>
<option value="W">LEFT</option>
<option value="E">RIGHT</option>
<option value="NW">UP+LEFT</option>
<option value="NE">UP+RIGHT</option>
<option value="SW">DOWN-LEFT</option>
<option value="SE">DOWN+RIGHT</option>
<option value="STOP">DONT MOVE</option>
</select>
<input id="a-col" type="color" value="#FF0000" class="mt-3 form-control color-picker">
<select id="a-dir-z-axis" class="form-control mt-3 d-none">
<option value="UP">UP</option>
<option value="DOWN">DOWN</option>
<option value="STOP">DONT MOVE</option>
<option value="RANDOM" selected>RANDOM</option>
</select>
</div>
<div class="col-sm-4 col-lg-2 col-6 mt-3">
<label for="t-dir"><b>T</b>=</label>
<select id="t-dir" class="form-control">
<option value="N">UP</option>
<option value="S" selected>DOWN</option>
<option value="W">LEFT</option>
<option value="E">RIGHT</option>
<option value="NW">UP+LEFT</option>
<option value="NE">UP+RIGHT</option>
<option value="SW">DOWN-LEFT</option>
<option value="SE">DOWN+RIGHT</option>
<option value="STOP">DONT MOVE</option>
</select>
<input id="t-col" type="color" value="#00FF00" class="mt-3 form-control color-picker">
<select id="t-dir-z-axis" class="form-control mt-3 d-none">
<option value="UP">UP</option>
<option value="DOWN">DOWN</option>
<option value="STOP">DONT MOVE</option>
<option value="RANDOM" selected>RANDOM</option>
</select>
</div>
<div class="col-sm-4 col-lg-2 col-6 mt-3">
<label for="g-dir"><b>G</b>=</label>
<select id="g-dir" class="form-control">
<option value="N">UP</option>
<option value="S">DOWN</option>
<option value="W">LEFT</option>
<option value="E" selected>RIGHT</option>
<option value="NW">UP+LEFT</option>
<option value="NE">UP+RIGHT</option>
<option value="SW">DOWN-LEFT</option>
<option value="SE">DOWN+RIGHT</option>
<option value="STOP">DONT MOVE</option>
</select>
<input id="g-col" type="color" value="#0000FF" class="mt-3 form-control color-picker">
<select id="g-dir-z-axis" class="form-control mt-3 d-none">
<option value="UP">UP</option>
<option value="DOWN">DOWN</option>
<option value="STOP">DONT MOVE</option>
<option value="RANDOM" selected>RANDOM</option>
</select>
</div>
<div class="col-sm-4 col-lg-2 col-6 mt-3">
<label for="c-dir"><b>C</b>=</label>
<select id="c-dir" class="form-control">
<option value="N">UP</option>
<option value="S">DOWN</option>
<option value="W" selected>LEFT</option>
<option value="E">RIGHT</option>
<option value="NW">UP+LEFT</option>
<option value="NE">UP+RIGHT</option>
<option value="SW">DOWN+LEFT</option>
<option value="SE">DOWN+RIGHT</option>
<option value="STOP">DONT MOVE</option>
</select>
<input id="c-col" type="color" value="#FFFF00" class="mt-3 form-control color-picker">
<select id="c-dir-z-axis" class="form-control mt-3 d-none">
<option value="UP">UP</option>
<option value="DOWN">DOWN</option>
<option value="STOP">DONT MOVE</option>
<option value="RANDOM" selected>RANDOM</option>
</select>
</div>
<div class="col-sm-4 col-lg-2 col-6 offset-6 offset-sm-0 mt-3">
<label for="x-dir"><b>UNKNOWN</b>=</label>
<select id="x-dir" class="form-control">
<!-- <option value="RANDOM">RANDOM</option> -->
<option value="N">UP</option>
<option value="S">DOWN</option>
<option value="W">LEFT</option>
<option value="E">RIGHT</option>
<option value="NW">UP+LEFT</option>
<option value="NE">UP+RIGHT</option>
<option value="SW">DOWN+LEFT</option>
<option value="SE">DOWN+RIGHT</option>
<option value="STOP" selected>DONT MOVE</option>
</select>
<input id="x-col" type="color" class="mt-3 form-control color-picker">
<select id="x-dir-z-axis" class="form-control mt-3 d-none">
<option value="UP">UP</option>
<option value="DOWN">DOWN</option>
<option value="STOP" selected>DONT MOVE</option>
<option value="RANDOM">RANDOM</option>
</select>
</div>
</div>
<hr>
<div class="row mt-3">
<div class="col">
<h5 class="text-left mb-3">Data-Config:</h5>
</div>
</div>
<div class="row text-center">
<div class="col-sm-4 col-lg-3 col-6">
<label for="label-file">
<b class="" data-toggle="tooltip" title="You can open a file, draw it, change parameters and redraw it again. After selecting a file you can hover the Button for the full filename.">
File<sup><u>?</u></sup>
</b>
</label>
<label id="label-file" for="file" class="btn btn-info d-block">
<b>Open File</b>
<input type="file" accept=".fa, .mpfa, .fna, .fsa, .fasta, .txt" id="file" hidden>
</label>
</div>
<div class="col-sm-4 col-lg-2 col-6">
<label for="offset" class="d-block">
<b class="" data-toggle="tooltip" title="For large sequences it could be necessary to only draw X point for performance reasons.">
Resolution<sup><u>?</u></sup>
</b>
<input type="number" min="1" id="offset" class="form-control w-100 mt-2" placeholder="Draw every X point" value="5">
</label>
</div>
<div class="col-sm-4 col-lg-2 col-6 mt-3 mt-sm-0">
<label for="size">
<b class="" data-toggle="tooltip" title="Size of the dots in pixels. Could be useful to increase the size for smaller sequences and decrease for larger ones.">
Size<sup><u>?</u></sup>
</b>
<input type="number" min="1" id="size" class="form-control mt-2" value="4">
</label>
</div>
<div class="col-sm-3 col-lg-1 col-6 mt-3 mt-lg-0">
<div class="material-switch">
<b class="d-block" data-toggle="tooltip" title="Disabling color will reduce the memory footprint.">Color<sup><u>?</u></sup></b>
<input id="color" type="checkbox" checked/>
<label for="color" class="text-left mt-4"></label>
</div>
</div>
<div class="col-sm-4 col-lg-1 col-6 mt-3 mt-lg-0">
<label for="chunksize">
<b class="" data-toggle="tooltip" title="Larger files will get split into multiple parts, this sets the size of those parts IN MEGABYTES(!). When reading huge files, increasing the chunksize will result in better performance. If you go too high though, the browser tab might crash!">
Chunksize<sup><u>?</u></sup>
</b>
<input type="number" min="1" id="chunksize" class="form-control mt-2" value="4">
</label>
</div>
<div class="col-sm-5 col-lg-3 col-6 mt-3 mt-lg-0">
<label for="graph-mode">
<b data-toggle="tooltip" title="EXPERIMENTAL: Different ways of representing the data. Currently 'Lines' only support a default color.">
Mode<sup><u>?</u></sup>
</b>
<select id="graph-mode" class="form-control mt-2">
<option selected value="markers" data-plotly-type="scattergl">2D Points</option>
<option value="markers" data-plotly-type="scatter3d">3D Points</option>
<option value="lines" data-plotly-type="scattergl">2D Lines</option>
<option value="lines" data-plotly-type="scatter3d">3D Lines</option>
<option value="lines+markers" data-plotly-type="scattergl">2D Lines+Points</option>
<option value="lines+markers" data-plotly-type="scatter3d">3D Lines+Points</option>
</select>
</label>
</div>
</div>
<hr>
<button class="btn btn-primary w-100 py-3" id="btn-start">
<b>DRAW</b>
</button>
<hr>
<div class="text-center">
<p id="progress-text" class="text-right">Progress: <span class="text-info">0%</span></p>
<div id="progress-bg" class="w-100"><div id="progress-bar"></div></div>
</div>
</div>
<div class="row container-fluid text-center">
<div id="plot" class="w-100">
<p id="unplotted-text" class="text-muted my-5">
Sequence is going to appear here.<br>
Quick-Edit options will appear underneath the graph.
</p>
</div>
</div>
<div id="quickedit-container" class="container d-none">
<h5 class="mb-3">
<span data-toggle="tooltip" title="You can change some parameters of the Graph after plotting with no need to redraw the whole sequence.">
Quick-edit:<sup><u>?</u></sup>
</span>
</h5>
<div class="row text-center">
<div class="col-12 mb-3">
<label for="quickedit-size">
<b>Size</b>
<input type="number" min="1" id="quickedit-size" class="form-control mt-2" value="-1">
</div>
<div class="col-6 col-md-3">
<label for="quickedit-x-range-min">
<b>X Range Minimum</b>
<input type="number" id="quickedit-x-range-min" class="form-control mt-2" value="-1">
</div>
<div class="col-6 col-md-3">
<label for="quickedit-x-range-max">
<b>X Range Maximum</b>
<input type="number" id="quickedit-x-range-max" class="form-control mt-2" value="-1">
</div>
<div class="col-6 col-md-3">
<label for="quickedit-y-range-min">
<b>Y Range Minimum</b>
<input type="number" id="quickedit-y-range-min" class="form-control mt-2" value="-1">
</div>
<div class="col-6 col-md-3">
<label for="quickedit-y-range-max">
<b>Y Range Maximum</b>
<input type="number" id="quickedit-y-range-max" class="form-control mt-2" value="-1">
</div>
<div class="col-12">
<button id="btn-quickedit" class="btn btn-secondary w-100 py-3 mt-3">
<b>EDIT</b>
</button>
</div>
</div>
</div>
<div class="container">
<hr>
<div class="row my-5">
<div class="col">
<h3 id="explanation">Explanation:</h3>
<p>You can find a demo <a href="https://danielbiegler.github.io/visualize-dna-sequences/demo">here</a>.</p>
<p>
This site uses the 4 DNA bases: <b>A</b>denin, <b>C</b>ytosin, <b>G</b>uanin and <b>T</b>hymin<br>
to visualize DNA sequences. While this can be used to show correlations between strains,<br>
(example: <a href="https://github.com/DanielBiegler/visualize-dna-sequences/blob/master/media/daniel_biegler_human_vs_chimp_dna_comparison.gif">Human vs. Chimpanzee</a> ) the general use was intended for artistic purposes only.
</p>
<p>Play around with the settings and create something brand new.</p>
<p>
If you want to use something created with this, I'd <b>absolutely LOVE(!)</b> to hear about it.<br>
Please send me a tweet on <a href="https://www.twitter.com/DanielBiegler" target="_blank">Twitter</a> or reach me privately via my <a href="https://www.danielbiegler.de">website</a>.</b>
</p>
<p>You can find the source code <a href="https://github.com/DanielBiegler/visualize-dna-sequences">here</a>.</p>
<h3 class="mt-4">Tips:</h3>
<ul>
<li>The graph is fully interactive, you can zoom and drag the view around!<br>Simply draw a rectangle inside the graph to zoom. Double click to reset your view.</li>
<li>You can hover (click on mobile!) over the words with the question marks to get more help.</li>
<li>The sequence input is <b>case insensitive</b>.</li>
<li>
You can click on the color-boxes in the settings section to change them!<br>
After that, redraw the image with the <a href="#btn-start">draw-button</a>.
</li>
<li>
You can find a couple of DNA sequences <a href="https://github.com/DanielBiegler/visualize-dna-sequences/tree/master/sequences/viruses">here</a>.<br>
The <a href="https://www.ncbi.nlm.nih.gov/">National Center for Biotechnology Information</a> is providing access to biomedical and genomic information. <br>
I'd recommend googling something like: <i>"ebola ncbi full genome"</i>, and you'll find some samples.
</li>
<li>
In my personal testing I have found that Firefox crashes less often than Chrome. <br>
Your milage may vary but I have also noticed that if you crash Chrome once, you should <br>
restart Chrome entirely. Not sure why, but there you go. /shrug
</li>
</ul>
</div>
</div>
</div>
<footer class="container my-5 text-right text-sm-center">
<hr>
<div class="row">
<div class="col-12 col-sm-2 my-1">
<p class="text-muted">v3.0.0</p>
</div>
<div class="col-12 col-sm-2 my-1">
<p><a href="https://github.com/DanielBiegler/visualize-dna-sequences">Source</a></p>
</div>
<div class="col-12 col-sm-2 my-1">
<p><a href="https://www.danielbiegler.de/">Author</a></p>
</div>
<div class="col-12 col-sm-2 my-1">
<p><a href="https://danielbiegler.github.io/visualize-dna-sequences/demo">Demo</a></p>
</div>
</div>
</footer>
<!-- Scripts -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="main.js"></script>
<!-- For convenient offline development: uncomment, comment out again before release. -->
<!-- <script src="js/bootstrap.min.js"></script> -->
<!-- The gl2d partial bundle contains trace modules scatter, scattergl, splom, pointcloud, heatmapgl, contourgl and parcoords. -->
<!-- <script src="js/plotly-gl2d-1.41.2.min.js"></script> -->
<!-- <script src="js/plotly-1.41.2.min.js"></script> -->
</body>
</html>