Browse code

oncoPrint() draws legends the same as alter_fun

Zuguang Gu authored on 23/10/2020 07:29:40
Showing15 changed files

... ...
@@ -8,6 +8,7 @@ CHANGES in VERSION 2.5.6
8 8
   can set `at` that are not all in the matrix but are in the `col`.
9 9
 * padding of the whole plot and spaces of column titles are adjusted to fit ggplot2 
10 10
 * add `row_gap` and `column_gap` in `Legend()`.
11
+* `oncoPrint()`: now draw legends as `alter_fun`.
11 12
 
12 13
 ======================
13 14
 
... ...
@@ -1,31 +1,31 @@
1
-setGeneric('add_heatmap', function(object, ...) standardGeneric('add_heatmap'))
2 1
 setGeneric('row_order', function(object, ...) standardGeneric('row_order'))
3
-setGeneric('prepare', function(object, ...) standardGeneric('prepare'))
4
-setGeneric('draw_annotation_legend', function(object, ...) standardGeneric('draw_annotation_legend'))
5
-setGeneric('make_row_cluster', function(object, ...) standardGeneric('make_row_cluster'))
6
-setGeneric('draw_dend', function(object, ...) standardGeneric('draw_dend'))
7
-setGeneric('get_color_mapping_list', function(object, ...) standardGeneric('get_color_mapping_list'))
2
+setGeneric('get_legend_param_list', function(object, ...) standardGeneric('get_legend_param_list'))
8 3
 setGeneric('color_mapping_legend', function(object, ...) standardGeneric('color_mapping_legend'))
9
-setGeneric('row_dend', function(object, ...) standardGeneric('row_dend'))
10
-setGeneric('make_column_cluster', function(object, ...) standardGeneric('make_column_cluster'))
11
-setGeneric('map_to_colors', function(object, ...) standardGeneric('map_to_colors'))
12
-setGeneric('column_dend', function(object, ...) standardGeneric('column_dend'))
13
-setGeneric('copy_all', function(object, ...) standardGeneric('copy_all'))
14
-setGeneric('draw_dimnames', function(object, ...) standardGeneric('draw_dimnames'))
15
-setGeneric('adjust_heatmap_list', function(object, ...) standardGeneric('adjust_heatmap_list'))
4
+setGeneric('draw_dend', function(object, ...) standardGeneric('draw_dend'))
5
+setGeneric('heatmap_legend_size', function(object, ...) standardGeneric('heatmap_legend_size'))
6
+setGeneric('prepare', function(object, ...) standardGeneric('prepare'))
16 7
 setGeneric('draw_heatmap_list', function(object, ...) standardGeneric('draw_heatmap_list'))
17
-setGeneric('draw', function(object, ...) standardGeneric('draw'))
18
-setGeneric('draw_title', function(object, ...) standardGeneric('draw_title'))
19
-setGeneric('component_height', function(object, ...) standardGeneric('component_height'))
20
-setGeneric('get_legend_param_list', function(object, ...) standardGeneric('get_legend_param_list'))
21
-setGeneric('column_order', function(object, ...) standardGeneric('column_order'))
22
-setGeneric('re_size', function(object, ...) standardGeneric('re_size'))
23 8
 setGeneric('set_component_height', function(object, ...) standardGeneric('set_component_height'))
24
-setGeneric('component_width', function(object, ...) standardGeneric('component_width'))
9
+setGeneric('copy_all', function(object, ...) standardGeneric('copy_all'))
10
+setGeneric('column_order', function(object, ...) standardGeneric('column_order'))
25 11
 setGeneric('make_layout', function(object, ...) standardGeneric('make_layout'))
12
+setGeneric('re_size', function(object, ...) standardGeneric('re_size'))
13
+setGeneric('add_heatmap', function(object, ...) standardGeneric('add_heatmap'))
26 14
 setGeneric('draw_heatmap_legend', function(object, ...) standardGeneric('draw_heatmap_legend'))
15
+setGeneric('make_column_cluster', function(object, ...) standardGeneric('make_column_cluster'))
16
+setGeneric('column_dend', function(object, ...) standardGeneric('column_dend'))
17
+setGeneric('get_color_mapping_list', function(object, ...) standardGeneric('get_color_mapping_list'))
18
+setGeneric('draw_annotation_legend', function(object, ...) standardGeneric('draw_annotation_legend'))
19
+setGeneric('row_dend', function(object, ...) standardGeneric('row_dend'))
20
+setGeneric('component_width', function(object, ...) standardGeneric('component_width'))
21
+setGeneric('set_component_width', function(object, ...) standardGeneric('set_component_width'))
27 22
 setGeneric('draw_heatmap_body', function(object, ...) standardGeneric('draw_heatmap_body'))
28
-setGeneric('draw_annotation', function(object, ...) standardGeneric('draw_annotation'))
29
-setGeneric('heatmap_legend_size', function(object, ...) standardGeneric('heatmap_legend_size'))
23
+setGeneric('draw_title', function(object, ...) standardGeneric('draw_title'))
24
+setGeneric('map_to_colors', function(object, ...) standardGeneric('map_to_colors'))
25
+setGeneric('component_height', function(object, ...) standardGeneric('component_height'))
26
+setGeneric('draw_dimnames', function(object, ...) standardGeneric('draw_dimnames'))
30 27
 setGeneric('annotation_legend_size', function(object, ...) standardGeneric('annotation_legend_size'))
31
-setGeneric('set_component_width', function(object, ...) standardGeneric('set_component_width'))
28
+setGeneric('draw_annotation', function(object, ...) standardGeneric('draw_annotation'))
29
+setGeneric('draw', function(object, ...) standardGeneric('draw'))
30
+setGeneric('adjust_heatmap_list', function(object, ...) standardGeneric('adjust_heatmap_list'))
31
+setGeneric('make_row_cluster', function(object, ...) standardGeneric('make_row_cluster'))
... ...
@@ -2805,6 +2805,9 @@ anno_mark = function(at, labels, which = c("column", "row"),
2805 2805
 	}
2806 2806
 	
2807 2807
 	n = length(at)
2808
+	if(n < 1) {
2809
+		stop_wrap("Length of `at` should be positive.")
2810
+	}
2808 2811
 	link_gp = recycle_gp(link_gp, n)
2809 2812
 	labels_gp = recycle_gp(labels_gp, n)
2810 2813
 	labels2index = structure(seq_along(at), names = as.character(labels))
... ...
@@ -264,6 +264,7 @@ setMethod(f = "map_to_colors",
264 264
 # -legend_height Height of the legend body. It only works when ``color_bar`` is ``continuous`` and ``direction`` is ``vertical``. Pass to `Legend`.
265 265
 # -legend_width Width of the legend body. It only works when ``color_bar`` is ``continuous`` and ``direction`` is ``horizontal``. Pass to `Legend`.
266 266
 # -legend_direction When ``color_bar`` is ``continuous``, whether the legend is vertical or horizontal? Pass to `Legend`.
267
+# -graphics Internally used.
267 268
 # -param All the legend-related parameters can be specified as a single list.
268 269
 #
269 270
 # == details
... ...
@@ -299,6 +300,7 @@ setMethod(f = "color_mapping_legend",
299 300
 	legend_width = NULL,
300 301
 	legend_direction = c("vertical", "horizontal"),
301 302
 
303
+	graphics = NULL,
302 304
 	param = NULL) {
303 305
 
304 306
 	e = environment()
... ...
@@ -351,11 +353,11 @@ setMethod(f = "color_mapping_legend",
351 353
 		if(length(at) == 0) {
352 354
 			gf = Legend(at = "NA", labels = "NA", title = title, title_gp = title_gp, grid_height = grid_height,
353 355
 				grid_width = grid_width, border = border, labels_gp = labels_gp, direction = legend_direction, nrow = nrow, ncol = ncol,
354
-				legend_gp = gpar(fill = object@na_col), title_position = title_position, by_row = by_row)
356
+				legend_gp = gpar(fill = object@na_col), title_position = title_position, by_row = by_row, graphics = graphics)
355 357
 		} else {
356 358
 			gf = Legend(at = at, labels = labels, title = title, title_gp = title_gp, grid_height = grid_height,
357 359
 				grid_width = grid_width, border = border, labels_gp = labels_gp, direction = legend_direction, nrow = nrow, ncol = ncol,
358
-				legend_gp = gpar(fill = map_to_colors(object, at)), title_position = title_position, by_row = by_row)
360
+				legend_gp = gpar(fill = map_to_colors(object, at)), title_position = title_position, by_row = by_row, graphics = graphics)
359 361
 		}
360 362
 
361 363
 	} else {
... ...
@@ -65,6 +65,9 @@ Legends = function(...) {
65 65
 # -border Color of legend grid borders. It also works for the ticks in the continuous legend.
66 66
 # -background Background colors for the grids. It is used when points and lines are the legend graphics.
67 67
 # -type Type of legends. The value can be one of ``grid``, ``points``, ``lines`` and ``boxplot``.
68
+# -graphics Self-defined graphics for legends. The value should be a list of functions.
69
+#           Each function should accept four argumets: ``x`` and ``y``: positions of the legend grid (center point), ``w`` and ``h``: width and height
70
+#           of the legend grid.
68 71
 # -legend_gp Graphic parameters for the legend grids. You should control the filled color of the legend grids by ``gpar(fill = ...)``.
69 72
 # -pch Type of points if points are used as legend. Note you can use single-letter as pch, e.g. ``pch = 'A'``.
70 73
 #      There are three additional integers that are valid for ``pch``: 26 and 27 for single diagonal lines and 28 for double diagonal lines.
... ...
@@ -109,7 +112,7 @@ Legend = function(at, labels = at, col_fun, nrow = NULL, ncol = 1, by_row = FALS
109 112
 	gap = unit(2, "mm"), column_gap = gap, row_gap = unit(0, "mm"),
110 113
 	labels_gp = gpar(fontsize = 10), labels_rot = 0,
111 114
 	border = NULL, background = "#EEEEEE",
112
-	type = "grid", legend_gp = gpar(),
115
+	type = "grid", graphics = NULL, legend_gp = gpar(),
113 116
 	pch = 16, size = unit(2, "mm"),
114 117
 	legend_height = NULL, legend_width = NULL,
115 118
 	direction = c("vertical", "horizontal"),
... ...
@@ -139,7 +142,7 @@ Legend = function(at, labels = at, col_fun, nrow = NULL, ncol = 1, by_row = FALS
139 142
 		if(is.null(border)) border = "white"
140 143
 		legend_body = discrete_legend_body(at = at, labels = labels, nrow = nrow, ncol = ncol,
141 144
 			grid_height = grid_height, grid_width = grid_width, gap = gap, row_gap = row_gap, column_gap = column_gap, labels_gp = labels_gp,
142
-			border = border, background = background, type = type, legend_gp = legend_gp,
145
+			border = border, background = background, type = type, graphics = graphics, legend_gp = legend_gp,
143 146
 			pch = pch, size = size, by_row = by_row)
144 147
 	} else {
145 148
 		if(!missing(col_fun) && missing(at)) {
... ...
@@ -336,7 +339,7 @@ discrete_legend_body = function(at, labels = at, nrow = NULL, ncol = 1, by_row =
336 339
 	gap = unit(2, "mm"), column_gap = gap, row_gap = unit(0, "mm"),
337 340
 	labels_gp = gpar(fontsize = 10),
338 341
 	border = "white", background = "#EEEEEE",
339
-	type = "grid", legend_gp = gpar(),
342
+	type = "grid", graphics = NULL, legend_gp = gpar(),
340 343
 	pch = 16, size = unit(2, "mm")) {
341 344
 
342 345
 	n_labels = length(labels)
... ...
@@ -353,6 +356,16 @@ discrete_legend_body = function(at, labels = at, nrow = NULL, ncol = 1, by_row =
353 356
 	if(length(grid_height) == 1) grid_height = rep(grid_height, nrow)
354 357
 	if(length(grid_width) == 1) grid_width = rep(grid_width, ncol)
355 358
 
359
+	if(!is.null(graphics)) {
360
+		if(length(graphics) != n_labels) {
361
+			stop_wrap("Length of `graphics` should be the same as number of labels.")
362
+		}
363
+		if(!all(sapply(graphics, is.function))) {
364
+			stop_wrap("`graphics` should be a list of functions.")
365
+		}
366
+	}
367
+	if(length(graphics) == 0) graphics = NULL
368
+
356 369
 	labels_mat = matrix(c(labels, rep(NA, nrow*ncol - n_labels)), nrow = nrow, ncol = ncol, byrow = by_row)
357 370
 	index_mat = matrix(1:(nrow*ncol), nrow = nrow, ncol = ncol, byrow = by_row)
358 371
 
... ...
@@ -442,6 +455,8 @@ discrete_legend_body = function(at, labels = at, nrow = NULL, ncol = 1, by_row =
442 455
 			textGrob(labels[index], x = labels_x, y = labels_y, just = "left", gp = labels_gp)
443 456
 		))
444 457
 
458
+
459
+		######### graphics ############
445 460
 		# grid
446 461
 		sgd = subset_gp(legend_gp, index)
447 462
 		sgd2 = gpar()
... ...
@@ -459,43 +474,53 @@ discrete_legend_body = function(at, labels = at, nrow = NULL, ncol = 1, by_row =
459 474
 		grid_x = rep(grid_x, length(grid_y))
460 475
 		grid_y = convertHeight(grid_y, "mm")
461 476
 
462
-		gl = c(gl, list(
463
-			rectGrob(x = grid_x, y = grid_y, width = grid_width[i], height = row_height_no_gap, gp = sgd2, just = "left")
464
-		))
477
+		if(is.null(graphics)) {
465 478
 
466
-		if(any(c("points", "p") %in% type)) {
467
-			if(length(pch) == 1) pch = rep(pch, n_labels)
468
-			if(length(size) == 1) size = rep(size, n_labels)
479
+			gl = c(gl, list(
480
+				rectGrob(x = grid_x, y = grid_y, width = grid_width[i], height = row_height_no_gap, gp = sgd2, just = "left")
481
+			))
469 482
 
470
-			if(is.character(pch)) {
483
+			if(any(c("points", "p") %in% type)) {
484
+				if(length(pch) == 1) pch = rep(pch, n_labels)
485
+				if(length(size) == 1) size = rep(size, n_labels)
486
+
487
+				if(is.character(pch)) {
488
+					gl = c(gl, list(
489
+						textGrob(pch[index], x = grid_x, y = grid_y, gp = subset_gp(legend_gp, index))
490
+					))
491
+				} else {
492
+					gl = c(gl, 
493
+						.pointsGrob_as_a_list(x = grid_x, y = grid_y, pch = pch[index], 
494
+							gp = subset_gp(legend_gp, index), size = size, width = grid_width[i], height = row_height_no_gap)
495
+					)
496
+				}
497
+			}
498
+			if(any(c("lines", "l") %in% type)) {
471 499
 				gl = c(gl, list(
472
-					textGrob(pch[index], x = grid_x, y = grid_y, gp = subset_gp(legend_gp, index))
500
+					segmentsGrob(x0 = grid_x - grid_width[i]*0.5, y0 = grid_y, 
501
+						         x1 = grid_x + grid_width[i]*0.5, y1 = grid_y,
502
+						         gp = subset_gp(legend_gp, index))
473 503
 				))
474
-			} else {
475
-				gl = c(gl, 
476
-					.pointsGrob_as_a_list(x = grid_x, y = grid_y, pch = pch[index], 
477
-						gp = subset_gp(legend_gp, index), size = size, width = grid_width[i], height = row_height_no_gap)
478
-				)
479 504
 			}
480
-		}
481
-		if(any(c("lines", "l") %in% type)) {
482
-			gl = c(gl, list(
483
-				segmentsGrob(x0 = grid_x - grid_width[i]*0.5, y0 = grid_y, 
484
-					         x1 = grid_x + grid_width[i]*0.5, y1 = grid_y,
485
-					         gp = subset_gp(legend_gp, index))
486
-			))
487
-		}
488
-		if(any(c("boxplot", "box") %in% type)) {
489
-			gl = c(gl, list(
490
-				segmentsGrob(x0 = grid_x, y0 = grid_y - row_height_no_gap*0.45, 
491
-					         x1 = grid_x, y1 = grid_y + row_height_no_gap*0.45,
492
-					         gp = subset_gp(legend_gp, index)),
493
-				rectGrob(x = grid_x, y = grid_y, width = grid_width[i]*0.9, height = row_height_no_gap*0.5,
494
-					     gp = subset_gp(legend_gp, index)),
495
-				segmentsGrob(x0 = grid_x - grid_width[i]*0.45, y0 = grid_y, 
496
-					         x1 = grid_x + grid_width[i]*0.45, y1 = grid_y,
497
-					         gp = subset_gp(legend_gp, index))
498
-			))
505
+			if(any(c("boxplot", "box") %in% type)) {
506
+				gl = c(gl, list(
507
+					segmentsGrob(x0 = grid_x, y0 = grid_y - row_height_no_gap*0.45, 
508
+						         x1 = grid_x, y1 = grid_y + row_height_no_gap*0.45,
509
+						         gp = subset_gp(legend_gp, index)),
510
+					rectGrob(x = grid_x, y = grid_y, width = grid_width[i]*0.9, height = row_height_no_gap*0.5,
511
+						     gp = subset_gp(legend_gp, index)),
512
+					segmentsGrob(x0 = grid_x - grid_width[i]*0.45, y0 = grid_y, 
513
+						         x1 = grid_x + grid_width[i]*0.45, y1 = grid_y,
514
+						         gp = subset_gp(legend_gp, index))
515
+				))
516
+			}
517
+		} else {
518
+			fl = graphics[index]
519
+			gb_lt = list()
520
+			for(k in seq_along(fl)) {
521
+				gb_lt[[k]] = grid.grabExpr(fl[[k]](x = grid_x[1] + grid_width[i]*0.5, y = grid_y[k], w = grid_width[i], h = row_height_no_gap[k]), width = grid_width[i], height = row_height_no_gap[k])
522
+			}
523
+			gl = c(gl, gb_lt)
499 524
 		}
500 525
 
501 526
 		previous_x = previous_x + grid_width[i] + labels_max_width[i] + labels_padding_left + column_gap
... ...
@@ -87,7 +87,7 @@ oncoPrint = function(mat,
87 87
 	remove_empty_columns = FALSE,
88 88
 	remove_empty_rows = FALSE,
89 89
 	show_column_names = FALSE,
90
-	heatmap_legend_param = list(title = "Alterations"),
90
+	heatmap_legend_param = NULL,
91 91
 	...) {
92 92
 
93 93
 	dev.null()
... ...
@@ -169,7 +169,7 @@ oncoPrint = function(mat,
169 169
 		stop_wrap("Incorrect type of 'mat'")
170 170
 	}
171 171
 
172
-	message_wrap(paste0("All mutation types: ", paste(all_type, collapse = ", ")))
172
+	message_wrap(paste0("All mutation types: ", paste(all_type, collapse = ", "), "."))
173 173
 
174 174
 	# type as the third dimension
175 175
 	arr = array(FALSE, dim = c(dim(mat_list[[1]]), length(all_type)), dimnames = c(dimnames(mat_list[[1]]), list(all_type)))
... ...
@@ -347,7 +347,7 @@ oncoPrint = function(mat,
347 347
 	# validate col
348 348
 	sdf = setdiff(all_type, names(col))
349 349
 	if(length(sdf) > 0) {
350
-		message_wrap(paste0("Colors are not defined for: ", paste(sdf, collapse = ", ")))
350
+		message_wrap(paste0("Colors are not defined for: ", paste(sdf, collapse = ", "), ". They won't be shown in the barplots."))
351 351
 	}
352 352
 
353 353
 	# for each gene, percent of samples that have alterations
... ...
@@ -468,6 +468,69 @@ oncoPrint = function(mat,
468 468
 		}
469 469
 	}
470 470
 
471
+	if(is.list(alter_fun)) {
472
+		if(is.null(alter_fun$background)) {
473
+			background_fun = function(x, y, w, h) NULL
474
+		} else {
475
+			background_fun = alter_fun$background
476
+		}
477
+
478
+		alter_fun2 = alter_fun[names(alter_fun) != "background"]
479
+		alter_fun3 = alter_fun2
480
+		for(i in seq_along(alter_fun2)) {
481
+			alter_fun3[[i]] = local({
482
+				i = i
483
+				function(x, y, w, h) {
484
+					background_fun(x, y, w, h)
485
+					alter_fun2[[i]](x, y, w, h)
486
+				}
487
+			})
488
+		}
489
+	} else {
490
+		all_type_binary = structure(rep(FALSE, length(all_type)), names = all_type)
491
+		background_fun = function(x, y, w, h) {
492
+			alter_fun(x, y, w, h, all_type_binary)
493
+		}
494
+		alter_fun3 = list()
495
+		for(nm in all_type) {
496
+			alter_fun3[[nm]] = local({
497
+				all_type_binary2 = all_type_binary
498
+				all_type_binary2[nm] = TRUE
499
+				function(x, y, w, h) {
500
+					alter_fun(x, y, w, h, all_type_binary2)
501
+				}
502
+			})
503
+		}
504
+	}
505
+
506
+	if(is.null(heatmap_legend_param)) {
507
+		heatmap_legend_param = list(
508
+			title = "Alterations",
509
+			at = names(alter_fun3),
510
+			graphics = alter_fun3
511
+		)
512
+		col2 = structure(rep(NA, length(alter_fun3)), names = names(alter_fun3))
513
+		col2[names(col)] = col
514
+		col = col2
515
+	} else {
516
+		if(! "graphics" %in% names(heatmap_legend_param)) {
517
+			if(is.null(heatmap_legend_param$at)) heatmap_legend_param$at = names(alter_fun3)
518
+			if(is.null(heatmap_legend_param$labels)) heatmap_legend_param$labels = heatmap_legend_param$at
519
+
520
+			# adjust order of alter_fun3 with at
521
+			if(!is.null(heatmap_legend_param$at)) {
522
+				if(length(setdiff(heatmap_legend_param$at, names(alter_fun3))) == 0) {
523
+					alter_fun3 = alter_fun3[heatmap_legend_param$at]
524
+				}
525
+			}
526
+
527
+			heatmap_legend_param$graphics = alter_fun3
528
+			col2 = structure(rep(NA, length(alter_fun3)), names = names(alter_fun3))
529
+			col2[names(col)] = col
530
+			col = col2
531
+		}
532
+	}
533
+
471 534
 	ht = Heatmap(pheudo, col = col, 
472 535
 		rect_gp = gpar(type = "none"), 
473 536
 		cluster_rows = cluster_rows, cluster_columns = cluster_columns, 
... ...
@@ -722,6 +785,12 @@ anno_oncoprint_barplot = function(type = NULL, which = c("column", "row"),
722 785
 guess_alter_fun_is_vectorized = function(alter_fun) {
723 786
 	n = 50
724 787
 	if(is.list(alter_fun)) {
788
+
789
+		# check whether grid.polygon is called
790
+		if(any(sapply(alter_fun, function(f) any(grepl("grid\\.polygon\\(", as.character(body(f))))))) {
791
+			return(FALSE)
792
+		}
793
+
725 794
 		x = unit(1:n/n, "npc")
726 795
 		y = unit(1:n/n, "npc")
727 796
 		w = unit(1:n, "mm")
... ...
@@ -736,6 +805,7 @@ guess_alter_fun_is_vectorized = function(alter_fun) {
736 805
 		if(inherits(oe, "try-error")) {
737 806
 			return(FALSE)
738 807
 		} else {
808
+			message_wrap("`alter_fun` is assumed vectorizable. If it does not generate correct plot, please set `alter_fun_is_vectorized = FALSE` in `oncoPrint()`.")
739 809
 			return(TRUE)
740 810
 		}
741 811
 	} else {
... ...
@@ -13,7 +13,7 @@ Legend(at, labels = at, col_fun, nrow = NULL, ncol = 1, by_row = FALSE,
13 13
     gap = unit(2, "mm"), column_gap = gap, row_gap = unit(0, "mm"),
14 14
     labels_gp = gpar(fontsize = 10), labels_rot = 0,
15 15
     border = NULL, background = "#EEEEEE",
16
-    type = "grid", legend_gp = gpar(),
16
+    type = "grid", graphics = NULL, legend_gp = gpar(),
17 17
     pch = 16, size = unit(2, "mm"),
18 18
     legend_height = NULL, legend_width = NULL,
19 19
     direction = c("vertical", "horizontal"),
... ...
@@ -10,9 +10,9 @@ Method dispatch page for \code{add_heatmap}.
10 10
 \code{add_heatmap} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
-\item \code{\link{add_heatmap,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method
14 13
 \item \code{\link{add_heatmap,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
15 14
 \item \code{\link{add_heatmap,Heatmap-method}}, \code{\link{Heatmap-class}} class method
15
+\item \code{\link{add_heatmap,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method
16 16
 }
17 17
 }
18 18
 \examples{
... ...
@@ -10,8 +10,8 @@ Method dispatch page for \code{column_dend}.
10 10
 \code{column_dend} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
-\item \code{\link{column_dend,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
14 13
 \item \code{\link{column_dend,Heatmap-method}}, \code{\link{Heatmap-class}} class method
14
+\item \code{\link{column_dend,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
15 15
 }
16 16
 }
17 17
 \examples{
... ...
@@ -10,8 +10,8 @@ Method dispatch page for \code{column_order}.
10 10
 \code{column_order} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
-\item \code{\link{column_order,Heatmap-method}}, \code{\link{Heatmap-class}} class method
14 13
 \item \code{\link{column_order,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
14
+\item \code{\link{column_order,Heatmap-method}}, \code{\link{Heatmap-class}} class method
15 15
 }
16 16
 }
17 17
 \examples{
... ...
@@ -10,8 +10,8 @@ Method dispatch page for \code{component_width}.
10 10
 \code{component_width} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
-\item \code{\link{component_width,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
14 13
 \item \code{\link{component_width,Heatmap-method}}, \code{\link{Heatmap-class}} class method
14
+\item \code{\link{component_width,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
15 15
 }
16 16
 }
17 17
 \examples{
... ...
@@ -10,12 +10,12 @@ Method dispatch page for \code{draw}.
10 10
 \code{draw} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
+\item \code{\link{draw,AnnotationFunction-method}}, \code{\link{AnnotationFunction-class}} class method
14
+\item \code{\link{draw,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method
13 15
 \item \code{\link{draw,Heatmap-method}}, \code{\link{Heatmap-class}} class method
14
-\item \code{\link{draw,Legends-method}}, \code{\link{Legends-class}} class method
15 16
 \item \code{\link{draw,SingleAnnotation-method}}, \code{\link{SingleAnnotation-class}} class method
16
-\item \code{\link{draw,AnnotationFunction-method}}, \code{\link{AnnotationFunction-class}} class method
17 17
 \item \code{\link{draw,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
18
-\item \code{\link{draw,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method
18
+\item \code{\link{draw,Legends-method}}, \code{\link{Legends-class}} class method
19 19
 }
20 20
 }
21 21
 \examples{
... ...
@@ -10,8 +10,8 @@ Method dispatch page for \code{draw_title}.
10 10
 \code{draw_title} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
-\item \code{\link{draw_title,Heatmap-method}}, \code{\link{Heatmap-class}} class method
14 13
 \item \code{\link{draw_title,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
14
+\item \code{\link{draw_title,Heatmap-method}}, \code{\link{Heatmap-class}} class method
15 15
 }
16 16
 }
17 17
 \examples{
... ...
@@ -10,8 +10,8 @@ Method dispatch page for \code{make_layout}.
10 10
 \code{make_layout} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
-\item \code{\link{make_layout,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
14 13
 \item \code{\link{make_layout,Heatmap-method}}, \code{\link{Heatmap-class}} class method
14
+\item \code{\link{make_layout,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
15 15
 }
16 16
 }
17 17
 \examples{
... ...
@@ -10,12 +10,12 @@ Method dispatch page for \code{show}.
10 10
 \code{show} can be dispatched on following classes:
11 11
 
12 12
 \itemize{
13
+\item \code{\link{show,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method
13 14
 \item \code{\link{show,AnnotationFunction-method}}, \code{\link{AnnotationFunction-class}} class method
14
-\item \code{\link{show,ColorMapping-method}}, \code{\link{ColorMapping-class}} class method
15
+\item \code{\link{show,SingleAnnotation-method}}, \code{\link{SingleAnnotation-class}} class method
15 16
 \item \code{\link{show,HeatmapList-method}}, \code{\link{HeatmapList-class}} class method
16
-\item \code{\link{show,HeatmapAnnotation-method}}, \code{\link{HeatmapAnnotation-class}} class method
17 17
 \item \code{\link{show,Heatmap-method}}, \code{\link{Heatmap-class}} class method
18
-\item \code{\link{show,SingleAnnotation-method}}, \code{\link{SingleAnnotation-class}} class method
18
+\item \code{\link{show,ColorMapping-method}}, \code{\link{ColorMapping-class}} class method
19 19
 }
20 20
 }
21 21
 \examples{