Skip to content

Instantly share code, notes, and snippets.

@IMYin
Last active June 22, 2018 14:23
Show Gist options
  • Save IMYin/4f8dc142922d907147f84aa5ef3a3394 to your computer and use it in GitHub Desktop.
Save IMYin/4f8dc142922d907147f84aa5ef3a3394 to your computer and use it in GitHub Desktop.
heatmap
license: mit

This example is inspired by Co-occurrence Matrix, Trulia Trends, and Selection Frame.

Changing orders

  • cluster: hierarchical clustering
  • probe name and contrast name: sort by probe name and contrast name
  • probe name: sort by probe name
  • contrast name: sort by contrast name
  • click a row label: sort cell values with the same row label
  • click a column label: sort cell values with the same column label
  • click a cell: select the row label of corresponding cell

Selecting cells

  • Using mouse to select cells, corresponding row and column labels will be highlighed as well
  • Press Alt Key to select multiple cell blocks

forked from paulgovan's block: heatmap

forked from IMYin's block: heatmap

row_idx col_idx log2ratio
1 1 0
2 1 0
3 1 0
4 1 0
5 1 0
6 1 0
7 1 0
8 1 0
9 1 0
10 1 0
11 1 0
12 1 1
13 1 0
14 1 0
15 1 0
16 1 0
17 1 0
18 1 0
19 1 0
20 1 0
21 1 0
22 1 0
23 1 0
24 1 0
25 1 0
26 1 0
27 1 0
28 1 1
29 1 0
30 1 0
31 1 0
32 1 0
33 1 0
34 1 0
35 1 0
36 1 -1
37 1 0
38 1 0
39 1 0
40 1 0
41 1 0
42 1 0
43 1 0
44 1 0
45 1 0
46 1 0
47 1 0
48 1 0
49 1 0
50 1 0
1 2 0
2 2 0
3 2 0
4 2 0
5 2 0
6 2 -1
7 2 0
8 2 0
9 2 0
10 2 1
11 2 0
12 2 0
13 2 0
14 2 0
15 2 0
16 2 0
17 2 -1
18 2 0
19 2 0
20 2 0
21 2 0
22 2 1
23 2 0
24 2 -1
25 2 0
26 2 0
27 2 0
28 2 0
29 2 0
30 2 0
31 2 0
32 2 0
33 2 -1
34 2 0
35 2 0
36 2 1
37 2 0
38 2 0
39 2 0
40 2 0
41 2 0
42 2 0
43 2 0
44 2 -1
45 2 0
46 2 0
47 2 0
48 2 0
49 2 0
50 2 0
1 3 0
2 3 0
3 3 -1
4 3 0
5 3 0
6 3 0
7 3 0
8 3 0
9 3 0
10 3 -1
11 3 0
12 3 -1
13 3 0
14 3 0
15 3 2
16 3 0
17 3 1
18 3 0
19 3 0
20 3 0
21 3 -1
22 3 0
23 3 0
24 3 0
25 3 0
26 3 0
27 3 -1
28 3 0
29 3 0
30 3 0
31 3 0
32 3 0
33 3 0
34 3 -1
35 3 0
36 3 -1
37 3 0
38 3 1
39 3 0
40 3 -1
41 3 0
42 3 0
43 3 -1
44 3 0
45 3 -1
46 3 0
47 3 -1
48 3 0
49 3 0
50 3 -1
1 4 -2
2 4 -3
3 4 1
4 4 1
5 4 -1
6 4 2
7 4 0
8 4 0
9 4 0
10 4 -2
11 4 0
12 4 1
13 4 3
14 4 0
15 4 1
16 4 0
17 4 -1
18 4 1
19 4 2
20 4 0
21 4 -1
22 4 0
23 4 1
24 4 2
25 4 0
26 4 0
27 4 1
28 4 0
29 4 0
30 4 0
31 4 2
32 4 1
33 4 0
34 4 1
35 4 0
36 4 0
37 4 -1
38 4 0
39 4 0
40 4 -1
41 4 1
42 4 -2
43 4 1
44 4 0
45 4 0
46 4 0
47 4 -1
48 4 4
49 4 0
50 4 0
1 5 0
2 5 0
3 5 -1
4 5 -1
5 5 0
6 5 0
7 5 -7
8 5 0
9 5 -1
10 5 -1
11 5 0
12 5 -1
13 5 0
14 5 0
15 5 0
16 5 1
17 5 0
18 5 -1
19 5 0
20 5 0
21 5 0
22 5 -1
23 5 0
24 5 0
25 5 0
26 5 0
27 5 -3
28 5 -1
29 5 0
30 5 0
31 5 0
32 5 -1
33 5 0
34 5 -3
35 5 0
36 5 -1
37 5 0
38 5 0
39 5 0
40 5 0
41 5 -1
42 5 -2
43 5 -1
44 5 0
45 5 -1
46 5 0
47 5 -1
48 5 -1
49 5 0
50 5 -2
1 6 0
2 6 -1
3 6 0
4 6 0
5 6 -1
6 6 -1
7 6 -1
8 6 0
9 6 -1
10 6 -1
11 6 0
12 6 0
13 6 0
14 6 0
15 6 1
16 6 0
17 6 -1
18 6 -2
19 6 0
20 6 -2
21 6 -1
22 6 -1
23 6 0
24 6 -1
25 6 -1
26 6 -1
27 6 -3
28 6 -1
29 6 0
30 6 0
31 6 0
32 6 -1
33 6 -1
34 6 -3
35 6 0
36 6 0
37 6 -1
38 6 0
39 6 0
40 6 -1
41 6 -1
42 6 -1
43 6 -1
44 6 -1
45 6 -1
46 6 0
47 6 -2
48 6 0
49 6 -1
50 6 -3
1 7 0
2 7 0
3 7 0
4 7 0
5 7 -1
6 7 0
7 7 0
8 7 -2
9 7 -1
10 7 0
11 7 0
12 7 0
13 7 0
14 7 0
15 7 0
16 7 0
17 7 1
18 7 0
19 7 0
20 7 0
21 7 -1
22 7 0
23 7 0
24 7 0
25 7 0
26 7 0
27 7 0
28 7 0
29 7 0
30 7 0
31 7 0
32 7 0
33 7 0
34 7 1
35 7 1
36 7 0
37 7 0
38 7 0
39 7 0
40 7 0
41 7 0
42 7 1
43 7 0
44 7 0
45 7 0
46 7 0
47 7 0
48 7 0
49 7 0
50 7 0
1 8 0
2 8 0
3 8 0
4 8 0
5 8 0
6 8 0
7 8 2
8 8 -1
9 8 0
10 8 0
11 8 0
12 8 0
13 8 0
14 8 0
15 8 0
16 8 0
17 8 0
18 8 0
19 8 0
20 8 0
21 8 0
22 8 1
23 8 0
24 8 -1
25 8 0
26 8 0
27 8 0
28 8 0
29 8 0
30 8 1
31 8 0
32 8 0
33 8 1
34 8 0
35 8 0
36 8 0
37 8 0
38 8 0
39 8 0
40 8 0
41 8 0
42 8 0
43 8 0
44 8 0
45 8 0
46 8 0
47 8 0
48 8 0
49 8 1
50 8 0
1 9 -1
2 9 0
3 9 0
4 9 1
5 9 0
6 9 0
7 9 0
8 9 0
9 9 0
10 9 0
11 9 0
12 9 0
13 9 0
14 9 0
15 9 0
16 9 0
17 9 0
18 9 0
19 9 0
20 9 0
21 9 0
22 9 0
23 9 0
24 9 0
25 9 0
26 9 0
27 9 -1
28 9 0
29 9 0
30 9 0
31 9 0
32 9 0
33 9 0
34 9 0
35 9 0
36 9 0
37 9 0
38 9 0
39 9 0
40 9 0
41 9 0
42 9 -1
43 9 0
44 9 0
45 9 0
46 9 -1
47 9 0
48 9 0
49 9 0
50 9 0
1 10 1
2 10 0
3 10 -1
4 10 0
5 10 1
6 10 -1
7 10 0
8 10 0
9 10 0
10 10 0
11 10 -1
12 10 0
13 10 0
14 10 0
15 10 0
16 10 0
17 10 -1
18 10 1
19 10 -1
20 10 -1
21 10 1
22 10 -1
23 10 -1
24 10 0
25 10 0
26 10 0
27 10 -1
28 10 0
29 10 0
30 10 -1
31 10 -1
32 10 0
33 10 0
34 10 0
35 10 -1
36 10 0
37 10 2
38 10 0
39 10 -1
40 10 1
41 10 0
42 10 1
43 10 0
44 10 0
45 10 0
46 10 0
47 10 0
48 10 -1
49 10 0
50 10 0
1 11 0
2 11 0
3 11 0
4 11 0
5 11 0
6 11 0
7 11 0
8 11 0
9 11 0
10 11 0
11 11 0
12 11 0
13 11 0
14 11 0
15 11 0
16 11 0
17 11 0
18 11 0
19 11 0
20 11 0
21 11 0
22 11 0
23 11 0
24 11 0
25 11 0
26 11 0
27 11 0
28 11 0
29 11 0
30 11 0
31 11 0
32 11 0
33 11 0
34 11 0
35 11 0
36 11 1
37 11 0
38 11 0
39 11 0
40 11 0
41 11 0
42 11 0
43 11 0
44 11 0
45 11 0
46 11 0
47 11 0
48 11 0
49 11 0
50 11 0
1 12 0
2 12 0
3 12 0
4 12 0
5 12 0
6 12 0
7 12 -1
8 12 0
9 12 0
10 12 0
11 12 -1
12 12 0
13 12 1
14 12 0
15 12 0
16 12 0
17 12 0
18 12 0
19 12 0
20 12 -1
21 12 0
22 12 -1
23 12 0
24 12 1
25 12 0
26 12 0
27 12 2
28 12 0
29 12 0
30 12 -2
31 12 0
32 12 0
33 12 0
34 12 2
35 12 0
36 12 1
37 12 0
38 12 0
39 12 0
40 12 0
41 12 -1
42 12 0
43 12 0
44 12 0
45 12 -1
46 12 0
47 12 0
48 12 0
49 12 -1
50 12 0
1 13 0
2 13 0
3 13 0
4 13 0
5 13 0
6 13 0
7 13 0
8 13 0
9 13 0
10 13 0
11 13 0
12 13 0
13 13 0
14 13 1
15 13 0
16 13 0
17 13 0
18 13 0
19 13 0
20 13 0
21 13 0
22 13 0
23 13 0
24 13 0
25 13 0
26 13 0
27 13 0
28 13 0
29 13 0
30 13 0
31 13 0
32 13 0
33 13 0
34 13 0
35 13 0
36 13 0
37 13 0
38 13 0
39 13 0
40 13 0
41 13 0
42 13 0
43 13 0
44 13 0
45 13 0
46 13 0
47 13 0
48 13 0
49 13 0
50 13 0
1 14 0
2 14 0
3 14 0
4 14 0
5 14 0
6 14 0
7 14 0
8 14 0
9 14 0
10 14 0
11 14 -1
12 14 -1
13 14 0
14 14 2
15 14 0
16 14 0
17 14 0
18 14 0
19 14 0
20 14 -1
21 14 0
22 14 0
23 14 0
24 14 0
25 14 0
26 14 -1
27 14 0
28 14 0
29 14 0
30 14 -1
31 14 0
32 14 0
33 14 0
34 14 0
35 14 0
36 14 0
37 14 0
38 14 0
39 14 0
40 14 0
41 14 0
42 14 0
43 14 0
44 14 0
45 14 -1
46 14 0
47 14 0
48 14 0
49 14 -1
50 14 0
1 15 0
2 15 0
3 15 0
4 15 -1
5 15 0
6 15 0
7 15 0
8 15 0
9 15 0
10 15 0
11 15 -1
12 15 0
13 15 0
14 15 1
15 15 -1
16 15 0
17 15 0
18 15 0
19 15 0
20 15 -1
21 15 0
22 15 0
23 15 0
24 15 0
25 15 0
26 15 -1
27 15 -1
28 15 0
29 15 0
30 15 -1
31 15 0
32 15 -1
33 15 0
34 15 0
35 15 0
36 15 0
37 15 0
38 15 0
39 15 0
40 15 0
41 15 0
42 15 0
43 15 0
44 15 0
45 15 0
46 15 0
47 15 0
48 15 0
49 15 -1
50 15 1
1 16 0
2 16 0
3 16 0
4 16 0
5 16 0
6 16 0
7 16 1
8 16 0
9 16 0
10 16 0
11 16 -1
12 16 -1
13 16 0
14 16 2
15 16 0
16 16 0
17 16 0
18 16 -1
19 16 0
20 16 -1
21 16 0
22 16 0
23 16 0
24 16 0
25 16 0
26 16 -1
27 16 0
28 16 0
29 16 0
30 16 -1
31 16 0
32 16 0
33 16 0
34 16 0
35 16 0
36 16 0
37 16 0
38 16 0
39 16 0
40 16 0
41 16 0
42 16 0
43 16 0
44 16 0
45 16 0
46 16 0
47 16 0
48 16 0
49 16 -1
50 16 0
1 17 0
2 17 0
3 17 -1
4 17 0
5 17 0
6 17 0
7 17 0
8 17 0
9 17 -1
10 17 0
11 17 -1
12 17 -1
13 17 0
14 17 0
15 17 -1
16 17 0
17 17 0
18 17 0
19 17 -1
20 17 -1
21 17 0
22 17 0
23 17 0
24 17 0
25 17 -1
26 17 -1
27 17 0
28 17 1
29 17 -1
30 17 -1
31 17 -1
32 17 0
33 17 0
34 17 0
35 17 0
36 17 -1
37 17 0
38 17 0
39 17 0
40 17 0
41 17 0
42 17 0
43 17 0
44 17 0
45 17 -1
46 17 0
47 17 0
48 17 0
49 17 -1
50 17 0
1 18 0
2 18 3
3 18 1
4 18 0
5 18 0
6 18 -1
7 18 -1
8 18 -1
9 18 0
10 18 2
11 18 2
12 18 -1
13 18 -1
14 18 0
15 18 1
16 18 0
17 18 0
18 18 0
19 18 0
20 18 1
21 18 0
22 18 3
23 18 3
24 18 -1
25 18 1
26 18 0
27 18 0
28 18 0
29 18 0
30 18 2
31 18 0
32 18 2
33 18 2
34 18 0
35 18 0
36 18 1
37 18 0
38 18 0
39 18 -1
40 18 0
41 18 2
42 18 0
43 18 2
44 18 0
45 18 -1
46 18 0
47 18 2
48 18 -1
49 18 3
50 18 0
1 19 0
2 19 0
3 19 0
4 19 0
5 19 0
6 19 0
7 19 0
8 19 0
9 19 0
10 19 0
11 19 0
12 19 0
13 19 0
14 19 0
15 19 0
16 19 0
17 19 0
18 19 0
19 19 0
20 19 0
21 19 0
22 19 0
23 19 0
24 19 0
25 19 0
26 19 0
27 19 0
28 19 0
29 19 -1
30 19 0
31 19 0
32 19 0
33 19 0
34 19 0
35 19 0
36 19 0
37 19 0
38 19 0
39 19 0
40 19 0
41 19 0
42 19 0
43 19 0
44 19 0
45 19 0
46 19 0
47 19 0
48 19 0
49 19 0
50 19 0
1 20 1
2 20 0
3 20 0
4 20 0
5 20 0
6 20 0
7 20 0
8 20 0
9 20 1
10 20 0
11 20 0
12 20 0
13 20 0
14 20 0
15 20 0
16 20 0
17 20 0
18 20 0
19 20 0
20 20 0
21 20 0
22 20 0
23 20 0
24 20 0
25 20 0
26 20 0
27 20 -1
28 20 0
29 20 1
30 20 1
31 20 0
32 20 0
33 20 0
34 20 0
35 20 0
36 20 0
37 20 0
38 20 0
39 20 0
40 20 0
41 20 0
42 20 0
43 20 0
44 20 0
45 20 0
46 20 0
47 20 0
48 20 0
49 20 0
50 20 0
1 21 0
2 21 -1
3 21 0
4 21 0
5 21 0
6 21 0
7 21 0
8 21 0
9 21 0
10 21 0
11 21 0
12 21 0
13 21 0
14 21 -1
15 21 0
16 21 0
17 21 0
18 21 0
19 21 -1
20 21 0
21 21 1
22 21 -1
23 21 0
24 21 0
25 21 5
26 21 1
27 21 0
28 21 0
29 21 6
30 21 -1
31 21 0
32 21 0
33 21 0
34 21 0
35 21 0
36 21 1
37 21 0
38 21 0
39 21 1
40 21 0
41 21 0
42 21 0
43 21 -2
44 21 -1
45 21 0
46 21 1
47 21 -1
48 21 0
49 21 -1
50 21 0
1 22 0
2 22 0
3 22 0
4 22 0
5 22 0
6 22 0
7 22 0
8 22 0
9 22 0
10 22 0
11 22 0
12 22 0
13 22 0
14 22 0
15 22 0
16 22 0
17 22 0
18 22 0
19 22 0
20 22 0
21 22 0
22 22 0
23 22 0
24 22 0
25 22 -1
26 22 0
27 22 0
28 22 0
29 22 -1
30 22 0
31 22 0
32 22 0
33 22 0
34 22 0
35 22 0
36 22 0
37 22 1
38 22 0
39 22 0
40 22 0
41 22 0
42 22 0
43 22 0
44 22 0
45 22 0
46 22 0
47 22 0
48 22 0
49 22 0
50 22 0
1 23 0
2 23 0
3 23 0
4 23 0
5 23 0
6 23 0
7 23 0
8 23 0
9 23 0
10 23 0
11 23 0
12 23 0
13 23 0
14 23 0
15 23 0
16 23 0
17 23 0
18 23 0
19 23 0
20 23 0
21 23 0
22 23 0
23 23 0
24 23 0
25 23 0
26 23 0
27 23 0
28 23 0
29 23 -1
30 23 0
31 23 0
32 23 0
33 23 0
34 23 0
35 23 0
36 23 0
37 23 0
38 23 0
39 23 0
40 23 0
41 23 0
42 23 0
43 23 0
44 23 0
45 23 0
46 23 0
47 23 0
48 23 0
49 23 0
50 23 -1
1 24 0
2 24 0
3 24 0
4 24 0
5 24 0
6 24 0
7 24 0
8 24 0
9 24 0
10 24 0
11 24 0
12 24 0
13 24 1
14 24 0
15 24 0
16 24 0
17 24 0
18 24 0
19 24 0
20 24 0
21 24 0
22 24 0
23 24 0
24 24 1
25 24 0
26 24 0
27 24 0
28 24 1
29 24 0
30 24 1
31 24 0
32 24 0
33 24 0
34 24 0
35 24 0
36 24 0
37 24 -1
38 24 0
39 24 0
40 24 0
41 24 0
42 24 0
43 24 0
44 24 0
45 24 0
46 24 0
47 24 0
48 24 0
49 24 0
50 24 0
1 25 0
2 25 0
3 25 0
4 25 0
5 25 0
6 25 0
7 25 0
8 25 0
9 25 0
10 25 0
11 25 0
12 25 0
13 25 0
14 25 0
15 25 0
16 25 0
17 25 0
18 25 0
19 25 0
20 25 0
21 25 0
22 25 0
23 25 0
24 25 0
25 25 -2
26 25 0
27 25 0
28 25 0
29 25 -2
30 25 0
31 25 0
32 25 0
33 25 0
34 25 0
35 25 0
36 25 0
37 25 0
38 25 0
39 25 0
40 25 0
41 25 0
42 25 0
43 25 0
44 25 0
45 25 0
46 25 0
47 25 0
48 25 0
49 25 0
50 25 0
1 26 -2
2 26 1
3 26 0
4 26 0
5 26 -1
6 26 0
7 26 0
8 26 0
9 26 1
10 26 -1
11 26 1
12 26 0
13 26 0
14 26 0
15 26 -1
16 26 0
17 26 0
18 26 -1
19 26 0
20 26 0
21 26 -2
22 26 0
23 26 0
24 26 1
25 26 0
26 26 0
27 26 0
28 26 0
29 26 0
30 26 1
31 26 0
32 26 0
33 26 0
34 26 1
35 26 0
36 26 0
37 26 -1
38 26 0
39 26 0
40 26 -1
41 26 1
42 26 -1
43 26 2
44 26 0
45 26 1
46 26 -1
47 26 -1
48 26 0
49 26 0
50 26 -1
1 27 -2
2 27 1
3 27 0
4 27 1
5 27 -1
6 27 0
7 27 0
8 27 0
9 27 1
10 27 -1
11 27 1
12 27 0
13 27 1
14 27 0
15 27 -1
16 27 0
17 27 0
18 27 0
19 27 0
20 27 0
21 27 -2
22 27 0
23 27 0
24 27 1
25 27 0
26 27 0
27 27 0
28 27 0
29 27 0
30 27 0
31 27 1
32 27 0
33 27 0
34 27 2
35 27 0
36 27 0
37 27 -1
38 27 0
39 27 1
40 27 -1
41 27 0
42 27 -1
43 27 2
44 27 0
45 27 1
46 27 -1
47 27 -1
48 27 -1
49 27 0
50 27 -1
1 28 -2
2 28 0
3 28 0
4 28 2
5 28 -1
6 28 4
7 28 0
8 28 -2
9 28 3
10 28 -1
11 28 -1
12 28 4
13 28 4
14 28 0
15 28 -1
16 28 -1
17 28 0
18 28 2
19 28 0
20 28 0
21 28 -1
22 28 0
23 28 0
24 28 3
25 28 -1
26 28 0
27 28 1
28 28 0
29 28 -1
30 28 0
31 28 1
32 28 1
33 28 0
34 28 3
35 28 -1
36 28 0
37 28 -2
38 28 0
39 28 3
40 28 -1
41 28 -1
42 28 -2
43 28 1
44 28 -1
45 28 1
46 28 0
47 28 0
48 28 0
49 28 -2
50 28 -1
1 29 0
2 29 -1
3 29 0
4 29 4
5 29 -2
6 29 3
7 29 0
8 29 -3
9 29 4
10 29 0
11 29 0
12 29 1
13 29 2
14 29 2
15 29 -2
16 29 -1
17 29 4
18 29 4
19 29 1
20 29 1
21 29 -2
22 29 0
23 29 -1
24 29 2
25 29 -2
26 29 -1
27 29 -1
28 29 0
29 29 0
30 29 3
31 29 2
32 29 2
33 29 1
34 29 1
35 29 0
36 29 -1
37 29 -1
38 29 0
39 29 3
40 29 -3
41 29 -2
42 29 -3
43 29 0
44 29 0
45 29 0
46 29 5
47 29 1
48 29 2
49 29 0
50 29 2
1 30 -1
2 30 -1
3 30 0
4 30 0
5 30 0
6 30 -1
7 30 0
8 30 -2
9 30 2
10 30 -1
11 30 0
12 30 -1
13 30 5
14 30 0
15 30 -2
16 30 -1
17 30 -1
18 30 -1
19 30 0
20 30 -1
21 30 0
22 30 0
23 30 0
24 30 4
25 30 -2
26 30 -1
27 30 1
28 30 0
29 30 -1
30 30 0
31 30 1
32 30 -1
33 30 -1
34 30 3
35 30 -1
36 30 -1
37 30 -1
38 30 0
39 30 3
40 30 0
41 30 -1
42 30 -1
43 30 1
44 30 -1
45 30 2
46 30 -1
47 30 -2
48 30 1
49 30 0
50 30 0
1 31 -1
2 31 0
3 31 1
4 31 0
5 31 -1
6 31 -1
7 31 -2
8 31 -1
9 31 0
10 31 -1
11 31 0
12 31 -2
13 31 4
14 31 1
15 31 -1
16 31 -1
17 31 0
18 31 1
19 31 0
20 31 -1
21 31 -1
22 31 0
23 31 1
24 31 2
25 31 -2
26 31 1
27 31 -1
28 31 0
29 31 -2
30 31 0
31 31 1
32 31 -1
33 31 -1
34 31 -1
35 31 0
36 31 -2
37 31 0
38 31 1
39 31 1
40 31 -1
41 31 -1
42 31 0
43 31 0
44 31 -1
45 31 -1
46 31 0
47 31 -2
48 31 2
49 31 0
50 31 0
1 32 -1
2 32 -1
3 32 1
4 32 0
5 32 0
6 32 -1
7 32 0
8 32 -2
9 32 0
10 32 -1
11 32 0
12 32 -2
13 32 5
14 32 1
15 32 -1
16 32 -2
17 32 0
18 32 1
19 32 0
20 32 0
21 32 -1
22 32 0
23 32 0
24 32 4
25 32 -2
26 32 1
27 32 -1
28 32 0
29 32 -2
30 32 0
31 32 1
32 32 0
33 32 -1
34 32 0
35 32 0
36 32 -2
37 32 -1
38 32 1
39 32 1
40 32 0
41 32 -1
42 32 -1
43 32 0
44 32 -1
45 32 0
46 32 0
47 32 -1
48 32 2
49 32 0
50 32 0
1 33 3
2 33 1
3 33 -1
4 33 -3
5 33 7
6 33 -1
7 33 -1
8 33 -2
9 33 -1
10 33 0
11 33 -1
12 33 2
13 33 4
14 33 -1
15 33 2
16 33 -1
17 33 3
18 33 -4
19 33 -2
20 33 -2
21 33 5
22 33 -1
23 33 0
24 33 4
25 33 -1
26 33 -1
27 33 -1
28 33 6
29 33 -2
30 33 -4
31 33 0
32 33 0
33 33 -1
34 33 0
35 33 0
36 33 -1
37 33 3
38 33 -1
39 33 0
40 33 7
41 33 0
42 33 5
43 33 0
44 33 -2
45 33 2
46 33 0
47 33 3
48 33 -2
49 33 -2
50 33 4
1 34 -1
2 34 -2
3 34 0
4 34 -8
5 34 -1
6 34 -1
7 34 0
8 34 0
9 34 1
10 34 -1
11 34 -4
12 34 -1
13 34 -1
14 34 0
15 34 2
16 34 0
17 34 0
18 34 -5
19 34 -3
20 34 -2
21 34 -1
22 34 -3
23 34 0
24 34 0
25 34 1
26 34 0
27 34 0
28 34 -1
29 34 1
30 34 -5
31 34 1
32 34 -1
33 34 -2
34 34 0
35 34 0
36 34 0
37 34 0
38 34 0
39 34 1
40 34 0
41 34 -2
42 34 0
43 34 1
44 34 0
45 34 0
46 34 -1
47 34 0
48 34 0
49 34 -4
50 34 -1
1 35 5
2 35 0
3 35 -2
4 35 -1
5 35 7
6 35 -2
7 35 -2
8 35 -3
9 35 0
10 35 0
11 35 1
12 35 -1
13 35 3
14 35 1
15 35 1
16 35 -1
17 35 7
18 35 -2
19 35 0
20 35 0
21 35 5
22 35 0
23 35 -1
24 35 3
25 35 -2
26 35 -2
27 35 -3
28 35 6
29 35 -1
30 35 0
31 35 1
32 35 1
33 35 0
34 35 -2
35 35 0
36 35 -2
37 35 4
38 35 -1
39 35 0
40 35 5
41 35 -1
42 35 4
43 35 -1
44 35 -1
45 35 0
46 35 4
47 35 4
48 35 0
49 35 -1
50 35 6
1 36 0
2 36 -3
3 36 0
4 36 -10
5 36 0
6 36 -6
7 36 0
8 36 0
9 36 0
10 36 -1
11 36 -3
12 36 -7
13 36 0
14 36 0
15 36 1
16 36 1
17 36 0
18 36 -7
19 36 -3
20 36 -3
21 36 0
22 36 -3
23 36 0
24 36 1
25 36 1
26 36 0
27 36 0
28 36 0
29 36 0
30 36 -5
31 36 1
32 36 -3
33 36 -3
34 36 0
35 36 0
36 36 0
37 36 0
38 36 0
39 36 0
40 36 1
41 36 -2
42 36 0
43 36 1
44 36 0
45 36 1
46 36 -2
47 36 -1
48 36 1
49 36 -2
50 36 0
1 37 0
2 37 0
3 37 0
4 37 0
5 37 0
6 37 0
7 37 -1
8 37 0
9 37 0
10 37 0
11 37 0
12 37 0
13 37 0
14 37 0
15 37 2
16 37 1
17 37 0
18 37 0
19 37 0
20 37 0
21 37 0
22 37 0
23 37 0
24 37 0
25 37 0
26 37 0
27 37 0
28 37 0
29 37 0
30 37 -1
31 37 0
32 37 0
33 37 0
34 37 0
35 37 0
36 37 0
37 37 0
38 37 1
39 37 0
40 37 0
41 37 0
42 37 0
43 37 0
44 37 0
45 37 0
46 37 0
47 37 0
48 37 0
49 37 -1
50 37 0
1 38 0
2 38 0
3 38 0
4 38 0
5 38 0
6 38 0
7 38 -1
8 38 0
9 38 0
10 38 0
11 38 0
12 38 0
13 38 0
14 38 0
15 38 2
16 38 0
17 38 0
18 38 0
19 38 0
20 38 0
21 38 0
22 38 0
23 38 0
24 38 0
25 38 0
26 38 0
27 38 1
28 38 0
29 38 0
30 38 0
31 38 0
32 38 0
33 38 0
34 38 1
35 38 0
36 38 0
37 38 0
38 38 0
39 38 0
40 38 0
41 38 0
42 38 1
43 38 0
44 38 0
45 38 -1
46 38 0
47 38 0
48 38 0
49 38 0
50 38 0
1 39 0
2 39 0
3 39 0
4 39 0
5 39 0
6 39 0
7 39 0
8 39 0
9 39 0
10 39 0
11 39 0
12 39 0
13 39 0
14 39 0
15 39 0
16 39 0
17 39 1
18 39 0
19 39 0
20 39 0
21 39 0
22 39 0
23 39 0
24 39 0
25 39 0
26 39 0
27 39 0
28 39 0
29 39 0
30 39 1
31 39 0
32 39 0
33 39 0
34 39 0
35 39 -1
36 39 0
37 39 0
38 39 0
39 39 0
40 39 0
41 39 0
42 39 0
43 39 0
44 39 0
45 39 0
46 39 0
47 39 1
48 39 0
49 39 0
50 39 0
1 40 0
2 40 0
3 40 0
4 40 0
5 40 0
6 40 0
7 40 0
8 40 0
9 40 0
10 40 0
11 40 0
12 40 0
13 40 0
14 40 0
15 40 0
16 40 0
17 40 0
18 40 0
19 40 0
20 40 0
21 40 0
22 40 0
23 40 0
24 40 0
25 40 0
26 40 0
27 40 0
28 40 0
29 40 0
30 40 0
31 40 0
32 40 0
33 40 0
34 40 0
35 40 0
36 40 0
37 40 0
38 40 0
39 40 0
40 40 0
41 40 0
42 40 0
43 40 0
44 40 0
45 40 0
46 40 0
47 40 0
48 40 0
49 40 0
50 40 0
1 41 0
2 41 0
3 41 0
4 41 0
5 41 0
6 41 0
7 41 0
8 41 0
9 41 0
10 41 0
11 41 -2
12 41 0
13 41 0
14 41 0
15 41 0
16 41 0
17 41 0
18 41 0
19 41 -1
20 41 -2
21 41 0
22 41 -1
23 41 0
24 41 0
25 41 0
26 41 0
27 41 0
28 41 0
29 41 0
30 41 -4
31 41 0
32 41 0
33 41 0
34 41 0
35 41 0
36 41 0
37 41 0
38 41 0
39 41 0
40 41 0
41 41 -1
42 41 0
43 41 0
44 41 0
45 41 0
46 41 0
47 41 0
48 41 0
49 41 -3
50 41 0
1 42 0
2 42 0
3 42 0
4 42 0
5 42 0
6 42 -1
7 42 0
8 42 -1
9 42 0
10 42 0
11 42 -3
12 42 0
13 42 0
14 42 0
15 42 0
16 42 0
17 42 0
18 42 0
19 42 -1
20 42 -1
21 42 0
22 42 -1
23 42 0
24 42 1
25 42 0
26 42 -1
27 42 0
28 42 0
29 42 1
30 42 -3
31 42 -1
32 42 0
33 42 0
34 42 1
35 42 0
36 42 3
37 42 1
38 42 0
39 42 1
40 42 0
41 42 -1
42 42 1
43 42 1
44 42 0
45 42 1
46 42 0
47 42 0
48 42 -1
49 42 -3
50 42 0
1 43 0
2 43 0
3 43 0
4 43 0
5 43 0
6 43 0
7 43 0
8 43 0
9 43 0
10 43 0
11 43 -1
12 43 0
13 43 0
14 43 1
15 43 0
16 43 0
17 43 0
18 43 0
19 43 0
20 43 -1
21 43 0
22 43 0
23 43 0
24 43 0
25 43 0
26 43 0
27 43 0
28 43 0
29 43 0
30 43 -1
31 43 0
32 43 0
33 43 0
34 43 0
35 43 0
36 43 0
37 43 0
38 43 0
39 43 0
40 43 0
41 43 0
42 43 0
43 43 0
44 43 0
45 43 0
46 43 0
47 43 0
48 43 0
49 43 -1
50 43 0
1 44 0
2 44 0
3 44 0
4 44 0
5 44 0
6 44 0
7 44 -1
8 44 0
9 44 0
10 44 0
11 44 0
12 44 0
13 44 0
14 44 1
15 44 0
16 44 0
17 44 0
18 44 0
19 44 0
20 44 0
21 44 0
22 44 0
23 44 0
24 44 0
25 44 0
26 44 0
27 44 0
28 44 0
29 44 0
30 44 0
31 44 0
32 44 0
33 44 0
34 44 0
35 44 0
36 44 0
37 44 0
38 44 0
39 44 0
40 44 0
41 44 0
42 44 0
43 44 0
44 44 0
45 44 -1
46 44 0
47 44 0
48 44 0
49 44 0
50 44 0
1 45 0
2 45 0
3 45 0
4 45 0
5 45 1
6 45 0
7 45 0
8 45 0
9 45 1
10 45 0
11 45 0
12 45 0
13 45 0
14 45 0
15 45 0
16 45 0
17 45 0
18 45 1
19 45 0
20 45 0
21 45 0
22 45 0
23 45 -1
24 45 0
25 45 0
26 45 0
27 45 0
28 45 0
29 45 1
30 45 0
31 45 0
32 45 0
33 45 0
34 45 0
35 45 0
36 45 1
37 45 0
38 45 0
39 45 0
40 45 -1
41 45 0
42 45 0
43 45 0
44 45 0
45 45 1
46 45 0
47 45 0
48 45 0
49 45 -1
50 45 0
1 46 0
2 46 0
3 46 0
4 46 0
5 46 0
6 46 0
7 46 -1
8 46 1
9 46 0
10 46 0
11 46 0
12 46 0
13 46 0
14 46 0
15 46 0
16 46 0
17 46 0
18 46 0
19 46 0
20 46 0
21 46 0
22 46 0
23 46 0
24 46 0
25 46 0
26 46 -2
27 46 0
28 46 0
29 46 0
30 46 0
31 46 0
32 46 0
33 46 0
34 46 0
35 46 0
36 46 0
37 46 0
38 46 0
39 46 0
40 46 0
41 46 0
42 46 0
43 46 0
44 46 0
45 46 -1
46 46 0
47 46 0
48 46 0
49 46 0
50 46 0
1 47 0
2 47 0
3 47 0
4 47 0
5 47 0
6 47 0
7 47 -1
8 47 2
9 47 0
10 47 0
11 47 0
12 47 0
13 47 0
14 47 0
15 47 0
16 47 1
17 47 0
18 47 0
19 47 0
20 47 0
21 47 0
22 47 0
23 47 0
24 47 0
25 47 0
26 47 -1
27 47 0
28 47 0
29 47 0
30 47 0
31 47 0
32 47 0
33 47 0
34 47 0
35 47 0
36 47 0
37 47 0
38 47 0
39 47 0
40 47 0
41 47 0
42 47 0
43 47 0
44 47 0
45 47 -1
46 47 0
47 47 0
48 47 0
49 47 0
50 47 0
1 48 0
2 48 0
3 48 0
4 48 0
5 48 0
6 48 0
7 48 -1
8 48 2
9 48 0
10 48 0
11 48 0
12 48 0
13 48 0
14 48 0
15 48 0
16 48 1
17 48 0
18 48 0
19 48 0
20 48 0
21 48 0
22 48 0
23 48 0
24 48 0
25 48 0
26 48 -1
27 48 0
28 48 0
29 48 0
30 48 0
31 48 0
32 48 0
33 48 0
34 48 0
35 48 0
36 48 0
37 48 0
38 48 0
39 48 0
40 48 0
41 48 0
42 48 0
43 48 0
44 48 0
45 48 0
46 48 0
47 48 0
48 48 0
49 48 0
50 48 0
1 49 0
2 49 0
3 49 0
4 49 1
5 49 0
6 49 0
7 49 -2
8 49 1
9 49 0
10 49 0
11 49 0
12 49 0
13 49 0
14 49 0
15 49 0
16 49 0
17 49 0
18 49 0
19 49 0
20 49 0
21 49 0
22 49 0
23 49 1
24 49 0
25 49 0
26 49 0
27 49 0
28 49 0
29 49 0
30 49 0
31 49 0
32 49 0
33 49 0
34 49 0
35 49 0
36 49 0
37 49 -1
38 49 0
39 49 0
40 49 0
41 49 0
42 49 0
43 49 1
44 49 0
45 49 -1
46 49 0
47 49 0
48 49 1
49 49 0
50 49 0
1 50 0
2 50 0
3 50 0
4 50 1
5 50 0
6 50 0
7 50 -1
8 50 -1
9 50 0
10 50 0
11 50 0
12 50 1
13 50 0
14 50 0
15 50 0
16 50 -1
17 50 -1
18 50 1
19 50 0
20 50 0
21 50 0
22 50 0
23 50 0
24 50 0
25 50 0
26 50 1
27 50 0
28 50 0
29 50 0
30 50 -1
31 50 0
32 50 0
33 50 0
34 50 0
35 50 0
36 50 0
37 50 0
38 50 0
39 50 0
40 50 -1
41 50 0
42 50 0
43 50 1
44 50 0
45 50 0
46 50 0
47 50 0
48 50 0
49 50 0
50 50 0
1 51 0
2 51 0
3 51 0
4 51 1
5 51 0
6 51 0
7 51 -2
8 51 -1
9 51 0
10 51 0
11 51 0
12 51 0
13 51 1
14 51 0
15 51 0
16 51 0
17 51 0
18 51 1
19 51 0
20 51 0
21 51 0
22 51 0
23 51 1
24 51 1
25 51 0
26 51 1
27 51 1
28 51 0
29 51 0
30 51 0
31 51 1
32 51 0
33 51 0
34 51 1
35 51 0
36 51 -1
37 51 -1
38 51 0
39 51 0
40 51 0
41 51 0
42 51 0
43 51 1
44 51 0
45 51 0
46 51 0
47 51 0
48 51 0
49 51 0
50 51 0
1 52 0
2 52 0
3 52 -1
4 52 -1
5 52 0
6 52 0
7 52 0
8 52 0
9 52 0
10 52 -1
11 52 0
12 52 0
13 52 -1
14 52 0
15 52 0
16 52 -2
17 52 0
18 52 0
19 52 0
20 52 0
21 52 0
22 52 0
23 52 0
24 52 0
25 52 -1
26 52 0
27 52 -2
28 52 0
29 52 -1
30 52 0
31 52 -1
32 52 0
33 52 0
34 52 -2
35 52 0
36 52 -2
37 52 0
38 52 0
39 52 0
40 52 0
41 52 -1
42 52 -2
43 52 0
44 52 0
45 52 0
46 52 0
47 52 -1
48 52 0
49 52 0
50 52 0
1 53 0
2 53 0
3 53 0
4 53 0
5 53 0
6 53 0
7 53 0
8 53 0
9 53 0
10 53 0
11 53 0
12 53 0
13 53 1
14 53 0
15 53 0
16 53 0
17 53 0
18 53 0
19 53 0
20 53 0
21 53 0
22 53 0
23 53 0
24 53 0
25 53 0
26 53 0
27 53 0
28 53 0
29 53 0
30 53 0
31 53 1
32 53 0
33 53 0
34 53 0
35 53 0
36 53 0
37 53 0
38 53 0
39 53 0
40 53 0
41 53 0
42 53 0
43 53 0
44 53 0
45 53 0
46 53 0
47 53 1
48 53 0
49 53 0
50 53 0
1 54 0
2 54 0
3 54 0
4 54 0
5 54 0
6 54 0
7 54 -1
8 54 1
9 54 0
10 54 0
11 54 0
12 54 0
13 54 1
14 54 0
15 54 0
16 54 0
17 54 0
18 54 0
19 54 0
20 54 0
21 54 0
22 54 0
23 54 0
24 54 0
25 54 0
26 54 0
27 54 0
28 54 -1
29 54 1
30 54 0
31 54 0
32 54 0
33 54 0
34 54 0
35 54 0
36 54 0
37 54 0
38 54 1
39 54 0
40 54 0
41 54 0
42 54 0
43 54 0
44 54 0
45 54 -1
46 54 0
47 54 0
48 54 0
49 54 0
50 54 0
1 55 0
2 55 -1
3 55 1
4 55 0
5 55 -1
6 55 1
7 55 0
8 55 -1
9 55 0
10 55 0
11 55 1
12 55 0
13 55 2
14 55 0
15 55 1
16 55 -1
17 55 0
18 55 0
19 55 2
20 55 1
21 55 -1
22 55 0
23 55 1
24 55 0
25 55 1
26 55 1
27 55 0
28 55 -1
29 55 2
30 55 2
31 55 3
32 55 0
33 55 0
34 55 0
35 55 0
36 55 1
37 55 -1
38 55 1
39 55 0
40 55 -1
41 55 0
42 55 0
43 55 1
44 55 1
45 55 0
46 55 1
47 55 1
48 55 2
49 55 0
50 55 1
1 56 -1
2 56 0
3 56 0
4 56 0
5 56 0
6 56 -1
7 56 0
8 56 -2
9 56 0
10 56 0
11 56 0
12 56 0
13 56 0
14 56 0
15 56 2
16 56 0
17 56 0
18 56 0
19 56 0
20 56 0
21 56 1
22 56 0
23 56 1
24 56 -1
25 56 3
26 56 0
27 56 0
28 56 0
29 56 4
30 56 -1
31 56 1
32 56 0
33 56 0
34 56 0
35 56 1
36 56 0
37 56 1
38 56 1
39 56 0
40 56 1
41 56 1
42 56 -1
43 56 2
44 56 -1
45 56 0
46 56 0
47 56 1
48 56 -1
49 56 -1
50 56 -1
1 57 -1
2 57 0
3 57 -1
4 57 -1
5 57 0
6 57 0
7 57 -1
8 57 -3
9 57 0
10 57 0
11 57 -1
12 57 0
13 57 3
14 57 0
15 57 2
16 57 -8
17 57 0
18 57 0
19 57 0
20 57 0
21 57 0
22 57 -1
23 57 0
24 57 2
25 57 -5
26 57 2
27 57 -4
28 57 0
29 57 -3
30 57 0
31 57 0
32 57 0
33 57 0
34 57 -5
35 57 1
36 57 -4
37 57 1
38 57 1
39 57 2
40 57 0
41 57 0
42 57 -4
43 57 0
44 57 0
45 57 0
46 57 -1
47 57 -1
48 57 -1
49 57 0
50 57 -1
1 58 -1
2 58 0
3 58 0
4 58 0
5 58 0
6 58 0
7 58 0
8 58 -3
9 58 0
10 58 0
11 58 0
12 58 0
13 58 0
14 58 0
15 58 1
16 58 0
17 58 0
18 58 -1
19 58 0
20 58 0
21 58 0
22 58 0
23 58 0
24 58 0
25 58 3
26 58 0
27 58 0
28 58 0
29 58 3
30 58 0
31 58 1
32 58 0
33 58 0
34 58 0
35 58 2
36 58 -1
37 58 0
38 58 2
39 58 0
40 58 0
41 58 0
42 58 -1
43 58 1
44 58 0
45 58 0
46 58 0
47 58 1
48 58 0
49 58 0
50 58 0
1 59 0
2 59 0
3 59 0
4 59 0
5 59 0
6 59 0
7 59 0
8 59 0
9 59 0
10 59 0
11 59 0
12 59 1
13 59 1
14 59 0
15 59 0
16 59 0
17 59 0
18 59 0
19 59 1
20 59 0
21 59 0
22 59 0
23 59 0
24 59 0
25 59 2
26 59 0
27 59 0
28 59 0
29 59 3
30 59 0
31 59 1
32 59 0
33 59 0
34 59 0
35 59 -1
36 59 0
37 59 0
38 59 -1
39 59 1
40 59 0
41 59 0
42 59 0
43 59 0
44 59 -1
45 59 0
46 59 0
47 59 0
48 59 0
49 59 0
50 59 1
1 60 0
2 60 0
3 60 0
4 60 0
5 60 0
6 60 0
7 60 0
8 60 -1
9 60 0
10 60 0
11 60 2
12 60 0
13 60 0
14 60 0
15 60 0
16 60 -1
17 60 0
18 60 0
19 60 1
20 60 2
21 60 0
22 60 1
23 60 0
24 60 0
25 60 0
26 60 0
27 60 0
28 60 0
29 60 0
30 60 2
31 60 0
32 60 0
33 60 0
34 60 0
35 60 0
36 60 0
37 60 0
38 60 0
39 60 0
40 60 0
41 60 1
42 60 0
43 60 0
44 60 0
45 60 0
46 60 0
47 60 0
48 60 0
49 60 2
50 60 0
<meta charset="utf-8">
<style>
/* disable text selection */
svg *::selection {
background : transparent;
}
svg *::-moz-selection {
background:transparent;
}
svg *::-webkit-selection {
background:transparent;
}
rect.selection {
stroke : #333;
stroke-dasharray: 4px;
stroke-opacity : 0.5;
fill : transparent;
}
rect.cell-border {
stroke: #eee;
stroke-width:0.3px;
}
rect.cell-selected {
stroke: rgb(51,102,153);
stroke-width:0.5px;
}
rect.cell-hover {
stroke: #F00;
stroke-width:0.3px;
}
text.mono {
font-size: 9pt;
font-family: Consolas, courier;
fill: #aaa;
}
text.text-selected {
fill: #000;
}
text.text-highlight {
fill: #c00;
}
text.text-hover {
fill: #00C;
}
#tooltip {
position: absolute;
width: 200px;
height: auto;
padding: 10px;
background-color: white;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
pointer-events: none;
}
#tooltip.hidden {
display: none;
}
#tooltip p {
margin: 0;
font-family: sans-serif;
font-size: 12px;
line-height: 20px;
}
</style>
</head>
<div id="tooltip" class="hidden">
<p><span id="value"></p>
</div>
<script src="http://d3js.org/d3.v3.min.js"></script>
Order:
<select id="order">
<option value="hclust">by cluster</option>
<option value="probecontrast">by probe name and contrast name</option>
<option value="probe">by probe name</option>
<option value="contrast">by contrast name</option>
<option value="custom">by log2 ratio</option>
</select>
</select>
<div id="chart" style='overflow:auto; width:960px; height:480px;'></div>
<script type="text/javascript">
var margin = { top: 150, right: 10, bottom: 50, left: 100 },
cellSize=12;
col_number=60;
row_number=50;
width = cellSize*col_number, // - margin.left - margin.right,
height = cellSize*row_number , // - margin.top - margin.bottom,
//gridSize = Math.floor(width / 24),
legendElementWidth = cellSize*2.5,
colorBuckets = 21,
colors = ['#005824','#1A693B','#347B53','#4F8D6B','#699F83','#83B09B','#9EC2B3','#B8D4CB','#D2E6E3','#EDF8FB','#FFFFFF','#F1EEF6','#E6D3E1','#DBB9CD','#D19EB9','#C684A4','#BB6990','#B14F7C','#A63467','#9B1A53','#91003F'];
hcrow = [49,11,30,4,18,6,12,20,19,33,32,26,44,35,38,3,23,41,22,10,2,15,16,36,8,25,29,7,27,34,48,31,45,43,14,9,39,1,37,47,42,21,40,5,28,46,50,17,24,13], // change to gene name or probe id
hccol = [6,5,41,12,42,21,58,56,14,16,43,15,17,46,47,48,54,49,37,38,25,22,7,8,2,45,9,20,24,44,23,19,13,40,11,1,39,53,10,52,3,26,27,60,50,51,59,18,31,32,30,4,55,28,29,57,36,34,33,35], // change to gene name or probe id
rowLabel = ['1759080_s_at','1759302_s_at','1759502_s_at','1759540_s_at','1759781_s_at','1759828_s_at','1759829_s_at','1759906_s_at','1760088_s_at','1760164_s_at','1760453_s_at','1760516_s_at','1760594_s_at','1760894_s_at','1760951_s_at','1761030_s_at','1761128_at','1761145_s_at','1761160_s_at','1761189_s_at','1761222_s_at','1761245_s_at','1761277_s_at','1761434_s_at','1761553_s_at','1761620_s_at','1761873_s_at','1761884_s_at','1761944_s_at','1762105_s_at','1762118_s_at','1762151_s_at','1762388_s_at','1762401_s_at','1762633_s_at','1762701_s_at','1762787_s_at','1762819_s_at','1762880_s_at','1762945_s_at','1762983_s_at','1763132_s_at','1763138_s_at','1763146_s_at','1763198_s_at','1763383_at','1763410_s_at','1763426_s_at','1763490_s_at','1763491_s_at'], // change to gene name or probe id
colLabel = ['con1027','con1028','con1029','con103','con1030','con1031','con1032','con1033','con1034','con1035','con1036','con1037','con1038','con1039','con1040','con1041','con108','con109','con110','con111','con112','con125','con126','con127','con128','con129','con130','con131','con132','con133','con134','con135','con136','con137','con138','con139','con14','con15','con150','con151','con152','con153','con16','con17','con174','con184','con185','con186','con187','con188','con189','con191','con192','con193','con194','con199','con2','con200','con201','con21']; // change to contrast name
d3.tsv("data_heatmap.tsv",
function(d) {
return {
row: +d.row_idx,
col: +d.col_idx,
value: +d.log2ratio
};
},
function(error, data) {
var colorScale = d3.scale.quantile()
.domain([ -10 , 0, 10])
.range(colors);
var svg = d3.select("#chart").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")")
;
var rowSortOrder=false;
var colSortOrder=false;
var rowLabels = svg.append("g")
.selectAll(".rowLabelg")
.data(rowLabel)
.enter()
.append("text")
.text(function (d) { return d; })
.attr("x", 0)
.attr("y", function (d, i) { return hcrow.indexOf(i+1) * cellSize; })
.style("text-anchor", "end")
.attr("transform", "translate(-6," + cellSize / 1.5 + ")")
.attr("class", function (d,i) { return "rowLabel mono r"+i;} )
.on("mouseover", function(d) {d3.select(this).classed("text-hover",true);})
.on("mouseout" , function(d) {d3.select(this).classed("text-hover",false);})
.on("click", function(d,i) {rowSortOrder=!rowSortOrder; sortbylabel("r",i,rowSortOrder);d3.select("#order").property("selectedIndex", 4).node().focus();;})
;
var colLabels = svg.append("g")
.selectAll(".colLabelg")
.data(colLabel)
.enter()
.append("text")
.text(function (d) { return d; })
.attr("x", 0)
.attr("y", function (d, i) { return hccol.indexOf(i+1) * cellSize; })
.style("text-anchor", "left")
.attr("transform", "translate("+cellSize/2 + ",-6) rotate (-90)")
.attr("class", function (d,i) { return "colLabel mono c"+i;} )
.on("mouseover", function(d) {d3.select(this).classed("text-hover",true);})
.on("mouseout" , function(d) {d3.select(this).classed("text-hover",false);})
.on("click", function(d,i) {colSortOrder=!colSortOrder; sortbylabel("c",i,colSortOrder);d3.select("#order").property("selectedIndex", 4).node().focus();;})
;
var heatMap = svg.append("g").attr("class","g3")
.selectAll(".cellg")
.data(data,function(d){return d.row+":"+d.col;})
.enter()
.append("rect")
.attr("x", function(d) { return hccol.indexOf(d.col) * cellSize; })
.attr("y", function(d) { return hcrow.indexOf(d.row) * cellSize; })
.attr("class", function(d){return "cell cell-border cr"+(d.row-1)+" cc"+(d.col-1);})
.attr("width", cellSize)
.attr("height", cellSize)
.style("fill", function(d) { return colorScale(d.value); })
/* .on("click", function(d) {
var rowtext=d3.select(".r"+(d.row-1));
if(rowtext.classed("text-selected")==false){
rowtext.classed("text-selected",true);
}else{
rowtext.classed("text-selected",false);
}
})*/
.on("mouseover", function(d){
//highlight text
d3.select(this).classed("cell-hover",true);
d3.selectAll(".rowLabel").classed("text-highlight",function(r,ri){ return ri==(d.row-1);});
d3.selectAll(".colLabel").classed("text-highlight",function(c,ci){ return ci==(d.col-1);});
//Update the tooltip position and value
d3.select("#tooltip")
.style("left", (d3.event.pageX+10) + "px")
.style("top", (d3.event.pageY-10) + "px")
.select("#value")
.text("lables:"+rowLabel[d.row-1]+","+colLabel[d.col-1]+"\ndata:"+d.value+"\nrow-col-idx:"+d.col+","+d.row+"\ncell-xy "+this.x.baseVal.value+", "+this.y.baseVal.value);
//Show the tooltip
d3.select("#tooltip").classed("hidden", false);
})
.on("mouseout", function(){
d3.select(this).classed("cell-hover",false);
d3.selectAll(".rowLabel").classed("text-highlight",false);
d3.selectAll(".colLabel").classed("text-highlight",false);
d3.select("#tooltip").classed("hidden", true);
})
;
var legend = svg.selectAll(".legend")
.data([-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10])
.enter().append("g")
.attr("class", "legend");
legend.append("rect")
.attr("x", function(d, i) { return legendElementWidth * i; })
.attr("y", height+(cellSize*2))
.attr("width", legendElementWidth)
.attr("height", cellSize)
.style("fill", function(d, i) { return colors[i]; });
legend.append("text")
.attr("class", "mono")
.text(function(d) { return d; })
.attr("width", legendElementWidth)
.attr("x", function(d, i) { return legendElementWidth * i; })
.attr("y", height + (cellSize*4));
// Change ordering of cells
function sortbylabel(rORc,i,sortOrder){
var t = svg.transition().duration(3000);
var log2r=[];
var sorted; // sorted is zero-based index
d3.selectAll(".c"+rORc+i)
.filter(function(ce){
log2r.push(ce.value);
})
;
if(rORc=="r"){ // sort log2ratio of a gene
sorted=d3.range(col_number).sort(function(a,b){ if(sortOrder){ return log2r[b]-log2r[a];}else{ return log2r[a]-log2r[b];}});
t.selectAll(".cell")
.attr("x", function(d) { return sorted.indexOf(d.col-1) * cellSize; })
;
t.selectAll(".colLabel")
.attr("y", function (d, i) { return sorted.indexOf(i) * cellSize; })
;
}else{ // sort log2ratio of a contrast
sorted=d3.range(row_number).sort(function(a,b){if(sortOrder){ return log2r[b]-log2r[a];}else{ return log2r[a]-log2r[b];}});
t.selectAll(".cell")
.attr("y", function(d) { return sorted.indexOf(d.row-1) * cellSize; })
;
t.selectAll(".rowLabel")
.attr("y", function (d, i) { return sorted.indexOf(i) * cellSize; })
;
}
}
d3.select("#order").on("change",function(){
order(this.value);
});
function order(value){
if(value=="hclust"){
var t = svg.transition().duration(3000);
t.selectAll(".cell")
.attr("x", function(d) { return hccol.indexOf(d.col) * cellSize; })
.attr("y", function(d) { return hcrow.indexOf(d.row) * cellSize; })
;
t.selectAll(".rowLabel")
.attr("y", function (d, i) { return hcrow.indexOf(i+1) * cellSize; })
;
t.selectAll(".colLabel")
.attr("y", function (d, i) { return hccol.indexOf(i+1) * cellSize; })
;
}else if (value=="probecontrast"){
var t = svg.transition().duration(3000);
t.selectAll(".cell")
.attr("x", function(d) { return (d.col - 1) * cellSize; })
.attr("y", function(d) { return (d.row - 1) * cellSize; })
;
t.selectAll(".rowLabel")
.attr("y", function (d, i) { return i * cellSize; })
;
t.selectAll(".colLabel")
.attr("y", function (d, i) { return i * cellSize; })
;
}else if (value=="probe"){
var t = svg.transition().duration(3000);
t.selectAll(".cell")
.attr("y", function(d) { return (d.row - 1) * cellSize; })
;
t.selectAll(".rowLabel")
.attr("y", function (d, i) { return i * cellSize; })
;
}else if (value=="contrast"){
var t = svg.transition().duration(3000);
t.selectAll(".cell")
.attr("x", function(d) { return (d.col - 1) * cellSize; })
;
t.selectAll(".colLabel")
.attr("y", function (d, i) { return i * cellSize; })
;
}
}
//
var sa=d3.select(".g3")
.on("mousedown", function() {
if( !d3.event.altKey) {
d3.selectAll(".cell-selected").classed("cell-selected",false);
d3.selectAll(".rowLabel").classed("text-selected",false);
d3.selectAll(".colLabel").classed("text-selected",false);
}
var p = d3.mouse(this);
sa.append("rect")
.attr({
rx : 0,
ry : 0,
class : "selection",
x : p[0],
y : p[1],
width : 1,
height : 1
})
})
.on("mousemove", function() {
var s = sa.select("rect.selection");
if(!s.empty()) {
var p = d3.mouse(this),
d = {
x : parseInt(s.attr("x"), 10),
y : parseInt(s.attr("y"), 10),
width : parseInt(s.attr("width"), 10),
height : parseInt(s.attr("height"), 10)
},
move = {
x : p[0] - d.x,
y : p[1] - d.y
}
;
if(move.x < 1 || (move.x*2<d.width)) {
d.x = p[0];
d.width -= move.x;
} else {
d.width = move.x;
}
if(move.y < 1 || (move.y*2<d.height)) {
d.y = p[1];
d.height -= move.y;
} else {
d.height = move.y;
}
s.attr(d);
// deselect all temporary selected state objects
d3.selectAll('.cell-selection.cell-selected').classed("cell-selected", false);
d3.selectAll(".text-selection.text-selected").classed("text-selected",false);
d3.selectAll('.cell').filter(function(cell_d, i) {
if(
!d3.select(this).classed("cell-selected") &&
// inner circle inside selection frame
(this.x.baseVal.value)+cellSize >= d.x && (this.x.baseVal.value)<=d.x+d.width &&
(this.y.baseVal.value)+cellSize >= d.y && (this.y.baseVal.value)<=d.y+d.height
) {
d3.select(this)
.classed("cell-selection", true)
.classed("cell-selected", true);
d3.select(".r"+(cell_d.row-1))
.classed("text-selection",true)
.classed("text-selected",true);
d3.select(".c"+(cell_d.col-1))
.classed("text-selection",true)
.classed("text-selected",true);
}
});
}
})
.on("mouseup", function() {
// remove selection frame
sa.selectAll("rect.selection").remove();
// remove temporary selection marker class
d3.selectAll('.cell-selection').classed("cell-selection", false);
d3.selectAll(".text-selection").classed("text-selection",false);
})
.on("mouseout", function() {
if(d3.event.relatedTarget.tagName=='html') {
// remove selection frame
sa.selectAll("rect.selection").remove();
// remove temporary selection marker class
d3.selectAll('.cell-selection').classed("cell-selection", false);
d3.selectAll(".rowLabel").classed("text-selected",false);
d3.selectAll(".colLabel").classed("text-selected",false);
}
})
;
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment