anno_word_cloud {simplifyEnrichment} | R Documentation |
Word cloud annotations
anno_word_cloud(align_to, term, exclude_words = NULL, max_words = 10, word_cloud_grob_param = list(), fontsize_range = c(4, 16), bg_gp = gpar(fill = "#DDDDDD", col = "#AAAAAA"), side = c("right", "left"), ...)
align_to |
How to align the annotations to the heatmap. Similar as in |
term |
The description text used for constructing the word clouds. The value should have the same format as |
exclude_words |
The words excluced for construcing word cloud. |
max_words |
Maximal number of words visualized in the word cloud. |
word_cloud_grob_param |
A list of graphics parameters passed to |
fontsize_range |
The range of the font size. The value should be a numeric vector with length two. The minimal font size is mapped to word frequency value of 1 and the maximal font size is mapped to the maximal word frequency. The font size interlopation is linear. |
bg_gp |
Graphics parameters for controlling the background. |
side |
Side of the annotation relative to the heatmap. |
... |
Other parameters. |
The word cloud annotation is constructed by anno_link
.
If the annotation is failed to construct or no keyword is found, the function returns a anno_empty
with 1px width.
gm = readRDS(system.file("extdata", "random_GO_BP_sim_mat.rds", package = "simplifyEnrichment")) go_id = rownames(gm) go_term = AnnotationDbi::select(GO.db::GO.db, keys = go_id, columns = "TERM")$TERM split = sample(letters[1:4], 100, replace = TRUE) align_to = split(1:100, split) term = lapply(letters[1:4], function(x) sample(go_term, sample(100:400, 1))) names(term) = letters[1:4] require(ComplexHeatmap) mat = matrix(rnorm(100*10), nrow = 100) Heatmap(mat, cluster_rows = FALSE, row_split = split, right_annotation = rowAnnotation(foo = anno_word_cloud(align_to, term)))