Interactive graphics for genetic data

Karl Broman

Biostatistics & Medical Informatics, University of Wisconsin – Madison

kbroman.org
github.com/kbroman
@kwbroman

slides: bit.ly/Broman2015-12

Why aren’t all of our graphs interactive?

2

1994

Bandwidth = 1.00

3

1987

4

1987

5

1987

6

1984

7

Why?   summary + details

8

9

daviddeen.com

10

Intercross

11

Genome scan for QTL

12

Genome scan for QTL

12

Genome-scale phenotypes

13

 

14

 

15

Why?   summary + details

16

Why?   people are busy

17

Why?   reports to collaborators

18

Why?   teaching

19

Why not?

20

D3 is awesome!

You just need to learn html, css, svg, and javascript.

And don’t forget .enter()

http://mbostock.github.io/d3/talk/20111018/collision.html

21


svg.selectAll("empty")
   .data(my_data)
   .enter()
   .append("circle")
   .attr("cx", function(d) { return d.x })
   .attr("cy", function(d) { return d.y })
   .attr("r", 3)
   .attr("fill", function(d,i) {
        if(sex[i]=="male") return "gray"
        return "white" })

22


svg.selectAll("empty")
   .data(my_data)
   .enter()
   .append("circle")
   .attr("cx", function(d) { return d.x })
   .attr("cy", function(d) { return d.y })
   .attr("r", 3)
   .attr("fill", function(d,i) {
        if(sex[i]=="male") return "gray"
        return "white" })

22


svg.selectAll("empty")
   .data(my_data)
   .enter()
   .append("circle")
   .attr("cx", function(d) { return d.x })
   .attr("cy", function(d) { return d.y })
   .attr("r", 3)
   .attr("fill", function(d,i) {
        if(sex[i]=="male") return "gray"
        return "white" })

22


svg.selectAll("empty")
   .data(my_data)
   .enter()
   .append("circle")
   .attr("cx", function(d) { return d.x })
   .attr("cy", function(d) { return d.y })
   .attr("r", 3)
   .attr("fill", function(d,i) {
        if(sex[i]=="male") return "gray"
        return "white" })

22

JSFiddle is awesome!

23

Coffeescript is awesome!

blob.attr("x", (d) -> d.x)

height = options?.height ? 500

24

Coffeescript is awesome!

blob.attr("x", (d) -> d.x)

height = options?.height ? 500

25

htmlwidgets is awesome!

25

 

Easy or flexible?

26

Interactive eQTL plot

27

R/qtlcharts   kbroman.org/qtlcharts

28

R/qtlcharts   kbroman.org/d3panels

29

Summary

30

Acknowledgments

Alan Attie
Mark Keller
Biochemistry, UW–Madison
Brian Yandell Statistics and Horticulture, UW–Madison
Christina Kendziorski
Aimee Teo Broman
Biostatistics & Medical Informatics, UW–Madison
Eric Schadt Mount Sinai
Danielle Greenawalt
Amit Kulkarni
Merck & Co., Inc.
Śaunak Sen Epidemiology & Biostatistics, UC-San Francisco
Edgar Spalding
Candace Moore
Logan Johnson
Botany, UW-Madison

31

slides:   bit.ly/Broman2015-12  

kbroman.org

github.com/kbroman

@kwbroman

kbroman.org/qtlcharts

32