Browse code

remove old vignettes

jokergoo authored on 30/10/2018 12:52:23
Showing 1 changed files
1 1
deleted file mode 100755
... ...
@@ -1,225 +0,0 @@
1
-<!--
2
-%\VignetteEngine{knitr}
3
-%\VignetteIndexEntry{9. More Examples}
4
-
5
-More Examples of Making Complex Heatmaps
6
-========================================
7
-
8
-**Author**: Zuguang Gu ( z.gu@dkfz.de )
9
-
10
-**Date**: `r Sys.Date()`
11
-
12
-
13
-```{r global_settings, echo = FALSE, message = FALSE}
14
-library(markdown)
15
-
16
-library(knitr)
17
-knitr::opts_chunk$set(
18
-    error = FALSE,
19
-    tidy  = FALSE,
20
-    message = FALSE,
21
-    fig.align = "center",
22
-    fig.width = 5,
23
-    fig.height = 5)
24
-options(markdown.HTML.stylesheet = "custom.css")
25
-
26
-options(width = 100)
27
-```
28
-
29
-In the supplementaries of [the ComplexHeatmap paper](http://bioinformatics.oxfordjournals.org/content/early/2016/05/20/bioinformatics.btw313.abstract), there are four comprehensive examples which are applied
30
-on real-world high-throughput datasets. [The examples can be found here.](http://jokergoo.github.io/supplementary/ComplexHeatmap-supplementary1-4/index.html)
31
-
32
-Also [my blog](http://jokergoo.github.io/blog.html) has some examples and tips for making better complex heatmaps.
33
-
34
-
35
-### Add more information for gene expression matrix
36
-
37
-Heatmaps are very popular to visualize gene expression matrix. 
38
-Rows in the matrix correspond to genes and more information on these genes can be attached after the expression
39
-heatmap.
40
-
41
-In following example, the big heatmap visualize relative expression for genes, then the next is the absolute expression.
42
-Also gene length and gene type (i.e. protein coding or lincRNA) are visualized.
43
-
44
-
45
-```{r expression_example, fig.width = 10, fig.height = 8}
46
-library(ComplexHeatmap)
47
-library(circlize)
48
-
49
-expr = readRDS(paste0(system.file(package = "ComplexHeatmap"), "/extdata/gene_expression.rds"))
50
-mat = as.matrix(expr[, grep("cell", colnames(expr))])
51
-base_mean = rowMeans(mat)
52
-mat_scaled = t(apply(mat, 1, scale))
53
-
54
-type = gsub("s\\d+_", "", colnames(mat))
55
-ha = HeatmapAnnotation(df = data.frame(type = type))
56
-
57
-Heatmap(mat_scaled, name = "expression", km = 5, col = colorRamp2(c(-2, 0, 2), c("green", "white", "red")),
58
-    top_annotation = ha, top_annotation_height = unit(4, "mm"), 
59
-    show_row_names = FALSE, show_column_names = FALSE) +
60
-Heatmap(base_mean, name = "base_mean", show_row_names = FALSE, width = unit(5, "mm")) +
61
-Heatmap(expr$length, name = "length", col = colorRamp2(c(0, 1000000), c("white", "orange")),
62
-    heatmap_legend_param = list(at = c(0, 200000, 400000, 60000, 800000, 1000000), 
63
-                                labels = c("0kb", "200kb", "400kb", "600kb", "800kb", "1mb")),
64
-    width = unit(5, "mm")) +
65
-Heatmap(expr$type, name = "type", width = unit(5, "mm"))
66
-```
67
-
68
-### Visualize genomic regions and other correspondance
69
-
70
-Following example visualizes correlation between methylation and expression, as well as other annotation information (data are randomly generated). In the heatmap, each row corresponds to a differentially methylated regions (DMRs). 
71
-From left to right, heatmaps are:
72
-
73
-1. methylation for each DMR (by rows) in samples.
74
-2. direction of the methylation (one column heatmap), i.e. is methylation hyper in tumor or hypo?
75
-3. expression for the genes that are associated with corresponding DMRs (e.g. closest gene).
76
-4. significance for the correlation between methylation and expression (-log10(p-value)).
77
-5. type of genes, i.e. is the gene a protein coding gene or a lincRNA?
78
-6. annotation to gene models, i.e. is the DMR located in the intragenic region of the corresponding gene or the DMR is intergenic?
79
-7. distance from the DMR to the TSS of the corresponding gene.
80
-8. overlapping between DMRs and enhancers (Color shows how much the DMR is covered by the enhancers).
81
-
82
-
83
-```{r, fig.width = 10, fig.height = 8, echo = FALSE, results = "hide"}
84
-library(circlize)
85
-library(RColorBrewer)
86
-
87
-lt = readRDS(paste0(system.file(package = "ComplexHeatmap"), "/extdata/meth.rds"))
88
-list2env(lt, envir = environment())
89
-
90
-ha = HeatmapAnnotation(df = data.frame(type = c(rep("Tumor", 10), rep("Control", 10))), 
91
-    col = list(type = c("Tumor" = "red", "Control" = "blue")))
92
-ha2 = HeatmapAnnotation(df = data.frame(type = c(rep("Tumor", 10), rep("Control", 10))), 
93
-    col = list(type = c("Tumor" = "red", "Control" = "blue")), show_legend = FALSE)
94
-
95
-# column order of the methylation matrix which will be assigned to the expressio matrix
96
-column_tree = hclust(dist(t(meth)))
97
-
98
-ht_list = 
99
-    Heatmap(meth, name = "methylation", col = colorRamp2(c(0, 0.5, 1), c("blue", "white", "red")),
100
-        cluster_columns = column_tree, top_annotation = ha, column_names_gp = gpar(fontsize = 8), km = 5, 
101
-        column_title = "Methylation", column_title_gp = gpar(fontsize = 10), 
102
-        row_title_gp = gpar(fontsize = 10)) +
103
-    Heatmap(direction, name = "direction", col = c("hyper" = "red", "hypo" = "blue"), 
104
-        column_names_gp = gpar(fontsize = 8)) +
105
-    Heatmap(expr[, column_tree$order], name = "expression", col = colorRamp2(c(-2, 0, 2), c("green", "white", "red")),
106
-        cluster_columns = FALSE, top_annotation = ha2, column_names_gp = gpar(fontsize = 8), 
107
-        column_title = "Expression", column_title_gp = gpar(fontsize = 10)) +
108
-    Heatmap(cor_pvalue, name = "-log10(cor_p)", col = colorRamp2(c(0, 2, 4), c("white", "white", "red")), 
109
-        column_names_gp = gpar(fontsize = 8)) +
110
-    Heatmap(gene_type, name = "gene type", col = brewer.pal(length(unique(gene_type)), "Set1"), 
111
-        column_names_gp = gpar(fontsize = 8)) +
112
-    Heatmap(anno, name = "anno_gene", col = brewer.pal(length(unique(anno)), "Set2"), 
113
-        column_names_gp = gpar(fontsize = 8)) +
114
-    Heatmap(dist, name = "dist_tss", col = colorRamp2(c(0, 10000), c("black", "white")), 
115
-        column_names_gp = gpar(fontsize = 8)) +
116
-    Heatmap(enhancer, name = "anno_enhancer", col = colorRamp2(c(0, 1), c("white", "orange")), 
117
-        cluster_columns = FALSE, column_names_gp = gpar(fontsize = 8), column_title = "Enhancer", 
118
-        column_title_gp = gpar(fontsize = 10))
119
-
120
-ht_global_opt(heatmap_legend_title_gp = gpar(fontsize = 8, fontface = "bold"), 
121
-              heatmap_legend_labels_gp = gpar(fontsize = 8))
122
-draw(ht_list, newpage = FALSE, column_title = "Correspondence between methylation, expression and other genomic features", 
123
-    column_title_gp = gpar(fontsize = 12, fontface = "bold"), heatmap_legend_side = "bottom")
124
-invisible(ht_global_opt(RESET = TRUE))
125
-```
126
-
127
-
128
-## Combine pvclust and heatmap
129
-
130
-**pvclust** package provides a robust way to test the stability of the clustering
131
-by random sampling from original data. Here you can organize the heatmap by the clustering
132
-returned from `pvclust()`.
133
-
134
-```{r}
135
-library(ComplexHeatmap)
136
-
137
-library(MASS)
138
-library(pvclust)
139
-data(Boston)
140
-boston.pv <- pvclust(Boston, nboot=100)
141
-plot(boston.pv)
142
-```
143
-
144
-Since by default `pvclust` clusters columns by 'correlation' method, we scale columns for
145
-`Boston` data set to see the relative trend.
146
-
147
-```{r}
148
-Boston_scaled = apply(Boston, 2, scale)
149
-Heatmap(Boston_scaled, cluster_columns = boston.pv$hclust, heatmap_legend_param = list(title = "Boston"))
150
-```
151
-
152
-## Make a same plot as heatmap()
153
-
154
-```{r}
155
-set.seed(123)
156
-mat = matrix(rnorm(100), 10)
157
-heatmap(mat, col = topo.colors(50))
158
-```
159
-
160
-Compare to the native `heatmap()`, `Heatmap()` can give more accurate interpolation
161
-for colors for continous values.
162
-
163
-```{r}
164
-Heatmap(mat, col = topo.colors(50), color_space = "sRGB",
165
-    row_dend_width = unit(2, "cm"), 
166
-    column_dend_height = unit(2, "cm"), row_dend_reorder = TRUE,
167
-    column_dend_reorder = TRUE)
168
-```
169
-
170
-## The measles vaccine heatmap
171
-
172
-Following code reproduces the heatmap introduced [here](https://biomickwatson.wordpress.com/2015/04/09/recreating-a-famous-visualisation/) and [here](https://benjaminlmoore.wordpress.com/2015/04/09/recreating-the-vaccination-heatmaps-in-r/).
173
-
174
-```{r, fig.width = 10, fig.height = 8}
175
-mat = readRDS(paste0(system.file("extdata", package = "ComplexHeatmap"), "/measles.rds"))
176
-ha1 = HeatmapAnnotation(dist1 = anno_barplot(colSums(mat), bar_width = 1, gp = gpar(col = NA, fill = "#FFE200"), 
177
-    border = FALSE, axis = TRUE))
178
-ha2 = rowAnnotation(dist2 = anno_barplot(rowSums(mat), bar_width = 1, gp = gpar(col = NA, fill = "#FFE200"), 
179
-    border = FALSE, which = "row", axis = TRUE), width = unit(1, "cm"))
180
-ha_column = HeatmapAnnotation(cn = function(index) {
181
-    year = as.numeric(colnames(mat))
182
-    which_decade = which(year %% 10 == 0)
183
-    grid.text(year[which_decade], which_decade/length(year), 1, just = c("center", "top"))
184
-})
185
-Heatmap(mat, name = "cases", col = colorRamp2(c(0, 800, 1000, 127000), c("white", "cornflowerblue", "yellow", "red")),
186
-    cluster_columns = FALSE, show_row_dend = FALSE, rect_gp = gpar(col= "white"), show_column_names = FALSE,
187
-    row_names_side = "left", row_names_gp = gpar(fontsize = 10),
188
-    column_title = 'Measles cases in US states 1930-2001\nVaccine introduced 1961',
189
-    top_annotation = ha1, top_annotation_height = unit(1, "cm"),
190
-    bottom_annotation = ha_column, bottom_annotation_height = grobHeight(textGrob("1900"))) + ha2
191
-
192
-decorate_heatmap_body("cases", {
193
-    i = which(colnames(mat) == "1961")
194
-    x = i/ncol(mat)
195
-    grid.lines(c(x, x), c(0, 1), gp = gpar(lwd = 2))
196
-    grid.text("Vaccine introduced", x, unit(1, "npc") + unit(5, "mm"))
197
-})
198
-```
199
-
200
-## What if my annotation name is too long?
201
-
202
-There is no space allocated for annotation name, but when the annotation name is too long,
203
-you can add paddings of the whole plot to give empty spaces for the annotation names.
204
-
205
-```{r, fig.width = 7}
206
-ha = HeatmapAnnotation(df = data.frame(a_long_long_long_annotation_name = runif(10)),
207
-    show_legend = FALSE)
208
-ht = Heatmap(matrix(rnorm(100), 10), name = "foo", top_annotation = ha)
209
-# because the default width for row cluster is 1cm
210
-padding = unit.c(unit(2, "mm"), grobWidth(textGrob("a_long_long_long_annotation_name")) - unit(1, "cm"),
211
-    unit(c(2, 2), "mm"))
212
-draw(ht, padding = padding)
213
-decorate_annotation("a_long_long_long_annotation_name", {
214
-    grid.text("a_long_long_long_annotation_name", 0, 0.5, just = "right")
215
-})
216
-```
217
-
218
-
219
-## Session info
220
-
221
-```{r}
222
-sessionInfo()
223
-```
Browse code

a backup push

Zuguang Gu authored on 18/09/2018 10:40:29
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,225 @@
1
+<!--
2
+%\VignetteEngine{knitr}
3
+%\VignetteIndexEntry{9. More Examples}
4
+-->
5
+
6
+More Examples of Making Complex Heatmaps
7
+========================================
8
+
9
+**Author**: Zuguang Gu ( z.gu@dkfz.de )
10
+
11
+**Date**: `r Sys.Date()`
12
+
13
+-------------------------------------------------------------
14
+
15
+```{r global_settings, echo = FALSE, message = FALSE}
16
+library(markdown)
17
+
18
+library(knitr)
19
+knitr::opts_chunk$set(
20
+    error = FALSE,
21
+    tidy  = FALSE,
22
+    message = FALSE,
23
+    fig.align = "center",
24
+    fig.width = 5,
25
+    fig.height = 5)
26
+options(markdown.HTML.stylesheet = "custom.css")
27
+
28
+options(width = 100)
29
+```
30
+
31
+In the supplementaries of [the ComplexHeatmap paper](http://bioinformatics.oxfordjournals.org/content/early/2016/05/20/bioinformatics.btw313.abstract), there are four comprehensive examples which are applied
32
+on real-world high-throughput datasets. [The examples can be found here.](http://jokergoo.github.io/supplementary/ComplexHeatmap-supplementary1-4/index.html)
33
+
34
+Also [my blog](http://jokergoo.github.io/blog.html) has some examples and tips for making better complex heatmaps.
35
+
36
+
37
+### Add more information for gene expression matrix
38
+
39
+Heatmaps are very popular to visualize gene expression matrix. 
40
+Rows in the matrix correspond to genes and more information on these genes can be attached after the expression
41
+heatmap.
42
+
43
+In following example, the big heatmap visualize relative expression for genes, then the next is the absolute expression.
44
+Also gene length and gene type (i.e. protein coding or lincRNA) are visualized.
45
+
46
+
47
+```{r expression_example, fig.width = 10, fig.height = 8}
48
+library(ComplexHeatmap)
49
+library(circlize)
50
+
51
+expr = readRDS(paste0(system.file(package = "ComplexHeatmap"), "/extdata/gene_expression.rds"))
52
+mat = as.matrix(expr[, grep("cell", colnames(expr))])
53
+base_mean = rowMeans(mat)
54
+mat_scaled = t(apply(mat, 1, scale))
55
+
56
+type = gsub("s\\d+_", "", colnames(mat))
57
+ha = HeatmapAnnotation(df = data.frame(type = type))
58
+
59
+Heatmap(mat_scaled, name = "expression", km = 5, col = colorRamp2(c(-2, 0, 2), c("green", "white", "red")),
60
+    top_annotation = ha, top_annotation_height = unit(4, "mm"), 
61
+    show_row_names = FALSE, show_column_names = FALSE) +
62
+Heatmap(base_mean, name = "base_mean", show_row_names = FALSE, width = unit(5, "mm")) +
63
+Heatmap(expr$length, name = "length", col = colorRamp2(c(0, 1000000), c("white", "orange")),
64
+    heatmap_legend_param = list(at = c(0, 200000, 400000, 60000, 800000, 1000000), 
65
+                                labels = c("0kb", "200kb", "400kb", "600kb", "800kb", "1mb")),
66
+    width = unit(5, "mm")) +
67
+Heatmap(expr$type, name = "type", width = unit(5, "mm"))
68
+```
69
+
70
+### Visualize genomic regions and other correspondance
71
+
72
+Following example visualizes correlation between methylation and expression, as well as other annotation information (data are randomly generated). In the heatmap, each row corresponds to a differentially methylated regions (DMRs). 
73
+From left to right, heatmaps are:
74
+
75
+1. methylation for each DMR (by rows) in samples.
76
+2. direction of the methylation (one column heatmap), i.e. is methylation hyper in tumor or hypo?
77
+3. expression for the genes that are associated with corresponding DMRs (e.g. closest gene).
78
+4. significance for the correlation between methylation and expression (-log10(p-value)).
79
+5. type of genes, i.e. is the gene a protein coding gene or a lincRNA?
80
+6. annotation to gene models, i.e. is the DMR located in the intragenic region of the corresponding gene or the DMR is intergenic?
81
+7. distance from the DMR to the TSS of the corresponding gene.
82
+8. overlapping between DMRs and enhancers (Color shows how much the DMR is covered by the enhancers).
83
+
84
+
85
+```{r, fig.width = 10, fig.height = 8, echo = FALSE, results = "hide"}
86
+library(circlize)
87
+library(RColorBrewer)
88
+
89
+lt = readRDS(paste0(system.file(package = "ComplexHeatmap"), "/extdata/meth.rds"))
90
+list2env(lt, envir = environment())
91
+
92
+ha = HeatmapAnnotation(df = data.frame(type = c(rep("Tumor", 10), rep("Control", 10))), 
93
+    col = list(type = c("Tumor" = "red", "Control" = "blue")))
94
+ha2 = HeatmapAnnotation(df = data.frame(type = c(rep("Tumor", 10), rep("Control", 10))), 
95
+    col = list(type = c("Tumor" = "red", "Control" = "blue")), show_legend = FALSE)
96
+
97
+# column order of the methylation matrix which will be assigned to the expressio matrix
98
+column_tree = hclust(dist(t(meth)))
99
+
100
+ht_list = 
101
+    Heatmap(meth, name = "methylation", col = colorRamp2(c(0, 0.5, 1), c("blue", "white", "red")),
102
+        cluster_columns = column_tree, top_annotation = ha, column_names_gp = gpar(fontsize = 8), km = 5, 
103
+        column_title = "Methylation", column_title_gp = gpar(fontsize = 10), 
104
+        row_title_gp = gpar(fontsize = 10)) +
105
+    Heatmap(direction, name = "direction", col = c("hyper" = "red", "hypo" = "blue"), 
106
+        column_names_gp = gpar(fontsize = 8)) +
107
+    Heatmap(expr[, column_tree$order], name = "expression", col = colorRamp2(c(-2, 0, 2), c("green", "white", "red")),
108
+        cluster_columns = FALSE, top_annotation = ha2, column_names_gp = gpar(fontsize = 8), 
109
+        column_title = "Expression", column_title_gp = gpar(fontsize = 10)) +
110
+    Heatmap(cor_pvalue, name = "-log10(cor_p)", col = colorRamp2(c(0, 2, 4), c("white", "white", "red")), 
111
+        column_names_gp = gpar(fontsize = 8)) +
112
+    Heatmap(gene_type, name = "gene type", col = brewer.pal(length(unique(gene_type)), "Set1"), 
113
+        column_names_gp = gpar(fontsize = 8)) +
114
+    Heatmap(anno, name = "anno_gene", col = brewer.pal(length(unique(anno)), "Set2"), 
115
+        column_names_gp = gpar(fontsize = 8)) +
116
+    Heatmap(dist, name = "dist_tss", col = colorRamp2(c(0, 10000), c("black", "white")), 
117
+        column_names_gp = gpar(fontsize = 8)) +
118
+    Heatmap(enhancer, name = "anno_enhancer", col = colorRamp2(c(0, 1), c("white", "orange")), 
119
+        cluster_columns = FALSE, column_names_gp = gpar(fontsize = 8), column_title = "Enhancer", 
120
+        column_title_gp = gpar(fontsize = 10))
121
+
122
+ht_global_opt(heatmap_legend_title_gp = gpar(fontsize = 8, fontface = "bold"), 
123
+              heatmap_legend_labels_gp = gpar(fontsize = 8))
124
+draw(ht_list, newpage = FALSE, column_title = "Correspondence between methylation, expression and other genomic features", 
125
+    column_title_gp = gpar(fontsize = 12, fontface = "bold"), heatmap_legend_side = "bottom")
126
+invisible(ht_global_opt(RESET = TRUE))
127
+```
128
+
129
+
130
+## Combine pvclust and heatmap
131
+
132
+**pvclust** package provides a robust way to test the stability of the clustering
133
+by random sampling from original data. Here you can organize the heatmap by the clustering
134
+returned from `pvclust()`.
135
+
136
+```{r}
137
+library(ComplexHeatmap)
138
+
139
+library(MASS)
140
+library(pvclust)
141
+data(Boston)
142
+boston.pv <- pvclust(Boston, nboot=100)
143
+plot(boston.pv)
144
+```
145
+
146
+Since by default `pvclust` clusters columns by 'correlation' method, we scale columns for
147
+`Boston` data set to see the relative trend.
148
+
149
+```{r}
150
+Boston_scaled = apply(Boston, 2, scale)
151
+Heatmap(Boston_scaled, cluster_columns = boston.pv$hclust, heatmap_legend_param = list(title = "Boston"))
152
+```
153
+
154
+## Make a same plot as heatmap()
155
+
156
+```{r}
157
+set.seed(123)
158
+mat = matrix(rnorm(100), 10)
159
+heatmap(mat, col = topo.colors(50))
160
+```
161
+
162
+Compare to the native `heatmap()`, `Heatmap()` can give more accurate interpolation
163
+for colors for continous values.
164
+
165
+```{r}
166
+Heatmap(mat, col = topo.colors(50), color_space = "sRGB",
167
+    row_dend_width = unit(2, "cm"), 
168
+    column_dend_height = unit(2, "cm"), row_dend_reorder = TRUE,
169
+    column_dend_reorder = TRUE)
170
+```
171
+
172
+## The measles vaccine heatmap
173
+
174
+Following code reproduces the heatmap introduced [here](https://biomickwatson.wordpress.com/2015/04/09/recreating-a-famous-visualisation/) and [here](https://benjaminlmoore.wordpress.com/2015/04/09/recreating-the-vaccination-heatmaps-in-r/).
175
+
176
+```{r, fig.width = 10, fig.height = 8}
177
+mat = readRDS(paste0(system.file("extdata", package = "ComplexHeatmap"), "/measles.rds"))
178
+ha1 = HeatmapAnnotation(dist1 = anno_barplot(colSums(mat), bar_width = 1, gp = gpar(col = NA, fill = "#FFE200"), 
179
+    border = FALSE, axis = TRUE))
180
+ha2 = rowAnnotation(dist2 = anno_barplot(rowSums(mat), bar_width = 1, gp = gpar(col = NA, fill = "#FFE200"), 
181
+    border = FALSE, which = "row", axis = TRUE), width = unit(1, "cm"))
182
+ha_column = HeatmapAnnotation(cn = function(index) {
183
+    year = as.numeric(colnames(mat))
184
+    which_decade = which(year %% 10 == 0)
185
+    grid.text(year[which_decade], which_decade/length(year), 1, just = c("center", "top"))
186
+})
187
+Heatmap(mat, name = "cases", col = colorRamp2(c(0, 800, 1000, 127000), c("white", "cornflowerblue", "yellow", "red")),
188
+    cluster_columns = FALSE, show_row_dend = FALSE, rect_gp = gpar(col= "white"), show_column_names = FALSE,
189
+    row_names_side = "left", row_names_gp = gpar(fontsize = 10),
190
+    column_title = 'Measles cases in US states 1930-2001\nVaccine introduced 1961',
191
+    top_annotation = ha1, top_annotation_height = unit(1, "cm"),
192
+    bottom_annotation = ha_column, bottom_annotation_height = grobHeight(textGrob("1900"))) + ha2
193
+
194
+decorate_heatmap_body("cases", {
195
+    i = which(colnames(mat) == "1961")
196
+    x = i/ncol(mat)
197
+    grid.lines(c(x, x), c(0, 1), gp = gpar(lwd = 2))
198
+    grid.text("Vaccine introduced", x, unit(1, "npc") + unit(5, "mm"))
199
+})
200
+```
201
+
202
+## What if my annotation name is too long?
203
+
204
+There is no space allocated for annotation name, but when the annotation name is too long,
205
+you can add paddings of the whole plot to give empty spaces for the annotation names.
206
+
207
+```{r, fig.width = 7}
208
+ha = HeatmapAnnotation(df = data.frame(a_long_long_long_annotation_name = runif(10)),
209
+    show_legend = FALSE)
210
+ht = Heatmap(matrix(rnorm(100), 10), name = "foo", top_annotation = ha)
211
+# because the default width for row cluster is 1cm
212
+padding = unit.c(unit(2, "mm"), grobWidth(textGrob("a_long_long_long_annotation_name")) - unit(1, "cm"),
213
+    unit(c(2, 2), "mm"))
214
+draw(ht, padding = padding)
215
+decorate_annotation("a_long_long_long_annotation_name", {
216
+    grid.text("a_long_long_long_annotation_name", 0, 0.5, just = "right")
217
+})
218
+```
219
+
220
+
221
+## Session info
222
+
223
+```{r}
224
+sessionInfo()
225
+```