#### add max_density argument

Zuguang Gu authored on 15/06/2022 10:42:56
Showing1 changed files
 ... ... @@ -12,7 +12,7 @@ anno_textbox(align_to, text, background_gp = gpar(fill = "#DDDDDD", col = "#AAAA 12 12  } 13 13  \arguments{ 14 14   15 - \item{align_to}{It controls how the text boxes are aligned to the heatmap rows. The value can be a categorical vector which have the same length as heatmap rows, or a list of row indices.} 15 + \item{align_to}{It controls how the text boxes are aligned to the heatmap rows. The value can be a categorical vector which have the same length as heatmap rows, or a list of row indices. It does not necessarily include all row indices.} 16 16  \item{text}{The corresponding texts. The value should be a list of texts. To control graphics parameters of texts in the boxes, The value of \code{text} can also be set as a list of data frames where the first column contains the text, from the second column contains graphics parameters for each text. The column names should be "col", "fontsize", "fontfamily" and "fontface".} 17 17  \item{background_gp}{Graphics for the background.} 18 18  \item{which}{Only "row" is allowed.}

#### rename to anno_textbox()

Zuguang Gu authored on 15/06/2022 10:11:58
Showing1 changed files
 1 1 new file mode 100644 ... ... @@ -0,0 +1,37 @@ 1 +\name{anno_textbox} 2 +\alias{anno_textbox} 3 +\title{ 4 +Text box annotations 5 +} 6 +\description{ 7 +Text box annotations 8 +} 9 +\usage{ 10 +anno_textbox(align_to, text, background_gp = gpar(fill = "#DDDDDD", col = "#AAAAAA"), 11 + which = c("row", "column"), by = "anno_link", side = c("right", "left"), ...) 12 +} 13 +\arguments{ 14 + 15 + \item{align_to}{It controls how the text boxes are aligned to the heatmap rows. The value can be a categorical vector which have the same length as heatmap rows, or a list of row indices.} 16 + \item{text}{The corresponding texts. The value should be a list of texts. To control graphics parameters of texts in the boxes, The value of \code{text} can also be set as a list of data frames where the first column contains the text, from the second column contains graphics parameters for each text. The column names should be "col", "fontsize", "fontfamily" and "fontface".} 17 + \item{background_gp}{Graphics for the background.} 18 + \item{which}{Only "row" is allowed.} 19 + \item{by}{Are text boxed arranged by \code{\link{anno_link}} or by \code{\link{anno_block}}?} 20 + \item{side}{Side of the annotation to the heatmap.} 21 + \item{...}{Pass to \code{\link{textbox_grob}}.} 22 + 23 +} 24 +\examples{ 25 +require(circlize) 26 +mat = matrix(rnorm(100*10), nrow = 100) 27 + 28 +split = sample(letters[1:10], 100, replace = TRUE) 29 +text = lapply(unique(split), function(x) { 30 + data.frame(month.name, col = rand_color(12, friendly = TRUE), fontsize = runif(12, 6, 14)) 31 +}) 32 +names(text) = unique(split) 33 + 34 +Heatmap(mat, cluster_rows = FALSE, row_split = split, 35 + right_annotation = rowAnnotation(wc = anno_textbox(split, text)) 36 +) 37 +}