You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(scale%in% c("none", "row", "column", "both") |> not()) stop("tidyHeatmap says: the scale parameter has to be one of c(\"none\", \"row\", \"column\", \"both\")")
252
-
278
+
253
279
# # Message about change of style, once per session
# message("tidyHeatmap says: (once per session) from release 1.2.3 the grouping labels have white background by default. To add color for one-ay grouping specify palette_grouping = list(c(\"red\", \"blue\"))")
message("tidyHeatmap says: (once per session) from release 1.7.0 the scaling is set to \"none\" by default. Please use scale = \"row\", \"column\" or \"both\" to apply scaling")
#' Adds a layers of texts above the heatmap tiles to a `InputHeatmap`, that on evaluation creates a `ComplexHeatmap`
990
+
#'
991
+
#' \lifecycle{maturing}
992
+
#'
993
+
#' @description layer_text() from a `InputHeatmap` object, adds a text annotation layer.
994
+
#'
995
+
#' @importFrom rlang enquo
996
+
#' @importFrom magrittr "%>%"
997
+
#'
998
+
#'
999
+
#'
1000
+
#' @name layer_text
1001
+
#' @rdname layer_text-method
1002
+
#'
1003
+
#' @param .data A `InputHeatmap`
1004
+
#' @param ... Expressions that return a logical value, and are defined in terms of the variables in .data. If multiple expressions are included, they are combined with the & operator. Only rows for which all conditions evaluate to TRUE are kept.
1005
+
#' @param .value A column name or character string.
1006
+
#' @param .size A column name or a double.
1007
+
#'
1008
+
#'
1009
+
#' @details It uses `ComplexHeatmap` as visualisation tool.
1010
+
#'
1011
+
#' @return A `InputHeatmap` object that gets evaluated to a `ComplexHeatmap`
1012
+
#'
1013
+
#'
1014
+
#'
1015
+
#' @examples
1016
+
#'
1017
+
#' library(dplyr)
1018
+
#'
1019
+
#' hm =
1020
+
#' tidyHeatmap::N52 |>
1021
+
#' mutate(my_text = "t") |>
1022
+
#' tidyHeatmap::heatmap(
1023
+
#' .row = symbol_ct,
1024
+
#' .column = UBR,
1025
+
#' .value = `read count normalised log`
1026
+
#' )
1027
+
#'
1028
+
#' hm |> layer_text(.value = "a")
1029
+
#' hm |> layer_text(.value = my_text)
1030
+
#'
1031
+
#' @export
1032
+
setGeneric("layer_text", function(.data,
1033
+
...,
1034
+
.value,
1035
+
.size=NULL)
1036
+
standardGeneric("layer_text"))
1037
+
1038
+
#' layer_text
1039
+
#'
1040
+
#' @importFrom rlang quo_is_null
1041
+
#'
1042
+
#' @docType methods
1043
+
#' @rdname layer_text-method
1044
+
#'
1045
+
#'
1046
+
#' @return A `InputHeatmap` object that gets evaluated to a `ComplexHeatmap`
0 commit comments