-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
595 lines (398 loc) · 16.5 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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<style>
@import url(css/sperm.css);
@import url(css/stack.css);
@import url(css/d3-tip.css);
@import url(css/figures.css);
@import url(css/kbroman_talk.css);
/* comment following line to get rid of notes; uncommented to show notes */
/* @import url(css/kbroman_presentation.css); */
</style>
<script charset="utf-8" type="text/javascript" src="js/d3.js"></script>
<script type="text/javascript" src="js/d3.tip.js"></script>
<title>Interactive graphics for high-dimensional genetic data</title>
</head>
<body class="overview">
<section class="titlepage">
<h2 class="highlight"><font id="flash" class="glow">Interactive</font> graphics for<br> high-dimensional genetic data</h2>
<h4><a href="http://www.biostat.wisc.edu/~kbroman">Karl Broman</a></h4>
<p class="nopadding">Biostatistics & Medical Informatics, University of Wisconsin
– Madison</p>
<p class="nopadding"><code><a href="http://www.biostat.wisc.edu/~kbroman"
class="gray">http://www.biostat.wisc.edu/~kbroman</a></code></p>
<script type="text/javascript">
var flashText = d3.select("body").select("#flash");
var flashToggle = 0; // when flashing, keeps track of on/off
var stateToggle = 0; // goes between 0 (off), 1 (on) and 2 (flashing)
var flashFunc =
function() {
flashText.attr("class", function() {
if(flashToggle==5) {
flashToggle=-1;
return("highlight"); }
else return("glow"); });
flashToggle++;
};
var flashInterval = setInterval(flashFunc, 400);
flashText.on("click", function() {
if(stateToggle==0) {
clearInterval(flashInterval);
d3.select(this).attr("class", "highlight");
}
else if(stateToggle==1) {
d3.select(this).attr("class", "glow");
}
else {
d3.select(this).attr("class", "highlight");
flashToggle = 0;
flashInterval = setInterval(flashFunc, 400);
}
stateToggle++;
if(stateToggle > 2) stateToggle = 0;
});
</script>
<p class="codelink"><a href="presentation.html" class="gray">Remove stickies</a>
<aside>
I've come to believe that data visualization can be more important
than precise statistical inference, particularly for high-dimensional
data. In these slides, I will show a bit of my efforts to develop
interactive graphics for expression genetic data.<br><br>
Click on the link at the bottom-left to remove these
notes.<br><br>
The flashing “interactive” is a joke; click
on it to switch among off/on/flashing.<br><br>
These slides were tested for Safari on a Mac and might look terrible
in some browsers. I have a lot more to learn about handling browser
differences.
</aside>
</section>
<section>
<h3>Intercross</h3>
<img style="position:fixed;bottom: 80px; left:50px; z-index: -1;" src="figs/intercross.png" />
<aside>
I study the genetics of complex traits in experimental crosses. The
intercross is the most common type of experimental cross: two inbred
strains are mated, and then their offspring are mated. We measure
genotypes along chromosomes and look for sites in the genome for which
genotype is associated with some trait.
</aside>
<p class="pg">2</p></section>
<section>
<h3>Attie eQTL project</h3>
<p class="highlight">~500 B6 x BTBR intercross mice<font class="gray">, all knocked out for leptin</font></h4>
<ul class="tight">
<li>Genotypes at 2057 SNPs (Affymetrix arrays)</li>
<li>Gene expression in six tissues (Agilent arrays)</li>
<ul class="lowlight">
<li>adipose</li>
<li>gastrocnemius muscle</li>
<li>hypothalamus</li>
<li>pancreatic islets</li>
<li>kidney</li>
<li>liver</li>
</ul>
<li>Numerous clinical phenotypes</li>
<ul class="nodash"><li class="lowlight">(e.g., body weight, insulin and glucose levels)</li></ul>
<li>Collaboration with <a
href="http://www.biochem.wisc.edu/faculty/attie/" class="gray">Alan Attie</a> and colleagues</li>
</ul>
<aside>
My first adventure with big data: 500 mice x 6 arrays x 40k
measurements. The goal is to identify genes that contribute to
obesity-induced diabetes.<br><br>
With 500 arrays of 40k measurements, you would think we would be
making many more plots than usual. But, rather, we tend to make <font
class="highlight">no</font> plots<br><br>
If you can't look at all 500 histograms, you tend not to look at any.
</aside>
<p class="pg">3</p></section>
<section>
<h3>Many box plots</h3>
<div align="center">
<img src="figs/manyboxplots_oldschool.png">
</div>
<aside>500 boxplots, each summarizing 40k measurements.
<br><br> Standard box plots don't work well with large data sets. The
usual five-number summaries don't give tail information, and it's hard
to show <font class="highlight">many</font> boxplots.</aside>
<p class="pg">4</p></section>
<section>
<h3>Many box plots</h3>
<div align="center">
<img src="figs/manyboxplots_oldschoolB.png">
</div>
<aside>Boxplots with large datasets are made even worse by use of
the usual rule for depicting “outliers.” </aside>
<p class="pg">5</p></section>
<section>
<h3>Many box plots, <font class="highlight">modernized</font></h3>
<div align="center">
<img src="figs/manyboxplots_alt.png" height=600>
</div>
<aside>
I like this better: use lines to connect various quantiles. (Here, the
1, 5, 10, 25, 50, 75, 90, 95, and 99%iles.) <br><br>
Wouldn't it be nice to click on an array and see the corresponding
histogram?
</aside>
<p class="pg">6</p></section>
<section>
<h3>Many box plots, <font class="glow">interactive</font></h3>
<div id="manyboxplots">
</div>
<aside>
Hover over an array above and see the corresponding histogram. Click
on an array for the histogram to persist; click again to make it go
away.<br><br>
Why aren't all of our graphs interactive?
</aside>
<p class="codelink">
<a href="coffee/manyboxplots.coffee" class="gray">code</a> |
<a href="data/hypo.json" class="gray">data</a>
<script type="text/javascript" src="js/manyboxplots.js"></script>
<p class="pg">7</p></section>
<section>
<h3>Opportunities</h3>
<ul class="tight">
<li>Exploration</li>
<ul class="lowlight">
<li>Tuning parameters
<li>Identifying outliers
<li>One fancy plot vs 1000 static plots
</ul>
<li>Reports for collaborators</li>
<ul class="lowlight">
<li>Living documents!
<li>Allow deeper exploration of the results
<li>Cut down on simple questions?
</ul>
<li><font class="glow">Big Data</font></li>
<ul class="lowlight">
<li>Don’t just rely on summary statistics
<li>Greatly compressed information, but with access to the details
<li>Zoom into dense figures
<li>More exploration, more connections
</ul>
</ul>
<aside>
The routine use of interactive graphics for exploratory data analysis
seems a bit out of reach, but surely is possible.<br><br>
Incorporating such graphics in reports to our collaborators could be
really valueable.<br><br>
Perhaps the greatest opportunity is for the exploration of large,
complex data sets.
</aside>
<p class="pg">8</p></section>
<section>
<h3>Trade-offs</h3>
<p align="center" style="margin-top:200px;font-size: 48px;"> <a href="http://code.google.com/p/google-motion-charts-with-r/">Easy</a> <font
class="gray">or <a href="http://d3js.org" class="highlight">flexible</a>?</font>
<aside>
You have to choose between easy or flexible; you can’t have
both. I’m going for flexible.<br>
Good graphics are tailored to the data and questions at hand.
This is even more true for interactive graphics.
</aside>
<p class="pg">9</p></section>
<section nopadding>
<h3><a href="http://d3js.org">D3</a></h3>
<div id="sperm" class="sperm" style="position:fixed;top:-10px;left:-50px;width:1280px;height:960px;">
</div>
<div style="position:fixed;bottom:10px;left:10px;">
<code style="font-size:36px;"><a href="http://bl.ocks.org/1136236">http://bl.ocks.org/1136236</a></code></div>
<aside>
I'm focusing on using <a href="http://d3js.org">D3</a>, a javascript
library for data visualization. (D3 stands for “data-driven
documents.”)<br><br>
This is one of the images that convinced me that I wanted to learn D3.
The code is surprisingly short and easy to follow.<br><br>
There are lots of additional examples at the <a
href="https://github.com/mbostock/d3/wiki/Gallery">D3 gallery</a>.
</aside>
<p class="pg">10</p>
</section>
<section>
<h3>A lot to learn</h3>
<ul class="small">
<li><a href="http://d3js.org">D3</a>
<li><a href="https://developer.mozilla.org/en-US/docs/JavaScript">JavaScript</a> /
<a href="http://coffeescript.org">CoffeeScript</a>
<li><a href="https://developer.mozilla.org/en-US/docs/HTML/HTML5">HTML</a> and “<a href="http://en.wikipedia.org/wiki/Document_Object_Model">The DOM</a>”
<li><a href="https://developer.mozilla.org/en-US/docs/CSS">CSS</a>
<li><a href="https://developer.mozilla.org/en-US/docs/SVG">SVG</a>
<li><a href="http://caniuse.com">Differences among web browsers</a>
</ul>
<aside>
The hardest part about learning D3 is that there are a whole pile of
things that you need to understand simultaneously, and some of them
are rather dull. <br><br>
You need to learn the D3 library and also to code in JavaScript or
CoffeeScript (a nicer language that is translated to JavaScript). And
the way D3 works is by manipulating elements in an HTML file,
particularly elements in an SVG object. (SVG stands for
“scaleable vector graphics;” it's an html-like way to
specify an image.)<br><br>
So you need to know HTML and SVG, and then also CSS (“cascading
style sheets”), for controlling the style (e.g. color) of
different HTML or SVG elements.<br><br>
Particularly painful is that the different browsers behave somewhat
differently, and you need to take that into account if you want your
visualizations to be useable in any browser.
</aside>
<p class="pg">11</p></section>
</section>
<section>
<h3>Correlation matrix</h3>
<div id="corr_w_scatter" style="margin-left:-50px;"></div>
<script type="text/javascript" src="js/corr_w_scatter.js"></script>
<aside>
Heatmaps of things like correlation matrices can be quite useful, but
they are often hard to read. It's nice to be able to read off the
values by hovering.<br><br>
Even better: to be able to click on a pixel and view the corresponding
scatterplot.<br><br>
This is a set of genes that map to a common QTL; in the scatterplot,
the points are colored by genotype at the QTL.
</aside>
<p class="pg">12</p></section>
<section>
<h3>Interactive LOD curves</h3>
<div id="lod_and_effect" class="fig"></div>
<aside>
The curves at the top correspond to a measure of association between
genotype and insulin level. LOD scores are log<sub>10</sub>
likelihood ratios: a transformation of the F statistic from
ANOVA.<br><br>
Click on a chromosome in the top panel to see a detailed view in the
lower-left panel. Click on a marker in the lower-left panel to see
effect estimates and raw data on the right. Hover over things on the
right to get some further information.
</aside>
<p class="codelink">
<a href="coffee/lod_and_effect.coffee" class="gray">code</a> |
<a href="data/insulinlod.json" class="gray">data</a>
<script type="text/javascript" src="js/lod_and_effect.js"></script>
<p class="pg">13</p></section>
<section nopadding>
<h3 style="margin-top:-10px;margin-left:-20px;">Interactive eQTL plot</h3>
<div id="cistrans" class="fig" style="margin-top:-60px;"></div>
<aside>
The top-left image shows inferred eQTL (sites in genome where genotype
is associated with the expression of some gene). The y-axis
corresponds to the genomic location of probes on a gene expression
array. The x-axis corresponds to marker positions. Dots indicate
that the genotypes at a particular marker are associated with the
expression of a particular probe.<br><br>
Hover over a point in the top-right to see all eQTL for a given probe.
Click on a point to see the LOD curves across the genome for that
probe: the association between that probe's expression and genotype at
each position in the genome.<br><br>
Click on a marker in the lower LOD curve plot to see the corresponding
phenotype-vs-genotype plot in the top-right.
</aside>
<p class="codelink">
<a href="coffee/cistrans.coffee" class="gray">code</a> |
<a href="data/islet_eqtl.json" class="gray">data</a>
<script type="text/javascript" src="js/cistrans.js"></script>
<p class="pg">14</p></section>
<section>
<h3>Summary</h3>
<ul class="tight">
<li>For high-dimensional data, good visualizations are <font
class="highlight">critical</font></li>
<li><font class="glow">Interactive</font> graphics
require effort, but they</li>
<ul class="lowlight">
<li>Facilitate exploration</li>
<li>Are great collaborative tools</li>
<li>Enable summaries with access to the details</li>
</ul>
<li>Visualizations must be <font
class="highlight">tailored</font> to the data and
questions/goals
<li><a href="http://d3js.org" class="highlight">D3</a> (aka <a
href="http://www.d3js.org" class="highlight">d3.js</a>) is rather low level, but it</li>
<ul class="lowlight">
<li>Is totally flexible (like <a href="http://www.r-project.org">R</a>'s static graphics)</li>
<li>Provides hours of enjoyment</li>
<li>Can provide other hours of frustration</li>
</ul>
</ul>
<aside>
It's always good to have a summary slide with your key points.
</aside>
<p class="pg">15</p></section>
<section>
<h3>Acknowledgments<font class="lowlight">: Data</font></h3>
<div style="margin-left:120px;font-size:28px;">
<table cellspacing=25>
<tr valign="top">
<td class="lowlight">Alan Attie<br>Mark Keller</td>
<td width=10></td>
<td>Biochemistry, UW–Madison</td>
</tr>
<tr valign="top">
<td class="lowlight">Brian Yandell</td>
<td></td>
<td>Statistics and Horticulture, UW–Madison</td>
</tr>
<tr valign="top">
<td class="lowlight">Christina Kendziorski<br>Aimee Teo Broman</td>
<td></td>
<td>Biostatistics & Medical Informatics, UW–Madison</td>
</tr>
<tr valign="top">
<td class="lowlight">Eric Schadt
<td></td>
<td>Pacific Biosciences of California</td>
</tr>
<tr valign="top">
<td class="lowlight">Danielle Greenawalt<br>Amit Kulkarni</td>
<td></td>
<td>Merck & Co., Inc.</td>
</tr>
</table>
</div>
<aside>
Many people are involved in the study that led to this work.
</aside>
<p class="pg">16</p></section>
<section>
<h3>Acknowledgments<font class="lowlight">: Code</font></h3>
<div style="margin-left:120px">
<p><a href="http://d3js.org" class="highlight">D3</a> and <a href="https://github.com/mbostock/stack" class="highlight">stack.js</a> by <a href="http://bost.ocks.org/mike" rel="author">Mike Bostock</a>
<p><a href="http://alignedleft.com/tutorials/d3"
class="highlight">D3 tutorials</a> by <a href="http://alignedleft.com">Scott Murray</a>
<p><a href="http://coffeescript.org" class="highlight">CoffeeScript</a> by <a
href="https://github.com/jashkenas">Jeremy Ashkenas</a>
<p><a href="http://eloquentjavascript.net"
class="highlight"><i>Eloquent JavaScript</i></a> by <a href="http://marijnhaverbeke.nl">Marijn Haverbeke</a>
<p><a href="http://pragprog.com/book/tbcoffee/coffeescript"
class="highlight"><i>CoffeeScript</i> book</a> by <a href="http://trevorburnham.com">Trevor Burnham</a>
<p><a href="https://github.com/Caged/d3-tip" class="highlight">d3-tip</a> by <a href="http://labratrevenge.com">Justin Palmer</a>
</div>
<aside>
The interactive examples
were produced with the <a href="http://d3js.org">D3</a>
library (written in JavaScript). I wrote the code in CoffeeScript,
which is translated to JavaScript but is a better-designed language. <a
href="http://eloquentjavascript.net"><i>Eloquent JavaScript</i></a> is
a great free book. The <a
href="http://pragprog.com/book/tbcoffee/coffeescript"><i>CoffeeScript</i></a>
book is not free but is also great; you need to learn at least a bit of
JavaScript first. <a href="http://alignedleft.com/tutorials/d3">Scott
Murray's D3 tutorials</a> are superb and are a great place to start
for learning D3. These slides are in html, using <a
href="https://github.com/mbostock/stack">stack.js</a>. I used <a
href="http://github.com/kbroman/d3-tip">a modified version</a> of <a
href="http://github.com/Caged/d3-tip">d3-tip</a> for tool tips.
</aside>
<p class="pg">17</p></section>
<script type="text/javascript" src="js/sperm.js"></script>
<script type="text/javascript" src="js/stack.v0.js"></script>
</body>
</html>