Browse code

add 'show_name' argument in 'anno_block()' function

Zuguang Gu authored on 01/04/2020 12:49:26
Showing3 changed files

... ...
@@ -8,6 +8,7 @@ CHANGES in VERSION 2.3.3
8 8
   is turned on and the message should be printed to users.
9 9
 * UpSet plots: optimize the processing of many sets (current solution consumes huge memory)
10 10
 * UpSet plots: the "intersect" and "union" modes are currectly calculated.
11
+* `anno_block()`: add `show_name` argument.
11 12
 
12 13
 ========================
13 14
 
... ...
@@ -3210,6 +3210,7 @@ anno_summary = function(which = c("column", "row"), border = TRUE, bar_width = 0
3210 3210
 # -which Is it a row annotation or a column annotation?
3211 3211
 # -width Width of the annotation. The value should be an absolute unit. Width is not allowed to be set for column annotation.
3212 3212
 # -height Height of the annotation. The value should be an absolute unit. Height is not allowed to be set for row annotation.
3213
+# -show_name Whether show annotatio name.
3213 3214
 #
3214 3215
 # == details
3215 3216
 # The block annotation is used for representing slices. The length of all arguments should be 1 or the number of slices.
... ...
@@ -3229,7 +3230,7 @@ anno_summary = function(which = c("column", "row"), border = TRUE, bar_width = 0
3229 3230
 #         labels = c("group1", "group2", "group3"), labels_gp = gpar(col = "white"))),
3230 3231
 #     row_km = 3)
3231 3232
 anno_block = function(gp = gpar(), labels = NULL, labels_gp = gpar(), labels_rot = ifelse(which == "row", 90, 0),
3232
-	which = c("column", "row"), width = NULL, height = NULL) {
3233
+	which = c("column", "row"), width = NULL, height = NULL, show_name = FALSE) {
3233 3234
 
3234 3235
 	if(is.null(.ENV$current_annotation_which)) {
3235 3236
 		which = match.arg(which)[1]
... ...
@@ -3272,7 +3273,7 @@ anno_block = function(gp = gpar(), labels = NULL, labels_gp = gpar(), labels_rot
3272 3273
 		subsetable = TRUE,
3273 3274
 		height = anno_size$height,
3274 3275
 		width = anno_size$width,
3275
-		show_name = FALSE
3276
+		show_name = show_name
3276 3277
 	)
3277 3278
 	return(anno) 
3278 3279
 }
... ...
@@ -8,7 +8,7 @@ Block annotation
8 8
 }
9 9
 \usage{
10 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)
11
+    which = c("column", "row"), width = NULL, height = NULL, show_name = FALSE)
12 12
 }
13 13
 \arguments{
14 14
 
... ...
@@ -19,6 +19,7 @@ anno_block(gp = gpar(), labels = NULL, labels_gp = gpar(), labels_rot = ifelse(w
19 19
   \item{which}{Is it a row annotation or a column annotation?}
20 20
   \item{width}{Width of the annotation. The value should be an absolute unit. Width is not allowed to be set for column annotation.}
21 21
   \item{height}{Height of the annotation. The value should be an absolute unit. Height is not allowed to be set for row annotation.}
22
+  \item{show_name}{Whether show annotatio name.}
22 23
 
23 24
 }
24 25
 \details{