Browse code

fix some bugs

Zuguang Gu authored on 19/10/2018 19:08:59
Showing135 changed files

... ...
@@ -106,6 +106,7 @@ export("Legends")
106 106
 export("SingleAnnotation")
107 107
 export("adjust_dend_by_x")
108 108
 export("anno_barplot")
109
+export("anno_block")
109 110
 export("anno_boxplot")
110 111
 export("anno_density")
111 112
 export("anno_empty")
... ...
@@ -215,7 +215,8 @@ anno_simple = function(x, col, na_col = "grey",
215 215
                 if(!is.null(pch)) {
216 216
 					l = !is.na(pch[, i])
217 217
 					grid.points(x = rep((i-0.5)/nc, sum(l)), y = y[l], pch = pch[l, i], 
218
-						size = pt_size[i], gp = subset_gp(pt_gp, i))
218
+						size = {if(length(pt_size) == 1) pt_size else pt_size[i]}, 
219
+						gp = subset_gp(pt_gp, i))
219 220
 				}
220 221
             }
221 222
         } else {
... ...
@@ -246,7 +247,8 @@ anno_simple = function(x, col, na_col = "grey",
246 247
                 	pch = pch[index, , drop = FALSE]
247 248
 					l = !is.na(pch[, i])
248 249
 					grid.points(x[l], y = rep((nc-i +0.5)/nc, sum(l)), pch = pch[l, i], 
249
-						size = pt_size[i], gp = subset_gp(pt_gp, i))
250
+						size = {if(length(pt_size) == 1) pt_size else pt_size[i]}, 
251
+						gp = subset_gp(pt_gp, i))
250 252
 				}
251 253
             }
252 254
         } else {
... ...
@@ -375,7 +375,7 @@ setMethod(f = "make_layout",
375 375
     layout_size = object@layout$layout_size
376 376
     if(is_abs_unit(object@heatmap_param$width)) {
377 377
         # recalcualte the width of heatmap body
378
-        object@matrix_param$width = object@heatmap_param$width -
378
+        object@matrix_param$width = convertWidth(object@heatmap_param$width -
379 379
             sum(layout_size$row_title_left_width,
380 380
                 layout_size$row_dend_left_width,
381 381
                 layout_size$row_anno_left_width,
... ...
@@ -383,9 +383,12 @@ setMethod(f = "make_layout",
383 383
                 layout_size$row_dend_right_width,
384 384
                 layout_size$row_anno_right_width,
385 385
                 layout_size$row_names_right_width,
386
-                layout_size$row_title_right_width)   
386
+                layout_size$row_title_right_width), "mm")
387
+        if(object@matrix_param$width[[1]] <= 0) {
388
+            stop_wrap("width of the heatmap body is negative, maybe `heatmap_width` you set is too small. Note `heatmap_width` is the width of the complete heatmap.")
389
+        }
387 390
     } else if(is_abs_unit(object@matrix_param$width)) {  # e.g. unit(1, "npc")
388
-        object@heatmap_param$width = sum(
391
+        object@heatmap_param$width = convertWidth(sum(
389 392
             layout_size$row_title_left_width,
390 393
             layout_size$row_dend_left_width,
391 394
             layout_size$row_names_left_width,
... ...
@@ -394,7 +397,7 @@ setMethod(f = "make_layout",
394 397
             layout_size$row_title_right_width,
395 398
             layout_size$row_anno_left_width,
396 399
             layout_size$row_anno_right_width
397
-        ) + object@matrix_param$width
400
+        ) + object@matrix_param$width, "mm")
398 401
         if(nc_slice > 1) {
399 402
             object@heatmap_param$width = object@heatmap_param$width + sum(column_gap[seq_len(nc_slice-1)])
400 403
         }
... ...
@@ -403,7 +406,7 @@ setMethod(f = "make_layout",
403 406
     }
404 407
 
405 408
     if(is_abs_unit(object@heatmap_param$height)) {
406
-        object@matrix_param$height = object@heatmap_param$height - 
409
+        object@matrix_param$height = convertHeight(object@heatmap_param$height - 
407 410
             sum(layout_size$column_title_top_height,
408 411
                 layout_size$column_dend_top_height,
409 412
                 layout_size$column_anno_top_height,
... ...
@@ -411,9 +414,12 @@ setMethod(f = "make_layout",
411 414
                 layout_size$column_title_bottom_height,
412 415
                 layout_size$column_dend_bottom_height,
413 416
                 layout_size$column_anno_bottom_height,
414
-                layout_size$column_names_bottom_height)
417
+                layout_size$column_names_bottom_height), "mm")
418
+        if(object@matrix_param$height[[1]] <= 0) {
419
+            stop_wrap("height of the heatmap body is negative, maybe `heatmap_height` you set is too small. Note `heatmap_height` is the height of the complete heatmap.")
420
+        }
415 421
     } else if(is_abs_unit(object@matrix_param$height)) {
416
-        object@heatmap_param$height = sum(
422
+        object@heatmap_param$height = convertHeight(sum(
417 423
             layout_size$column_title_top_height,
418 424
             layout_size$column_dend_top_height,
419 425
             layout_size$column_anno_top_height,
... ...
@@ -422,7 +428,7 @@ setMethod(f = "make_layout",
422 428
             layout_size$column_dend_bottom_height,
423 429
             layout_size$column_anno_bottom_height,
424 430
             layout_size$column_names_bottom_height
425
-        ) + object@matrix_param$height
431
+        ) + object@matrix_param$height, "mm")
426 432
         if(nr_slice > 1) {
427 433
             object@heatmap_param$height = object@heatmap_param$height + sum(row_gap[seq_len(nr_slice-1)])
428 434
         }
... ...
@@ -107,6 +107,9 @@ HeatmapAnnotation = function(...,
107 107
 	simple_anno_size_adjust = FALSE
108 108
 	) {
109 109
 
110
+	dev.null()
111
+	on.exit(dev.off2())
112
+
110 113
 	.ENV$current_annotation_which = NULL
111 114
 	which = match.arg(which)[1]
112 115
 	.ENV$current_annotation_which = which
... ...
@@ -271,7 +274,7 @@ HeatmapAnnotation = function(...,
271 274
     len = len[len > 0]
272 275
     if(length(len)) {
273 276
 	    if(length(unique(len)) > 1) {
274
-	    	stop_wrap("Length of annotations differs.")
277
+	    	stop_wrap(paste0("Length of annotations differs. ", paste(qq("@{names(len)}: @{len}", collapse = FALSE), collapse = ", ")))
275 278
 	    }
276 279
 	}
277 280
 
... ...
@@ -361,9 +361,9 @@ setMethod(f = "column_dend",
361 361
 
362 362
 
363 363
 
364
-proper_format_lt = function(lt) {
364
+proper_format_lt = function(lt) {	
365 365
 	n_ht = length(lt)
366
-	# for a single heatmap 
366
+	
367 367
 	if(n_ht == 1) {
368 368
 		if(length(lt[[1]]) == 1) {
369 369
 			return(lt[[1]][[1]])
... ...
@@ -371,7 +371,13 @@ proper_format_lt = function(lt) {
371 371
 			return(lt[[1]])
372 372
 		}
373 373
 	} else {
374
-		has_splitting = any(sapply(lt, function(x) length(x) != 1))
374
+		l_empty = sapply(lt, function(x) length(x) == 0)
375
+		lt = lt[!l_empty]
376
+		if(length(lt) == 0) {
377
+			return(NULL)
378
+		}
379
+	
380
+		has_splitting = any(sapply(lt, function(x) length(x) > 1))
375 381
 		if(has_splitting) {
376 382
 			return(lt)
377 383
 		} else {
... ...
@@ -23,6 +23,8 @@
23 23
 # -column_names_gp Pass to `Heatmap`.
24 24
 # -column_names_rot Pass to `Heatmap`.
25 25
 # -cluster_columns Whether cluster columns (here clustered by density values)? Normally we don't cluster columns.
26
+# - clustering_distance_columns
27
+# -clustering_method_columns
26 28
 # -... pass to `Heatmap`.
27 29
 #
28 30
 # == details
... ...
@@ -97,7 +99,7 @@ densityHeatmap = function(data,
97 99
 
98 100
 	density_param$na.rm = TRUE
99 101
 
100
-	if(!is.matrix(data) && !is.data.frame(matrix) && !is.list(matrix)) {
102
+	if(!is.matrix(data) && !is.data.frame(data) && !is.list(data)) {
101 103
 		stop("only matrix and list are allowed.")
102 104
 	}
103 105
 	if(is.matrix(data)) {
... ...
@@ -185,5 +185,3 @@ ht_global_opt = ht_opt
185 185
 
186 186
 GLOBAL_PADDING = unit(c(2, 2, 2, 2), "mm")
187 187
 
188
-
189
-
... ...
@@ -104,6 +104,9 @@ Legend = function(at, labels = at, col_fun, nrow = NULL, ncol = 1, by_row = FALS
104 104
 	title = "", title_gp = gpar(fontsize = 10, fontface = "bold"),
105 105
 	title_position = c("topleft", "topcenter", "leftcenter", "lefttop", "leftcenter-rot", "lefttop-rot")) {
106 106
 
107
+	dev.null()
108
+	on.exit(dev.off2())
109
+
107 110
 	if(missing(at) && !missing(labels)) {
108 111
 		at = seq_along(labels)
109 112
 	}
... ...
@@ -758,6 +761,9 @@ packLegend = function(...,gap = unit(2, "mm"), row_gap = unit(2, "mm"), column_g
758 761
 	direction = c("vertical", "horizontal"),
759 762
 	max_width = NULL, max_height = NULL, list = NULL) {
760 763
 
764
+	dev.null()
765
+	on.exit(dev.off2())
766
+
761 767
 	if(!is.null(list)) {
762 768
 		legend_list = list
763 769
 	} else {
... ...
@@ -15,4 +15,5 @@ method so that above three classes can be appended to each other.
15 15
 \examples{
16 16
 # There is no example
17 17
 NULL
18
+
18 19
 }
... ...
@@ -26,4 +26,5 @@ Zuguang Gu <z.gu@dkfz.de>
26 26
 \examples{
27 27
 # There is no example
28 28
 NULL
29
+
29 30
 }
... ...
@@ -23,4 +23,5 @@ See \code{\link{AnnotationFunction}} constructor for details.
23 23
 \examples{
24 24
 # There is no example
25 25
 NULL
26
+
26 27
 }
... ...
@@ -121,4 +121,5 @@ ComplexHeatmap Complete Reference ().
121 121
 \examples{
122 122
 # There is no example
123 123
 NULL
124
+
124 125
 }
... ...
@@ -26,4 +26,5 @@ Zuguang Gu <z.gu@dkfz.de>
26 26
 \examples{
27 27
 # There is no example
28 28
 NULL
29
+
29 30
 }
... ...
@@ -36,4 +36,5 @@ You can refer to the ComplexHeatmap Complete Reference for all the information o
36 36
 \examples{
37 37
 # There is no example
38 38
 NULL
39
+
39 40
 }
... ...
@@ -23,4 +23,5 @@ If the heatmap list is horizontal, \code{i} is the real row indices and \code{j}
23 23
 \examples{
24 24
 # There is no example
25 25
 NULL
26
+
26 27
 }
... ...
@@ -30,4 +30,5 @@ Zuguang Gu <z.gu@dkfz.de>
30 30
 \examples{
31 31
 # There is no example
32 32
 NULL
33
+
33 34
 }
... ...
@@ -185,4 +185,5 @@ Zuguang Gu <z.gu@dkfz.de>
185 185
 \examples{
186 186
 # There is no example
187 187
 NULL
188
+
188 189
 }
... ...
@@ -25,4 +25,5 @@ Zuguang Gu <z.gu@dkfz.de>
25 25
 \examples{
26 26
 # There is no example
27 27
 NULL
28
+
28 29
 }
... ...
@@ -74,4 +74,5 @@ Zuguang Gu <z.gu@dkfz.de>
74 74
 \examples{
75 75
 # There is no example
76 76
 NULL
77
+
77 78
 }
... ...
@@ -27,4 +27,5 @@ Zuguang Gu <z.gu@dkfz.de>
27 27
 \examples{
28 28
 # There is no example
29 29
 NULL
30
+
30 31
 }
... ...
@@ -26,4 +26,5 @@ Zuguang Gu <z.gu@dkfz.de>
26 26
 \examples{
27 27
 # There is no example
28 28
 NULL
29
+
29 30
 }
... ...
@@ -26,4 +26,5 @@ Zuguang Gu <z.gu@dkfz.de>
26 26
 \examples{
27 27
 # There is no example
28 28
 NULL
29
+
29 30
 }
... ...
@@ -28,4 +28,5 @@ Zuguang Gu <z.gu@dkfz.de>
28 28
 \examples{
29 29
 # There is no example
30 30
 NULL
31
+
31 32
 }
... ...
@@ -40,4 +40,5 @@ Zuguang Gu <z.gu@dkfz.de>
40 40
 \examples{
41 41
 # There is no example
42 42
 NULL
43
+
43 44
 }
... ...
@@ -28,4 +28,5 @@ Zuguang Gu <z.gu@dkfz.de>
28 28
 \examples{
29 29
 # There is no example
30 30
 NULL
31
+
31 32
 }
... ...
@@ -28,4 +28,5 @@ Zuguang Gu <z.gu@dkfz.de>
28 28
 \examples{
29 29
 # There is no example
30 30
 NULL
31
+
31 32
 }
... ...
@@ -28,4 +28,5 @@ Zuguang Gu <z.gu@dkfz.de>
28 28
 \examples{
29 29
 # There is no example
30 30
 NULL
31
+
31 32
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{adjust_heatmap_list-HeatmapList-method}
2 2
 \alias{adjust_heatmap_list,HeatmapList-method}
3
+\alias{adjust_heatmap_list}
3 4
 \title{
4 5
 Adjust heatmap list
5 6
 }
... ...
@@ -22,8 +23,8 @@ This function is only for internal use.
22 23
 \author{
23 24
 Zuguang Gu <z.gu@dkfz.de>
24 25
 }
25
-\alias{adjust_heatmap_list}
26 26
 \examples{
27 27
 # There is no example
28 28
 NULL
29
+
29 30
 }
30 31
new file mode 100644
... ...
@@ -0,0 +1,28 @@
1
+\name{anno_block}
2
+\alias{anno_block}
3
+\title{
4
+Block annotation
5
+}
6
+\description{
7
+Block annotation
8
+}
9
+\usage{
10
+anno_block(gp = gpar(), labels = NULL, labels_gp = gpar(), labels_rot = ifelse(which == "row", 90, 0),
11
+    which = c("column", "row"), width = NULL, height = NULL)
12
+}
13
+\arguments{
14
+
15
+  \item{gp}{Graphic parameters}
16
+  \item{labels}{-labels}
17
+  \item{labels_gp}{-labels_gp}
18
+  \item{labels_rot}{-labels_rot}
19
+  \item{which}{-which}
20
+  \item{width}{-width}
21
+  \item{height}{-height}
22
+
23
+}
24
+\examples{
25
+# There is no example
26
+NULL
27
+
28
+}
... ...
@@ -22,7 +22,7 @@ anno_horizon(x, which = c("column", "row"),
22 22
   \item{n_slice}{Number of slices on y-axis.}
23 23
   \item{slice_size}{Height of the slice. If the value is not \code{NULL}, \code{n_slice} will be recalculated. }
24 24
   \item{negative_from_top}{Whether the areas for negative values start from the top or the bottom of the plotting region?}
25
-  \item{normalize}{Whether normalize \code{x} to let data range of each observation in (0, 1)?}
25
+  \item{normalize}{Whether normalize \code{x} by max(abs(x)).}
26 26
   \item{gap}{Gap size of neighbouring horizon chart.}
27 27
   \item{axis}{Whether to add axis?}
28 28
   \item{axis_param}{parameters for controlling axis. See \code{\link{default_axis_param}} for all possible settings and default parameters.}
... ...
@@ -20,4 +20,5 @@ anno_link(...)
20 20
 \examples{
21 21
 # There is no example
22 22
 NULL
23
+
23 24
 }
... ...
@@ -29,4 +29,5 @@ Zuguang Gu <z.gu@dkfz.de>
29 29
 \examples{
30 30
 # There is no example
31 31
 NULL
32
+
32 33
 }
... ...
@@ -26,4 +26,5 @@ A \code{\link[grid]{grob}} object.
26 26
 \examples{
27 27
 # There is no example
28 28
 NULL
29
+
29 30
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{annotation_legend_size-HeatmapList-method}
2 2
 \alias{annotation_legend_size,HeatmapList-method}
3
+\alias{annotation_legend_size}
3 4
 \title{
4 5
 Size of the annotation legend viewport
5 6
 }
... ...
@@ -28,8 +29,8 @@ A \code{\link[grid]{unit}} object.
28 29
 \author{
29 30
 Zuguang Gu <z.gu@dkfz.de>
30 31
 }
31
-\alias{annotation_legend_size}
32 32
 \examples{
33 33
 # There is no example
34 34
 NULL
35
+
35 36
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{color_mapping_legend-ColorMapping-method}
2 2
 \alias{color_mapping_legend,ColorMapping-method}
3
+\alias{color_mapping_legend}
3 4
 \title{
4 5
 Draw Legend Based on Color Mapping
5 6
 }
... ...
@@ -65,8 +66,8 @@ A \code{\link{Legends-class}} object.
65 66
 \author{
66 67
 Zuguang Gu <z.gu@dkfz.de>
67 68
 }
68
-\alias{color_mapping_legend}
69 69
 \examples{
70 70
 # There is no example
71 71
 NULL
72
+
72 73
 }
... ...
@@ -29,4 +29,5 @@ Zuguang Gu <z.gu@dkfz.de>
29 29
 \examples{
30 30
 # There is no example
31 31
 NULL
32
+
32 33
 }
... ...
@@ -31,4 +31,5 @@ Zuguang Gu <z.gu@dkfz.de>
31 31
 \examples{
32 32
 # There is no example
33 33
 NULL
34
+
34 35
 }
... ...
@@ -24,4 +24,5 @@ Zuguang Gu <z.gu@dkfz.de>
24 24
 \examples{
25 25
 # There is no example
26 26
 NULL
27
+
27 28
 }
... ...
@@ -30,4 +30,5 @@ Zuguang Gu <z.gu@dkfz.de>
30 30
 \examples{
31 31
 # There is no example
32 32
 NULL
33
+
33 34
 }
... ...
@@ -27,4 +27,5 @@ Zuguang Gu <z.gu@dkfz.de>
27 27
 \examples{
28 28
 # There is no example
29 29
 NULL
30
+
30 31
 }
... ...
@@ -26,4 +26,5 @@ The environment is at \code{object@var_env}.
26 26
 \examples{
27 27
 # There is no example
28 28
 NULL
29
+
29 30
 }
... ...
@@ -21,4 +21,5 @@ it calls \code{\link{copy_all,AnnotationFunction-method}} to hard copy the varia
21 21
 \examples{
22 22
 # There is no example
23 23
 NULL
24
+
24 25
 }
... ...
@@ -17,4 +17,5 @@ dend_heights(x)
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -28,4 +28,5 @@ A \code{\link{grob}} object which is generally contructed by \code{\link[grid]{s
28 28
 \examples{
29 29
 # There is no example
30 30
 NULL
31
+
31 32
 }
... ...
@@ -31,6 +31,9 @@ densityHeatmap(data,
31 31
     column_names_rot = 90,
32 32
     
33 33
     cluster_columns = FALSE,
34
+    clustering_distance_columns = "ks",
35
+    clustering_method_columns = "complete",
36
+    
34 37
     ...)
35 38
 }
36 39
 \arguments{
... ...
@@ -54,7 +57,8 @@ densityHeatmap(data,
54 57
   \item{column_names_max_height}{Pass to \code{\link{Heatmap}}.}
55 58
   \item{column_names_gp}{Pass to \code{\link{Heatmap}}.}
56 59
   \item{column_names_rot}{Pass to \code{\link{Heatmap}}.}
57
-  \item{cluster_columns}{Whether cluster columns (here clustered by density values)? Normally we don't cluster columns.}
60
+  \item{cluster_columns}{Whether cluster columns (here clustered by density values)? Normally we don't cluster columns. - clustering_distance_columns}
61
+  \item{clustering_method_columns}{-clustering_method_columns}
58 62
   \item{...}{pass to \code{\link{Heatmap}}.}
59 63
 
60 64
 }
... ...
@@ -17,4 +17,5 @@ Dimension of the Heatmap
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -29,4 +29,5 @@ Zuguang Gu <z.gu@dkfz.de>
29 29
 \examples{
30 30
 # There is no example
31 31
 NULL
32
+
32 33
 }
... ...
@@ -27,4 +27,5 @@ which is generally for testing purpose.
27 27
 \examples{
28 28
 # There is no example
29 29
 NULL
30
+
30 31
 }
... ...
@@ -33,4 +33,5 @@ Zuguang Gu <z.gu@dkfz.de>
33 33
 \examples{
34 34
 # There is no example
35 35
 NULL
36
+
36 37
 }
... ...
@@ -29,4 +29,5 @@ Zuguang Gu <z.gu@dkfz.de>
29 29
 \examples{
30 30
 # There is no example
31 31
 NULL
32
+
32 33
 }
... ...
@@ -174,4 +174,5 @@ Zuguang Gu <z.gu@dkfz.de>
174 174
 \examples{
175 175
 # There is no example
176 176
 NULL
177
+
177 178
 }
... ...
@@ -27,4 +27,5 @@ Zuguang Gu <z.gu@dkfz.de>
27 27
 \examples{
28 28
 # There is no example
29 29
 NULL
30
+
30 31
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{draw_annotation-Heatmap-method}
2 2
 \alias{draw_annotation,Heatmap-method}
3
+\alias{draw_annotation}
3 4
 \title{
4 5
 Draw Heatmap Annotations on the Heatmap
5 6
 }
... ...
@@ -30,8 +31,8 @@ This function returns no value.
30 31
 \author{
31 32
 Zuguang Gu <z.gu@dkfz.de>
32 33
 }
33
-\alias{draw_annotation}
34 34
 \examples{
35 35
 # There is no example
36 36
 NULL
37
+
37 38
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{draw_annotation_legend-HeatmapList-method}
2 2
 \alias{draw_annotation_legend,HeatmapList-method}
3
+\alias{draw_annotation_legend}
3 4
 \title{
4 5
 Draw legends for all column annotations
5 6
 }
... ...
@@ -27,8 +28,8 @@ This function returns no value.
27 28
 \author{
28 29
 Zuguang Gu <z.gu@dkfz.de>
29 30
 }
30
-\alias{draw_annotation_legend}
31 31
 \examples{
32 32
 # There is no example
33 33
 NULL
34
+
34 35
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{draw_dend-Heatmap-method}
2 2
 \alias{draw_dend,Heatmap-method}
3
+\alias{draw_dend}
3 4
 \title{
4 5
 Draw Heatmap Dendrograms
5 6
 }
... ...
@@ -33,8 +34,8 @@ This function returns no value.
33 34
 \author{
34 35
 Zuguang Gu <z.gu@dkfz.de>
35 36
 }
36
-\alias{draw_dend}
37 37
 \examples{
38 38
 # There is no example
39 39
 NULL
40
+
40 41
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{draw_dimnames-Heatmap-method}
2 2
 \alias{draw_dimnames,Heatmap-method}
3
+\alias{draw_dimnames}
3 4
 \title{
4 5
 Draw row names or column names
5 6
 }
... ...
@@ -29,8 +30,8 @@ This function returns no value.
29 30
 \author{
30 31
 Zuguang Gu <z.gu@dkfz.de>
31 32
 }
32
-\alias{draw_dimnames}
33 33
 \examples{
34 34
 # There is no example
35 35
 NULL
36
+
36 37
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{draw_heatmap_body-Heatmap-method}
2 2
 \alias{draw_heatmap_body,Heatmap-method}
3
+\alias{draw_heatmap_body}
3 4
 \title{
4 5
 Draw the Heatmap Body
5 6
 }
... ...
@@ -28,8 +29,8 @@ This function returns no value.
28 29
 \author{
29 30
 Zuguang Gu <z.gu@dkfz.de>
30 31
 }
31
-\alias{draw_heatmap_body}
32 32
 \examples{
33 33
 # There is no example
34 34
 NULL
35
+
35 36
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{draw_heatmap_legend-HeatmapList-method}
2 2
 \alias{draw_heatmap_legend,HeatmapList-method}
3
+\alias{draw_heatmap_legend}
3 4
 \title{
4 5
 Draw legends for all heatmaps
5 6
 }
... ...
@@ -27,8 +28,8 @@ This function returns no value.
27 28
 \author{
28 29
 Zuguang Gu <z.gu@dkfz.de>
29 30
 }
30
-\alias{draw_heatmap_legend}
31 31
 \examples{
32 32
 # There is no example
33 33
 NULL
34
+
34 35
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{draw_heatmap_list-HeatmapList-method}
2 2
 \alias{draw_heatmap_list,HeatmapList-method}
3
+\alias{draw_heatmap_list}
3 4
 \title{
4 5
 Draw the list of heatmaps
5 6
 }
... ...
@@ -25,8 +26,8 @@ This function returns no value.
25 26
 \author{
26 27
 Zuguang Gu <z.gu@dkfz.de>
27 28
 }
28
-\alias{draw_heatmap_list}
29 29
 \examples{
30 30
 # There is no example
31 31
 NULL
32
+
32 33
 }
... ...
@@ -32,4 +32,5 @@ Zuguang Gu <z.gu@dkfz.de>
32 32
 \examples{
33 33
 # There is no example
34 34
 NULL
35
+
35 36
 }
... ...
@@ -30,4 +30,5 @@ Zuguang Gu <z.gu@dkfz.de>
30 30
 \examples{
31 31
 # There is no example
32 32
 NULL
33
+
33 34
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{get_color_mapping_list-HeatmapAnnotation-method}
2 2
 \alias{get_color_mapping_list,HeatmapAnnotation-method}
3
+\alias{get_color_mapping_list}
3 4
 \title{
4 5
 Get a List of ColorMapping objects
5 6
 }
... ...
@@ -25,8 +26,8 @@ A list of \code{\link{ColorMapping-class}} objects or an empty list.
25 26
 \author{
26 27
 Zuguang Gu <z.gu@dkfz.de>
27 28
 }
28
-\alias{get_color_mapping_list}
29 29
 \examples{
30 30
 # There is no example
31 31
 NULL
32
+
32 33
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{get_legend_param_list-HeatmapAnnotation-method}
2 2
 \alias{get_legend_param_list,HeatmapAnnotation-method}
3
+\alias{get_legend_param_list}
3 4
 \title{
4 5
 Get a List of Annotation Legend Parameters
5 6
 }
... ...
@@ -25,8 +26,8 @@ A list.
25 26
 \author{
26 27
 Zuguang Gu <z.gu@dkfz.de>
27 28
 }
28
-\alias{get_legend_param_list}
29 29
 \examples{
30 30
 # There is no example
31 31
 NULL
32
+
32 33
 }
... ...
@@ -29,4 +29,5 @@ All the values are measured with \code{native} coordinate.
29 29
 \examples{
30 30
 # There is no example
31 31
 NULL
32
+
32 33
 }
... ...
@@ -22,4 +22,5 @@ general method. It applies \code{\link[grid]{grid.draw}} on the \code{grob} slot
22 22
 \examples{
23 23
 # There is no example
24 24
 NULL
25
+
25 26
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{heatmap_legend_size-HeatmapList-method}
2 2
 \alias{heatmap_legend_size,HeatmapList-method}
3
+\alias{heatmap_legend_size}
3 4
 \title{
4 5
 Size of the heatmap legend viewport
5 6
 }
... ...
@@ -25,8 +26,8 @@ A \code{\link[grid]{unit}} object.
25 26
 \author{
26 27
 Zuguang Gu <z.gu@dkfz.de>
27 28
 }
28
-\alias{heatmap_legend_size}
29 29
 \examples{
30 30
 # There is no example
31 31
 NULL
32
+
32 33
 }
... ...
@@ -18,4 +18,5 @@ Height of the HeatmapAnnotation Object
18 18
 \examples{
19 19
 # There is no example
20 20
 NULL
21
+
21 22
 }
... ...
@@ -21,4 +21,5 @@ The returned unit x is always in \code{mm}.
21 21
 \examples{
22 22
 # There is no example
23 23
 NULL
24
+
24 25
 }
... ...
@@ -18,4 +18,5 @@ Height of the SingleAnnotation object
18 18
 \examples{
19 19
 # There is no example
20 20
 NULL
21
+
21 22
 }
... ...
@@ -18,4 +18,5 @@ height(x, ...)
18 18
 \examples{
19 19
 # There is no example
20 20
 NULL
21
+
21 22
 }
... ...
@@ -20,4 +20,5 @@ Assign the Height to the AnnotationFunction Object
20 20
 \examples{
21 21
 # There is no example
22 22
 NULL
23
+
23 24
 }
... ...
@@ -20,4 +20,5 @@ Assign the Height to the HeatmapAnnotation Object
20 20
 \examples{
21 21
 # There is no example
22 22
 NULL
23
+
23 24
 }
... ...
@@ -20,4 +20,5 @@ Assign the Height to the SingleAnnotation Object
20 20
 \examples{
21 21
 # There is no example
22 22
 NULL
23
+
23 24
 }
... ...
@@ -20,4 +20,5 @@ height(x, ...) <- value
20 20
 \examples{
21 21
 # There is no example
22 22
 NULL
23
+
23 24
 }
... ...
@@ -17,4 +17,5 @@ Grob width for annotation_axis
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -17,4 +17,5 @@ Grob height for packed_legends
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -17,4 +17,5 @@ Grob height for legend_body
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -17,4 +17,5 @@ Grob height for packed_legends
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -25,4 +25,5 @@ will also be sychronized in \code{\link{ht_opt}}.
25 25
 \examples{
26 26
 # There is no example
27 27
 NULL
28
+
28 29
 }
... ...
@@ -17,4 +17,5 @@ Number of Annotations
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -17,4 +17,5 @@ Length of the HeatmapList object
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -15,4 +15,5 @@ A vector of viewport names.
15 15
 \examples{
16 16
 # There is no example
17 17
 NULL
18
+
18 19
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{make_column_cluster-Heatmap-method}
2 2
 \alias{make_column_cluster,Heatmap-method}
3
+\alias{make_column_cluster}
3 4
 \title{
4 5
 Make Cluster on Columns
5 6
 }
... ...
@@ -28,8 +29,8 @@ A \code{\link{Heatmap-class}} object.
28 29
 \author{
29 30
 Zuguang Gu <z.gu@dkfz.de>
30 31
 }
31
-\alias{make_column_cluster}
32 32
 \examples{
33 33
 # There is no example
34 34
 NULL
35
+
35 36
 }
... ...
@@ -32,4 +32,5 @@ Zuguang Gu <z.gu@dkfz.de>
32 32
 \examples{
33 33
 # There is no example
34 34
 NULL
35
+
35 36
 }
... ...
@@ -133,4 +133,5 @@ Zuguang Gu <z.gu@dkfz.de>
133 133
 \examples{
134 134
 # There is no example
135 135
 NULL
136
+
136 137
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{make_row_cluster-Heatmap-method}
2 2
 \alias{make_row_cluster,Heatmap-method}
3
+\alias{make_row_cluster}
3 4
 \title{
4 5
 Make Cluster on Rows
5 6
 }
... ...
@@ -27,8 +28,8 @@ A \code{\link{Heatmap-class}} object.
27 28
 \author{
28 29
 Zuguang Gu <z.gu@dkfz.de>
29 30
 }
30
-\alias{make_row_cluster}
31 31
 \examples{
32 32
 # There is no example
33 33
 NULL
34
+
34 35
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{map_to_colors-ColorMapping-method}
2 2
 \alias{map_to_colors,ColorMapping-method}
3
+\alias{map_to_colors}
3 4
 \title{
4 5
 Map Values to Colors
5 6
 }
... ...
@@ -34,4 +35,3 @@ col_fun = colorRamp2(c(0, 1), c("white", "red"))
34 35
 cm = ColorMapping(col_fun = col_fun)
35 36
 map_to_colors(cm, runif(10))
36 37
 }
37
-\alias{map_to_colors}
... ...
@@ -17,4 +17,5 @@ Names of the heatmaps/annotations
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -17,4 +17,5 @@ Number of Columns in the Heatmap
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -18,4 +18,5 @@ Number of Observations
18 18
 \examples{
19 19
 # There is no example
20 20
 NULL
21
+
21 22
 }
... ...
@@ -21,4 +21,5 @@ It returns the \code{n} slot of the annotaton function. If it does not exist, it
21 21
 \examples{
22 22
 # There is no example
23 23
 NULL
24
+
24 25
 }
... ...
@@ -17,4 +17,5 @@ Number of Rows in the Heatmap
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -13,11 +13,10 @@ oncoPrint(mat,
13 13
     alter_fun_is_vectorized = NULL,
14 14
     col,
15 15
     
16
-    top_annotation = HeatmapAnnotation(column_barplot = anno_oncoprint_barplot(),
17
-    show_annotation_name = FALSE),
16
+    top_annotation = HeatmapAnnotation(column_barplot = anno_oncoprint_barplot()),
18 17
     right_annotation = rowAnnotation(row_barplot = anno_oncoprint_barplot(
19
-    axis_param = list(side = "top", labels_rot = 0)),
20
-    show_annotation_name = FALSE),
18
+    axis_param = list(side = "top", labels_rot = 0))),
19
+    bottom_annotation = NULL,
21 20
     
22 21
     show_pct = TRUE,
23 22
     pct_gp = gpar(fontsize = 10),
... ...
@@ -76,4 +75,5 @@ Zuguang Gu <z.gu@dkfz.de>
76 75
 \examples{
77 76
 # There is no example
78 77
 NULL
78
+
79 79
 }
... ...
@@ -39,4 +39,5 @@ Zuguang Gu <z.gu@dkfz.de>
39 39
 \examples{
40 40
 # There is no example
41 41
 NULL
42
+
42 43
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{prepare-Heatmap-method}
2 2
 \alias{prepare,Heatmap-method}
3
+\alias{prepare}
3 4
 \title{
4 5
 Prepare the Heatmap
5 6
 }
... ...
@@ -33,8 +34,8 @@ The \code{\link{Heatmap-class}} object.
33 34
 \author{
34 35
 Zuguang Gu <z.gu@dkfz.de>
35 36
 }
36
-\alias{prepare}
37 37
 \examples{
38 38
 # There is no example
39 39
 NULL
40
+
40 41
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{resize-HeatmapAnnotation-method}
2 2
 \alias{resize,HeatmapAnnotation-method}
3
+\alias{resize}
3 4
 \title{
4 5
 Resize the Width or Height of Heatmap Annotations
5 6
 }
... ...
@@ -40,8 +41,8 @@ the basic rule is:
40 41
      and \code{anno_simple_size} is disabled.
41 42
 6. If \code{simple_anno_size_adjust} is \code{FALSE}, the size of the simple annotations will not change.
42 43
 }
43
-\alias{resize}
44 44
 \examples{
45 45
 # There is no example
46 46
 NULL
47
+
47 48
 }
... ...
@@ -29,4 +29,5 @@ Zuguang Gu <z.gu@dkfz.de>
29 29
 \examples{
30 30
 # There is no example
31 31
 NULL
32
+
32 33
 }
... ...
@@ -25,4 +25,5 @@ See help page of \code{\link{anno_barplot}}
25 25
 \examples{
26 26
 # There is no example
27 27
 NULL
28
+
28 29
 }
... ...
@@ -25,4 +25,5 @@ See help page of \code{\link{anno_boxplot}}
25 25
 \examples{
26 26
 # There is no example
27 27
 NULL
28
+
28 29
 }
... ...
@@ -25,4 +25,5 @@ See help page of \code{\link{anno_density}}
25 25
 \examples{
26 26
 # There is no example
27 27
 NULL
28
+
28 29
 }
... ...
@@ -25,4 +25,5 @@ See help page of \code{\link{anno_histogram}}
25 25
 \examples{
26 26
 # There is no example
27 27
 NULL
28
+
28 29
 }
... ...
@@ -25,4 +25,5 @@ See help page of \code{\link{anno_link}}
25 25
 \examples{
26 26
 # There is no example
27 27
 NULL
28
+
28 29
 }
... ...
@@ -25,4 +25,5 @@ See help page of \code{\link{anno_points}}
25 25
 \examples{
26 26
 # There is no example
27 27
 NULL
28
+
28 29
 }
... ...
@@ -25,4 +25,5 @@ See help page of \code{\link{anno_text}}
25 25
 \examples{
26 26
 # There is no example
27 27
 NULL
28
+
28 29
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{set_component_height-Heatmap-method}
2 2
 \alias{set_component_height,Heatmap-method}
3
+\alias{set_component_height}
3 4
 \title{
4 5
 Set Height of Heatmap Component
5 6
 }
... ...
@@ -29,8 +30,8 @@ The \code{\link{Heatmap-class}} object.
29 30
 \author{
30 31
 Zuguang Gu <z.gu@dkfz.de>
31 32
 }
32
-\alias{set_component_height}
33 33
 \examples{
34 34
 # There is no example
35 35
 NULL
36
+
36 37
 }
... ...
@@ -1,5 +1,6 @@
1 1
 \name{set_component_width-Heatmap-method}
2 2
 \alias{set_component_width,Heatmap-method}
3
+\alias{set_component_width}
3 4
 \title{
4 5
 Set Width of Heatmap Component
5 6
 }
... ...
@@ -28,8 +29,8 @@ The \code{\link{Heatmap-class}} object.
28 29
 \author{
29 30
 Zuguang Gu <z.gu@dkfz.de>
30 31
 }
31
-\alias{set_component_width}
32 32
 \examples{
33 33
 # There is no example
34 34
 NULL
35
+
35 36
 }
... ...
@@ -17,4 +17,5 @@ Print the AnnotationFunction Object
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -23,4 +23,5 @@ Zuguang Gu <z.gu@dkfz.de>
23 23
 \examples{
24 24
 # There is no example
25 25
 NULL
26
+
26 27
 }
... ...
@@ -27,4 +27,5 @@ Zuguang Gu <z.gu@dkfz.de>
27 27
 \examples{
28 28
 # There is no example
29 29
 NULL
30
+
30 31
 }
... ...
@@ -23,4 +23,5 @@ Zuguang Gu <z.gu@dkfz.de>
23 23
 \examples{
24 24
 # There is no example
25 25
 NULL
26
+
26 27
 }
... ...
@@ -24,4 +24,5 @@ This function returns no value.
24 24
 \examples{
25 25
 # There is no example
26 26
 NULL
27
+
27 28
 }
... ...
@@ -23,4 +23,5 @@ Zuguang Gu <z.gu@dkfz.de>
23 23
 \examples{
24 24
 # There is no example
25 25
 NULL
26
+
26 27
 }
... ...
@@ -21,4 +21,5 @@ It returns the width if it is a row annotation and the height if it is a column
21 21
 \examples{
22 22
 # There is no example
23 23
 NULL
24
+
24 25
 }
... ...
@@ -21,4 +21,5 @@ It returns the width if it is a row annotation and the height if it is a column
21 21
 \examples{
22 22
 # There is no example
23 23
 NULL
24
+
24 25
 }
... ...
@@ -18,4 +18,5 @@ size(x, ...)
18 18
 \examples{
19 19
 # There is no example
20 20
 NULL
21
+
21 22
 }
... ...
@@ -23,4 +23,5 @@ It assigns the width if it is a row annotation and the height if it is a column
23 23
 \examples{
24 24
 # There is no example
25 25
 NULL
26
+
26 27
 }
... ...
@@ -23,4 +23,5 @@ It assigns to the width if it is a row annotation and the height if it is a colu
23 23
 \examples{
24 24
 # There is no example
25 25
 NULL
26
+
26 27
 }
... ...
@@ -20,4 +20,5 @@ size(x, ...) <- value
20 20
 \examples{
21 21
 # There is no example
22 22
 NULL
23
+
23 24
 }
... ...
@@ -18,4 +18,5 @@ subset_matrix_by_row(x, i)
18 18
 \examples{
19 19
 # There is no example
20 20
 NULL
21
+
21 22
 }
... ...
@@ -18,4 +18,5 @@ subset_vector(x, i)
18 18
 \examples{
19 19
 # There is no example
20 20
 NULL
21
+
21 22
 }
... ...
@@ -18,4 +18,5 @@ Print the Summary of a Heatmap
18 18
 \examples{
19 19
 # There is no example
20 20
 NULL
21
+
21 22
 }
... ...
@@ -27,4 +27,5 @@ Zuguang Gu <z.gu@dkfz.de>
27 27
 \examples{
28 28
 # There is no example
29 29
 NULL
30
+
30 31
 }
... ...
@@ -18,4 +18,5 @@ Width of the HeatmapAnnotation Object
18 18
 \examples{
19 19
 # There is no example
20 20
 NULL
21
+
21 22
 }
... ...
@@ -21,4 +21,5 @@ The returned unit x is always in \code{mm}.
21 21
 \examples{
22 22
 # There is no example
23 23
 NULL
24
+
24 25
 }
... ...
@@ -18,4 +18,5 @@ Width of the SingleAnnotation Object
18 18
 \examples{
19 19
 # There is no example
20 20
 NULL
21
+
21 22
 }
... ...
@@ -18,4 +18,5 @@ width(x, ...)
18 18
 \examples{
19 19
 # There is no example
20 20
 NULL
21
+
21 22
 }
... ...
@@ -20,4 +20,5 @@ Assign the Width to the AnnotationFunction Object
20 20
 \examples{
21 21
 # There is no example
22 22
 NULL
23
+
23 24
 }
... ...
@@ -20,4 +20,5 @@ Assign the Width to the HeatmapAnnotation Object
20 20
 \examples{
21 21
 # There is no example
22 22
 NULL
23
+
23 24
 }
... ...
@@ -20,4 +20,5 @@ Assign the Width to the SingleAnnotation Object
20 20
 \examples{
21 21
 # There is no example
22 22
 NULL
23
+
23 24
 }
... ...
@@ -20,4 +20,5 @@ width(x, ...) <- value
20 20
 \examples{
21 21
 # There is no example
22 22
 NULL
23
+
23 24
 }
... ...
@@ -17,4 +17,5 @@ Grob width for annotation_axis
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -17,4 +17,5 @@ Grob width for packed_legends
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -17,4 +17,5 @@ Grob width for legend_body
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -17,4 +17,5 @@ Grob width for packed_legends
17 17
 \examples{
18 18
 # There is no example
19 19
 NULL
20
+
20 21
 }
... ...
@@ -418,3 +418,7 @@ ra = rowAnnotation(foo = 1:24)
418 418
 Heatmap(mat, show_column_names = FALSE) + ra
419 419
 	left_annotation = ra)
420 420
 
421
+
422
+Heatmap(matrix(rnorm(100), 10), row_km = 2, row_title = "")
423
+
424
+Heatmap(matrix(rnorm(100), 10), heatmap_width = unit(5, "mm"))