| Title: | A Tidy Implementation of Heatmap |
|---|---|
| Description: | This is a tidy implementation for heatmap. At the moment it is based on the (great) package 'ComplexHeatmap'. The goal of this package is to interface a tidy data frame with this powerful tool. Some of the advantages are: Row and/or columns colour annotations are easy to integrate just specifying one parameter (column names). Custom grouping of rows is easy to specify providing a grouped tbl. For example: df %>% group_by(...). Labels size adjusted by row and column total number. Default use of Brewer and Viridis palettes. |
| Authors: | Stefano Mangiola [aut, cre], Anthony Papenfuss [ctb] |
| Maintainer: | Stefano Mangiola <[email protected]> |
| License: | GPL-3 |
| Version: | 1.13.2 |
| Built: | 2026-05-08 08:20:57 UTC |
| Source: | https://github.com/stemangiola/tidyheatmap |
Add two tidyHeatmap objects together
## S3 method for class 'InputHeatmap' e1 + e2## S3 method for class 'InputHeatmap' e1 + e2
e1 |
First tidyHeatmap object |
e2 |
Second tidyHeatmap object |
A combined ComplexHeatmap object
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
add_annotation() takes a tbl object and easily produces a ComplexHeatmap plot, with integration with tibble and dplyr frameworks.
add_annotation( my_input_heatmap, annotation, type = rep("tile", length(quo_names(annotation))), palette_discrete = list(), palette_continuous = list(), size = NULL, ... )add_annotation( my_input_heatmap, annotation, type = rep("tile", length(quo_names(annotation))), palette_discrete = list(), palette_continuous = list(), size = NULL, ... )
my_input_heatmap |
A 'InputHeatmap' formatted as | <SAMPLE> | <TRANSCRIPT> | <COUNT> | <...> | |
annotation |
Vector of quotes |
type |
A character vector of the set c(\"tile\", \"point\", \"bar\", \"line\") |
palette_discrete |
A list of character vectors. This is the list of palettes that will be used for horizontal and vertical discrete annotations. The discrete classification of annotations depends on the column type of your input tibble (e.g., character and factor). |
palette_continuous |
A list of character vectors. This is the list of palettes that will be used for horizontal and vertical continuous annotations. The continuous classification of annotations depends on the column type of your input tibble (e.g., integer, numerical, double). |
size |
A grid::unit object, e.g. unit(2, "cm"). This is the height or width of the annotation depending on the orientation. |
... |
The arguments that will be passed to top_annotation or left_annotation of the ComplexHeatmap container |
To be added.
A 'ComplexHeatmap' object
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
Add attribute to abject
add_attr(var, attribute, name)add_attr(var, attribute, name)
var |
A tibble |
attribute |
An object |
name |
A character name of the attribute |
A tibble with an additional attribute
Add class to abject
add_class(var, name)add_class(var, name)
var |
A tibble |
name |
A character name of the attribute |
A tibble with an additional attribute
annot_to_list
annot_to_list(.data)annot_to_list(.data)
.data |
A data frame |
A list
annotation_bar() from a 'InputHeatmap' object, adds a bar annotation layer.
annotation_bar(.data, .column, palette = NULL, size = NULL, ...) ## S4 method for signature 'InputHeatmap' annotation_bar(.data, .column, palette = NULL, size = NULL, ...)annotation_bar(.data, .column, palette = NULL, size = NULL, ...) ## S4 method for signature 'InputHeatmap' annotation_bar(.data, .column, palette = NULL, size = NULL, ...)
.data |
a 'InputHeatmap' object created calling 'tidyHeatmap::heatmap()' |
.column |
Vector of quotes |
palette |
A character vector of colors, or a function such as colorRamp2 (see examples). |
size |
A grid::unit object, e.g. unit(2, "cm"). This is the height or width of the annotation depending on the orientation. |
... |
The arguments that will be passed to
|
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> annotation_bar(inflection)hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> annotation_bar(inflection)
'annotation_group()' adds group annotation strips to a tidyHeatmap object, allowing you to visually group rows or columns based on categorical variables. This is useful for highlighting biological or experimental groups in your heatmap.
annotation_group(.data, ...) ## S4 method for signature 'InputHeatmap' annotation_group( .data, ..., palette_grouping = list(), group_label_fontsize = 8, show_group_name = TRUE, group_strip_height = grid::unit(9, "pt") )annotation_group(.data, ...) ## S4 method for signature 'InputHeatmap' annotation_group( .data, ..., palette_grouping = list(), group_label_fontsize = 8, show_group_name = TRUE, group_strip_height = grid::unit(9, "pt") )
.data |
A tidyHeatmap object |
... |
Grouping columns (unquoted, like dplyr::group_by) |
palette_grouping |
List of color vectors for each grouping. Each element should be a vector of colors for the corresponding grouping variable. |
group_label_fontsize |
Font size for group labels |
show_group_name |
Logical, show the group annotation name |
group_strip_height |
Height of group strip as a grid unit (default: 9pt) |
A tidyHeatmap object with group annotation strips added
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
# Basic usage with row grouping tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) |> annotation_group(CAPRA_TOTAL) # With custom colors and formatting tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) |> annotation_group( CAPRA_TOTAL, palette_grouping = list(c("#E64B35", "#4DBBD5")), group_label_fontsize = 10, show_group_name = FALSE ) # Multiple grouping variables tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) |> annotation_group( CAPRA_TOTAL, `Cell type`, palette_grouping = list( c("#E64B35", "#4DBBD5"), # colors for CAPRA_TOTAL c("#00A087", "#F39B7F") # colors for Cell type ) )# Basic usage with row grouping tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) |> annotation_group(CAPRA_TOTAL) # With custom colors and formatting tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) |> annotation_group( CAPRA_TOTAL, palette_grouping = list(c("#E64B35", "#4DBBD5")), group_label_fontsize = 10, show_group_name = FALSE ) # Multiple grouping variables tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) |> annotation_group( CAPRA_TOTAL, `Cell type`, palette_grouping = list( c("#E64B35", "#4DBBD5"), # colors for CAPRA_TOTAL c("#00A087", "#F39B7F") # colors for Cell type ) )
annotation_line() from a 'InputHeatmap' object, adds a line annotation layer.
annotation_line(.data, .column, palette = NULL, size = NULL, ...) ## S4 method for signature 'InputHeatmap' annotation_line(.data, .column, palette = NULL, size = NULL, ...)annotation_line(.data, .column, palette = NULL, size = NULL, ...) ## S4 method for signature 'InputHeatmap' annotation_line(.data, .column, palette = NULL, size = NULL, ...)
.data |
a 'InputHeatmap' object created calling 'tidyHeatmap::heatmap()' |
.column |
Vector of quotes |
palette |
A character vector of colors, or a function such as colorRamp2 (see examples). |
size |
A grid::unit object, e.g. unit(2, "cm"). This is the height or width of the annotation depending on the orientation. |
... |
The arguments that will be passed to
|
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> annotation_line(inflection)hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> annotation_line(inflection)
'annotation_numeric()' from an 'InputHeatmap' object adds a numeric annotation layer.
annotation_numeric( .data, .column, palette = NULL, size = NULL, labels_format = function(x) sprintf("%.1f", x), ... ) ## S4 method for signature 'InputHeatmap' annotation_numeric( .data, .column, palette = NULL, size = NULL, labels_format = function(x) sprintf("%.1f", x), ... )annotation_numeric( .data, .column, palette = NULL, size = NULL, labels_format = function(x) sprintf("%.1f", x), ... ) ## S4 method for signature 'InputHeatmap' annotation_numeric( .data, .column, palette = NULL, size = NULL, labels_format = function(x) sprintf("%.1f", x), ... )
.data |
A 'tbl_df' formatted as | <ELEMENT> | <FEATURE> | <VALUE> | <...> | |
.column |
Vector of quotes |
palette |
A character vector of colours, or a function such as colorRamp2 (see examples). |
size |
A grid::unit object, e.g. unit(2, "cm"). This is the height or width of the annotation depending on the orientation. |
labels_format |
A function to format the numeric labels. By default, it formats numbers to two decimal places using 'sprintf(" supply any function that takes a numeric vector and returns a character vector for customised formatting. |
... |
The arguments that will be passed to
|
It uses 'ComplexHeatmap' as the visualisation tool.
An 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'.
An 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'.
[Mangiola and Papenfuss, 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> annotation_numeric(inflection) # Align to the right hm |> annotation_numeric(inflection, align_to = "right")hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> annotation_numeric(inflection) # Align to the right hm |> annotation_numeric(inflection, align_to = "right")
annotation_point() from a 'InputHeatmap' object, adds a point annotation layer.
annotation_point(.data, .column, palette = NULL, size = NULL, ...) ## S4 method for signature 'InputHeatmap' annotation_point(.data, .column, palette = NULL, size = NULL, ...)annotation_point(.data, .column, palette = NULL, size = NULL, ...) ## S4 method for signature 'InputHeatmap' annotation_point(.data, .column, palette = NULL, size = NULL, ...)
.data |
a 'InputHeatmap' object created calling 'tidyHeatmap::heatmap()' |
.column |
Vector of quotes |
palette |
A character vector of colors, or a function such as colorRamp2 (see examples). |
size |
A grid::unit object, e.g. unit(2, "cm"). This is the height or width of the annotation depending on the orientation. |
... |
The arguments that will be passed to
|
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> annotation_point(inflection)hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> annotation_point(inflection)
annotation_tile() from a 'InputHeatmap' object, adds a tile annotation layer.
annotation_tile(.data, .column, palette = NULL, size = NULL, ...) ## S4 method for signature 'InputHeatmap' annotation_tile(.data, .column, palette = NULL, size = NULL, ...)annotation_tile(.data, .column, palette = NULL, size = NULL, ...) ## S4 method for signature 'InputHeatmap' annotation_tile(.data, .column, palette = NULL, size = NULL, ...)
.data |
a 'InputHeatmap' object created calling 'tidyHeatmap::heatmap()' |
.column |
Vector of quotes |
palette |
A character vector of colors, or a function such as colorRamp2 (see examples). |
size |
A grid::unit object, e.g. unit(2, "cm"). This is the height or width of the annotation depending on the orientation. |
... |
The arguments that will be passed to
|
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> annotation_tile(CAPRA_TOTAL) hm |> annotation_tile( inflection, palette = circlize::colorRamp2(c(0, 3,10), c("white", "green", "red")) )hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> annotation_tile(CAPRA_TOTAL) hm |> annotation_tile( inflection, palette = circlize::colorRamp2(c(0, 3,10), c("white", "green", "red")) )
as_ComplexHeatmap() takes a 'InputHeatmap' object and produces a 'Heatmap' object
as_ComplexHeatmap(tidyHeatmap) ## S4 method for signature 'InputHeatmap' as_ComplexHeatmap(tidyHeatmap)as_ComplexHeatmap(tidyHeatmap) ## S4 method for signature 'InputHeatmap' as_ComplexHeatmap(tidyHeatmap)
tidyHeatmap |
A 'InputHeatmap' object from tidyHeatmap::heatmap() call |
A 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log`, ) |> as_ComplexHeatmap()tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log`, ) |> as_ComplexHeatmap()
Get matrix from tibble
as_matrix(tbl, rownames = NULL, do_check = TRUE)as_matrix(tbl, rownames = NULL, do_check = TRUE)
tbl |
A tibble |
rownames |
A character string of the rownames |
do_check |
A boolean |
A matrix
Check whether there are duplicated genes/transcripts
check_if_duplicated_genes(.data, .sample, .transcript, .abundance)check_if_duplicated_genes(.data, .sample, .transcript, .abundance)
.data |
A tibble of read counts |
.sample |
A character name of the sample column |
.transcript |
A character name of the transcript/gene column |
.abundance |
A character name of the read count column |
A tbl
Check whether there are NA counts
check_if_wrong_input(.data, list_input, expected_type)check_if_wrong_input(.data, list_input, expected_type)
.data |
A tibble of read counts |
list_input |
A list |
expected_type |
A character string |
A tbl
Remove class to abject
drop_class(var, name)drop_class(var, name)
var |
A tibble |
name |
A character name of the class |
A tibble with an additional attribute
Check whether a numeric vector has been log transformed
error_if_log_transformed(x, .abundance)error_if_log_transformed(x, .abundance)
x |
A numeric vector |
.abundance |
A character name of the transcript/gene abundance column |
NA
Get column names either from user or from attributes
get_abundance_norm_if_exists(.data, .abundance)get_abundance_norm_if_exists(.data, .abundance)
.data |
A tibble |
.abundance |
A character name of the abundance column |
A list of column enquo or error
Get column names either from user or from attributes
get_elements(.data, .element, of_samples = TRUE)get_elements(.data, .element, of_samples = TRUE)
.data |
A tibble |
.element |
A character name of the sample column |
of_samples |
A boolean |
A list of column enquo or error
Get column names either from user or from attributes
get_elements_features(.data, .element, .feature, of_samples = TRUE)get_elements_features(.data, .element, .feature, of_samples = TRUE)
.data |
A tibble |
.element |
A character name of the sample column |
.feature |
A character name of the transcript/gene column |
of_samples |
A boolean |
A list of column enquo or error
Get column names either from user or from attributes
get_elements_features_abundance( .data, .element, .feature, .abundance, of_samples = TRUE )get_elements_features_abundance( .data, .element, .feature, .abundance, of_samples = TRUE )
.data |
A tibble |
.element |
A character name of the sample column |
.feature |
A character name of the transcript/gene column |
.abundance |
A character name of the read count column |
of_samples |
A boolean |
A list of column enquo or error
get_heatmap_data() extracts the heatmap matrix as it appears in the plot along with the row and column dendrograms, all with consistent naming.
get_heatmap_data(.data) ## S4 method for signature 'InputHeatmap' get_heatmap_data(.data)get_heatmap_data(.data) ## S4 method for signature 'InputHeatmap' get_heatmap_data(.data)
.data |
A 'InputHeatmap' object from tidyHeatmap::heatmap() |
This function converts the InputHeatmap to ComplexHeatmap, draws it to perform clustering, then extracts the ordered matrix and dendrograms exactly as they appear in the heatmap plot.
A list containing:
matrix: The abundance matrix with rows and columns ordered as in the heatmap
row_dend: The row dendrogram object
column_dend: The column dendrogram object
A list containing the ordered matrix, row dendrogram, and column dendrogram
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm <- tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) |> annotation_group( CAPRA_TOTAL, palette_grouping = list(c("#E64B35", "#4DBBD5")), group_label_fontsize = 10, show_group_name = FALSE ) # Multiple grouping variables tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) |> annotation_group( CAPRA_TOTAL, `Cell type`, palette_grouping = list( c("#E64B35", "#4DBBD5"), # colors for CAPRA_TOTAL c("#00A087", "#F39B7F") # colors for Cell type ) ) # Get heatmap data as plotted result <- hm |> get_heatmap_data() ordered_matrix <- result$matrix row_dendrogram <- result$row_dend column_dendrogram <- result$column_dendhm <- tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) |> annotation_group( CAPRA_TOTAL, palette_grouping = list(c("#E64B35", "#4DBBD5")), group_label_fontsize = 10, show_group_name = FALSE ) # Multiple grouping variables tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) |> annotation_group( CAPRA_TOTAL, `Cell type`, palette_grouping = list( c("#E64B35", "#4DBBD5"), # colors for CAPRA_TOTAL c("#00A087", "#F39B7F") # colors for Cell type ) ) # Get heatmap data as plotted result <- hm |> get_heatmap_data() ordered_matrix <- result$matrix row_dendrogram <- result$row_dend column_dendrogram <- result$column_dend
Get column names either from user or from attributes
get_sample_counts(.data, .sample, .abundance)get_sample_counts(.data, .sample, .abundance)
.data |
A tibble |
.sample |
A character name of the sample column |
.abundance |
A character name of the read count column |
A list of column enquo or error
Get column names either from user or from attributes
get_sample_transcript(.data, .sample, .transcript)get_sample_transcript(.data, .sample, .transcript)
.data |
A tibble |
.sample |
A character name of the sample column |
.transcript |
A character name of the transcript/gene column |
A list of column enquo or error
Get column names either from user or from attributes
get_sample_transcript_counts(.data, .sample, .transcript, .abundance)get_sample_transcript_counts(.data, .sample, .transcript, .abundance)
.data |
A tibble |
.sample |
A character name of the sample column |
.transcript |
A character name of the transcript/gene column |
.abundance |
A character name of the read count column |
A list of column enquo or error
get_x_y_annotation_columns
get_x_y_annotation_columns(.data, .column, .row, .abundance)get_x_y_annotation_columns(.data, .column, .row, .abundance)
.data |
A 'tbl' formatted as | <SAMPLE> | <TRANSCRIPT> | <COUNT> | <...> | |
.column |
The name of the column horizontally presented in the heatmap |
.row |
The name of the column vertically presented in the heatmap |
.abundance |
The name of the transcript/gene abundance column |
A list
heatmap() takes a tbl object and easily produces a ComplexHeatmap plot, with integration with tibble and dplyr frameworks.
heatmap( .data, .row, .column, .value, transform = NULL, scale = "none", palette_value = c("#440154FF", "#21908CFF", "#fefada"), palette_grouping = list(), .scale = NULL, ... ) heatmap_( .data, .row, .column, .value, transform = NULL, scale = "none", palette_value = c("#440154FF", "#21908CFF", "#fefada"), palette_grouping = list(), .scale = NULL, ... ) ## S4 method for signature 'tbl' heatmap( .data, .row, .column, .value, transform = NULL, scale = "none", palette_value = c("#440154FF", "#21908CFF", "#fefada"), palette_grouping = list(), .scale = NULL, ... ) ## S4 method for signature 'tbl_df' heatmap( .data, .row, .column, .value, transform = NULL, scale = "none", palette_value = c("#440154FF", "#21908CFF", "#fefada"), palette_grouping = list(), .scale = NULL, ... )heatmap( .data, .row, .column, .value, transform = NULL, scale = "none", palette_value = c("#440154FF", "#21908CFF", "#fefada"), palette_grouping = list(), .scale = NULL, ... ) heatmap_( .data, .row, .column, .value, transform = NULL, scale = "none", palette_value = c("#440154FF", "#21908CFF", "#fefada"), palette_grouping = list(), .scale = NULL, ... ) ## S4 method for signature 'tbl' heatmap( .data, .row, .column, .value, transform = NULL, scale = "none", palette_value = c("#440154FF", "#21908CFF", "#fefada"), palette_grouping = list(), .scale = NULL, ... ) ## S4 method for signature 'tbl_df' heatmap( .data, .row, .column, .value, transform = NULL, scale = "none", palette_value = c("#440154FF", "#21908CFF", "#fefada"), palette_grouping = list(), .scale = NULL, ... )
.data |
A 'tbl_df' formatted as | <ELEMENT> | <FEATURE> | <VALUE> | <...> | |
.row |
The name of the column to use as rows |
.column |
The name of the column to use as columns |
.value |
The name of the column to use as values |
transform |
A function to transform the data (optional) |
scale |
One of "none", "row", "column", or "both" for scaling |
palette_value |
A character vector of colors or a function for value colors |
palette_grouping |
A list of color palettes for grouping annotations |
.scale |
DEPRECATED: Use scale instead |
... |
Additional arguments passed to ComplexHeatmap |
This function takes a tbl as an input and creates a 'ComplexHeatmap' plot. The information is stored in a 'InputHeatmap' object that is updated along the pipe statement, for example adding annotation layers.
An 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object
A 'InputHeatmap' object
A 'InputHeatmap' object
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
tidyHeatmap::N52 |> dplyr::group_by( `Cell type`) |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log`, )tidyHeatmap::N52 |> dplyr::group_by( `Cell type`) |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log`, )
This is a generalisation of ifelse that accepts an object and return an objects
ifelse_pipe(.x, .p, .f1, .f2 = NULL)ifelse_pipe(.x, .p, .f1, .f2 = NULL)
.x |
A tibble |
.p |
A boolean |
.f1 |
A function |
.f2 |
A function |
A tibble
This is a generalisation of ifelse that accepts an object and return an objects
ifelse2_pipe(.x, .p1, .p2, .f1, .f2, .f3 = NULL)ifelse2_pipe(.x, .p1, .p2, .f1, .f2, .f3 = NULL)
.x |
A tibble |
.p1 |
A boolean |
.p2 |
ELSE IF condition |
.f1 |
A function |
.f2 |
A function |
.f3 |
A function |
A tibble
input_heatmap() takes a tbl object and easily produces a ComplexHeatmap plot, with integration with tibble and dplyr frameworks.
input_heatmap( .data, .horizontal, .vertical, .abundance, transform = NULL, scale = "none", palette_value = c("#440154FF", "#21908CFF", "#fefada"), palette_grouping = list(), ... )input_heatmap( .data, .horizontal, .vertical, .abundance, transform = NULL, scale = "none", palette_value = c("#440154FF", "#21908CFF", "#fefada"), palette_grouping = list(), ... )
.data |
A 'tbl' formatted as | <SAMPLE> | <TRANSCRIPT> | <COUNT> | <...> | |
.horizontal |
The name of the column horizontally presented in the heatmap |
.vertical |
The name of the column vertically presented in the heatmap |
.abundance |
The name of the transcript/gene abundance column |
transform |
A function, used to transform .value, for example log1p |
scale |
A character string. Possible values are c(\"none\", \"row\", \"column\", \"both\") |
palette_value |
A character vector, or a function for higher customisation (colorRamp2). This is the palette that will be used as gradient for abundance. If palette_value is a vector of hexadecimal colours, it should have 3 values. If you want more customisation, you can pass to palette_value a function, that is derived as for example 'colorRamp2(c(-2, 0, 2), palette_value)' |
palette_grouping |
A list of character vectors. This is the list of palettes that will be used for grouping |
... |
Further arguments to be passed to ComplexHeatmap::Heatmap |
To be added.
A 'ComplexHeatmap' object
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
layer_arrow_down() from a 'InputHeatmap' object, adds a bar annotation layer.
layer_arrow_down(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_arrow_down(.data, ..., .size = NULL)layer_arrow_down(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_arrow_down(.data, ..., .size = NULL)
.data |
A 'InputHeatmap' |
... |
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. |
.size |
A column name or a double. The size of the elements of the layer. |
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_arrow_down()hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_arrow_down()
layer_arrow_up() from a 'InputHeatmap' object, adds a bar annotation layer.
layer_arrow_up(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_arrow_up(.data, ..., .size = NULL)layer_arrow_up(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_arrow_up(.data, ..., .size = NULL)
.data |
A 'InputHeatmap' |
... |
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. |
.size |
A column name or a double. The size of the elements of the layer. |
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_arrow_up()hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_arrow_up()
layer_asterisk() from a 'InputHeatmap' object, adds a symbol annotation layer over the heatmap tiles.
layer_asterisk(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_asterisk(.data, ..., .size = NULL)layer_asterisk(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_asterisk(.data, ..., .size = NULL)
.data |
A 'InputHeatmap' |
... |
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. |
.size |
A column name or a double. The size of the elements of the layer. |
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_asterisk()hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_asterisk()
layer_diamond() from a 'InputHeatmap' object, adds a bar annotation layer.
layer_diamond(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_diamond(.data, ..., .size = NULL)layer_diamond(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_diamond(.data, ..., .size = NULL)
.data |
A 'InputHeatmap' |
... |
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. |
.size |
A column name or a double. The size of the elements of the layer. |
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_diamond()hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_diamond()
layer_point() from a 'InputHeatmap' object, adds a bar annotation layer.
layer_point(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_point(.data, ..., .size = NULL)layer_point(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_point(.data, ..., .size = NULL)
.data |
A 'InputHeatmap' |
... |
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. |
.size |
A column name or a double. The size of the elements of the layer. |
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_point()hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_point()
layer_square() from a 'InputHeatmap' object, adds a bar annotation layer.
layer_square(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_square(.data, ..., .size = NULL)layer_square(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_square(.data, ..., .size = NULL)
.data |
A 'InputHeatmap' |
... |
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. |
.size |
A column name or a double. The size of the elements of the layer. |
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_square()hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_square()
layer_star() from a 'InputHeatmap' object, adds a symbol annotation layer over the heatmap tiles.
layer_star(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_star(.data, ..., .size = NULL)layer_star(.data, ..., .size = NULL) ## S4 method for signature 'InputHeatmap' layer_star(.data, ..., .size = NULL)
.data |
A 'InputHeatmap' |
... |
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. |
.size |
A column name or a double. The size of the elements of the layer. |
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_star()hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_star()
layer_text() from a 'InputHeatmap' object, adds a text annotation layer.
layer_text(.data, ..., .value, .size = NULL, .color = NULL) ## S4 method for signature 'InputHeatmap' layer_text(.data, ..., .value, .size = NULL, .color = NULL)layer_text(.data, ..., .value, .size = NULL, .color = NULL) ## S4 method for signature 'InputHeatmap' layer_text(.data, ..., .value, .size = NULL, .color = NULL)
.data |
A 'InputHeatmap' |
... |
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. |
.value |
A column name or character string. |
.size |
A column name or a double. The size of the elements of the layer. |
.color |
A column name or character string. The color of the elements of the layer. |
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
library(dplyr) hm = tidyHeatmap::N52 |> mutate(my_text = "t") |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_text(.value = "a") hm |> layer_text(.value = my_text)library(dplyr) hm = tidyHeatmap::N52 |> mutate(my_text = "t") |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> layer_text(.value = "a") hm |> layer_text(.value = my_text)
Example data set N52
N52N52
An object of class tbl_df (inherits from tbl, data.frame) with 520 rows and 15 columns.
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
.formula parser
parse_formula(fm)parse_formula(fm)
fm |
a formula |
A character vector
Example data set Pasilla
pasillapasilla
An object of class tbl_df (inherits from tbl, data.frame) with 504 rows and 8 columns.
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
From rlang deprecated
prepend(x, values, before = 1)prepend(x, values, before = 1)
x |
An array |
values |
An array |
before |
A boolean |
An array
Convert array of quosure (e.g. c(col_a, col_b)) into character vector
quo_names(v)quo_names(v)
v |
A array of quosures (e.g. c(col_a, col_b)) |
A character vector
save_pdf() takes as input a Heatmap from ComplexHeatmap and save it to PDF file
save_pdf( .heatmap, filename, width = NULL, height = NULL, units = c("in", "cm", "mm") )save_pdf( .heatmap, filename, width = NULL, height = NULL, units = c("in", "cm", "mm") )
.heatmap |
A 'Heatmap' |
filename |
A character string. The name of the output file/path |
width |
A 'double'. Plot width |
height |
A 'double'. Plot height |
units |
A character string. units ("in", "cm", or "mm") |
It simply save an 'Heatmap' to a PDF file use pdf() function in the back end
NA
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
tidyHeatmap::heatmap( dplyr::group_by(tidyHeatmap::pasilla, location, type), .column = sample, .row = symbol, .value = `count normalised adjusted`, ) |> save_pdf(tempfile())tidyHeatmap::heatmap( dplyr::group_by(tidyHeatmap::pasilla, location, type), .column = sample, .row = symbol, .value = `count normalised adjusted`, ) |> save_pdf(tempfile())
save_pdf
## S4 method for signature 'Heatmap' save_pdf( .heatmap, filename, width = NULL, height = NULL, units = c("in", "cm", "mm") )## S4 method for signature 'Heatmap' save_pdf( .heatmap, filename, width = NULL, height = NULL, units = c("in", "cm", "mm") )
.heatmap |
A 'Heatmap' |
filename |
A character string. The name of the output file/path |
width |
A 'double'. Plot width |
height |
A 'double'. Plot height |
units |
A character string. units ("in", "cm", or "mm") |
save_pdf
## S4 method for signature 'InputHeatmap' save_pdf( .heatmap, filename, width = NULL, height = NULL, units = c("in", "cm", "mm") )## S4 method for signature 'InputHeatmap' save_pdf( .heatmap, filename, width = NULL, height = NULL, units = c("in", "cm", "mm") )
.heatmap |
A 'Heatmap' |
filename |
A character string. The name of the output file/path |
width |
A 'double'. Plot width |
height |
A 'double'. Plot height |
units |
A character string. units ("in", "cm", or "mm") |
Scale counts in a robust way against sd == 0
scale_robust(y)scale_robust(y)
y |
A numerical array |
A scaled and centred numerical array
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
Sub function of remove_redundancy_elements_though_reduced_dimensions
select_closest_pairs(df)select_closest_pairs(df)
df |
A tibble |
A tibble with pairs to drop
split_rows() from a 'InputHeatmap' object, split the row cladogram.
split_columns() from a 'InputHeatmap' object, split the column cladogram.
split_rows(.data, number_of_groups) ## S4 method for signature 'InputHeatmap' split_rows(.data, number_of_groups) split_columns(.data, number_of_groups) ## S4 method for signature 'InputHeatmap' split_columns(.data, number_of_groups)split_rows(.data, number_of_groups) ## S4 method for signature 'InputHeatmap' split_rows(.data, number_of_groups) split_columns(.data, number_of_groups) ## S4 method for signature 'InputHeatmap' split_columns(.data, number_of_groups)
.data |
A 'InputHeatmap' |
number_of_groups |
An integer. The number of groups to split the cladogram into. |
It uses 'ComplexHeatmap' as visualisation tool.
It uses 'ComplexHeatmap' as visualisation tool.
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
A 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> split_rows(2) hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> split_columns(2)hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> split_rows(2) hm = tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log` ) hm |> split_columns(2)
In order to add tidyHeatmap (ComplexHeatmap) element to a patchwork they can be converted to a compliant representation using the 'wrap_heatmap()' function. This allows you to position either grobs, ggplot objects, patchwork objects, or even base graphics (if passed as a formula) in either the full area, the full plotting area (anything between and including the axis label), or the panel area (only the actual area where data is drawn).
wrap_heatmap( panel = NULL, plot = NULL, full = NULL, clip = TRUE, ignore_tag = FALSE, padding = NULL ) ## S4 method for signature 'InputHeatmap' wrap_heatmap( panel = NULL, plot = NULL, full = NULL, clip = TRUE, ignore_tag = FALSE, padding = NULL )wrap_heatmap( panel = NULL, plot = NULL, full = NULL, clip = TRUE, ignore_tag = FALSE, padding = NULL ) ## S4 method for signature 'InputHeatmap' wrap_heatmap( panel = NULL, plot = NULL, full = NULL, clip = TRUE, ignore_tag = FALSE, padding = NULL )
panel, plot, full
|
A grob, ggplot, patchwork, formula, raster, or nativeRaster object to add to the respective area. |
clip |
Should the grobs be clipped if expanding outside its area |
ignore_tag |
Should tags be ignored for this patch. This is relevant when using automatic tagging of plots and the content of the patch does not qualify for a tag. |
padding |
A grid::unit object. It defined the padding distance for the plot. It is helpful when the heatmap is assembled with other ggplots through patchwork. |
A wrapped_patch object
A wrapped_patch object
[Mangiola and Papenfuss., 2020](https://joss.theoj.org/papers/10.21105/joss.02472)
Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.
tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log`, ) |> wrap_heatmap()tidyHeatmap::N52 |> tidyHeatmap::heatmap( .row = symbol_ct, .column = UBR, .value = `read count normalised log`, ) |> wrap_heatmap()