| HeatmapAtomic | R Documentation |
Atomic heatmap without split
HeatmapAtomic(
data,
values_by,
values_fill = NA,
rows_by = NULL,
rows_split_by = NULL,
columns_by = NULL,
columns_split_by = NULL,
palette = "RdBu",
palcolor = NULL,
pie_size_name = "size",
pie_size = NULL,
pie_values = "length",
pie_group_by = NULL,
pie_palette = "Spectral",
pie_palcolor = NULL,
bars_sample = 100,
label = scales::label_number_auto(),
label_size = 10,
label_color = "black",
label_name = "label",
mark = identity,
mark_color = "black",
mark_size = 1,
mark_name = "mark",
violin_fill = NULL,
boxplot_fill = NULL,
dot_size = 8,
dot_size_name = "size",
legend_items = NULL,
legend_discrete = FALSE,
legend.position = "right",
legend.direction = "vertical",
lower_quantile = 0,
upper_quantile = 0.99,
lower_cutoff = NULL,
upper_cutoff = NULL,
add_bg = FALSE,
bg_alpha = 0.5,
keep_na = FALSE,
keep_empty = FALSE,
add_reticle = FALSE,
reticle_color = "grey",
cluster_columns = TRUE,
cluster_rows = TRUE,
show_row_names = NULL,
show_column_names = NULL,
border = TRUE,
title = NULL,
column_title = character(0),
row_title = character(0),
na_col = "grey85",
row_names_side = "right",
column_names_side = "bottom",
column_annotation = NULL,
column_annotation_side = "top",
column_annotation_palette = "Paired",
column_annotation_palcolor = NULL,
column_annotation_type = "auto",
column_annotation_params = list(),
column_annotation_agg = NULL,
row_annotation = NULL,
row_annotation_side = "left",
row_annotation_palette = "Paired",
row_annotation_palcolor = NULL,
row_annotation_type = "auto",
row_annotation_params = list(),
row_annotation_agg = NULL,
flip = FALSE,
alpha = 1,
seed = 8525,
return_grob = FALSE,
padding = 15,
base_size = 1,
aspect.ratio = NULL,
draw_opts = list(),
layer_fun_callback = NULL,
cell_type = "tile",
cell_agg = NULL,
...
)
data |
A data frame used to create the heatmap. The data should be in a long form where each row represents a instance in the heatmap. |
values_by |
A character of column name in |
values_fill |
A value to fill in the missing values in the heatmap. When there is missing value in the data, the cluster_rows and cluster_columns will fail. |
rows_by |
A vector of column names in |
rows_split_by |
A character of column name in |
columns_by |
A vector of column names in |
columns_split_by |
A character of column name in |
palette |
A character string specifying the palette of the heatmap cells. |
palcolor |
A character vector of colors to override the palette of the heatmap cells. |
pie_size_name |
A character string specifying the name of the legend for the pie size. |
pie_size |
A numeric value or a function specifying the size of the pie chart.
If it is a function, the function should take |
pie_values |
A function or character that can be converted to a function by |
pie_group_by |
A character of column name in |
pie_palette |
A character string specifying the palette of the pie chart. |
pie_palcolor |
A character vector of colors to override the palette of the pie chart. |
bars_sample |
An integer specifying the number of samples to draw the bars. |
label |
A function to calculate the labels for the heatmap cells. It can take either 1, 3, or 5 arguments. The first argument is the aggregated value for a single cell. If it takes 3 arguments, the second and third arguments are the row and column indices of that cell. If it takes 5 arguments, the second and third arguments are the row and column indices, and the fourth and fifth arguments are the row and column names. The function should return one of:
|
label_size |
A numeric value specifying the default size (pt) of the labels when |
label_color |
A character string specifying the default color of the labels when |
label_name |
A character string specifying the title of the label legend. Default is |
mark |
A function to calculate the marks drawn on top of heatmap cells when
[]: R:%5C [x]: R:x [o]: R:o [()]: R:() [<>]: R:%3C%3E [(|)]: R:(%7C) [(-)]: R:(-) [(+)]: R:(+) [(/)]: R:(/) [(\)]: R:(%5C%5C) [(x)]: R:(x) [(o)]: R:(o) [(<>)]: R:(%3C%3E) |
mark_color |
A character string specifying the default color of the marks when |
mark_size |
A numeric value specifying the default stroke width (lwd) of the marks when |
mark_name |
A character string specifying the title of the mark legend. Default is |
violin_fill |
A character vector of colors to override the fill color of the violin plot. If NULL, the fill color will be the same as the annotion. |
boxplot_fill |
A character vector of colors to override the fill color of the boxplot. If NULL, the fill color will be the same as the annotion. |
dot_size |
A numeric value specifying the size of the dot or a function to calculate the size from the values in the cell or a function to calculate the size from the values in the cell. |
dot_size_name |
A character string specifying the name of the legend for the dot size. If NULL, the dot size legend will not be shown. |
legend_items |
A numeric vector with names to specifiy the items in the main legend. The names will be working as the labels of the legend items. |
legend_discrete |
A logical value indicating whether the main legend is discrete. |
legend.position |
A character string specifying the position of the legend.
if |
legend.direction |
A character string specifying the direction of the legend. |
lower_quantile, upper_quantile, lower_cutoff, upper_cutoff |
Vector of minimum and maximum cutoff values or quantile values for each feature. It's applied to aggregated values when aggregated values are used (e.g. plot_type tile, label, etc). It's applied to raw values when raw values are used (e.g. plot_type bars, etc). |
add_bg |
A logical value indicating whether to add a background to the heatmap.
Does not work with |
bg_alpha |
A numeric value between 0 and 1 specifying the transparency of the background. |
keep_na |
Whether we should keep NA groups in rows, columns and split_by variables. Default is FALSE. FALSE to remove NA groups; TRUE to keep NA groups. A vector of column names can also be provided to specify which columns to keep NA groups. Note that the record will be removed if any of the grouping columns has NA and is not specified to keep NA. |
keep_empty |
One of FALSE, TRUE and "level". It can also take a named list to specify
different behavior for different columns. Without a named list, the behavior applies to the
categorical/character columns used on the plot, for example, the
|
add_reticle |
A logical value indicating whether to add a reticle to the heatmap. |
reticle_color |
A character string specifying the color of the reticle. |
cluster_columns |
A logical value indicating whether to cluster the columns. If TRUE and columns_split_by is provided, the clustering will only be applied to the columns within the same split. |
cluster_rows |
A logical value indicating whether to cluster the rows. If TRUE and rows_split_by is provided, the clustering will only be applied to the rows within the same split. |
show_row_names |
A logical value indicating whether to show the row names. If TRUE, the legend of the row group annotation will be hidden. |
show_column_names |
A logical value indicating whether to show the column names. If TRUE, the legend of the column group annotation will be hidden. |
border |
A logical value indicating whether to draw the border of the heatmap. If TRUE, the borders of the slices will be also drawn. |
title |
The global (column) title of the heatmap |
column_title |
A character string/vector of the column name(s) to use as the title of the column group annotation. |
row_title |
A character string/vector of the column name(s) to use as the title of the row group annotation. |
na_col |
A character string specifying the color for missing values. The default is "grey85". |
row_names_side |
A character string specifying the side of the row names. The default is "right". |
column_names_side |
A character string specifying the side of the column names. The default is "bottom". |
column_annotation |
A character string/vector of the column name(s) to use as the column annotation. Or a list with the keys as the names of the annotation and the values as the column names. |
column_annotation_side |
A character string specifying the side of the column annotation. Could be a list with the keys as the names of the annotation and the values as the sides. |
column_annotation_palette |
A character string specifying the palette of the column annotation. The default is "Paired". Could be a list with the keys as the names of the annotation and the values as the palettes. |
column_annotation_palcolor |
A character vector of colors to override the palette of the column annotation. Could be a list with the keys as the names of the annotation and the values as the palcolors. |
column_annotation_type |
A character string specifying the type of the column annotation. The default is "auto". Other options are "simple", "pie", "ring", "bar", "violin", "boxplot", "density". Could be a list with the keys as the names of the annotation and the values as the types. If the type is "auto", the type will be determined by the type and number of the column data. |
column_annotation_params |
A list of parameters passed to the annotation function.
Could be a list with the keys as the names of the annotation and the values as the parameters.
For the name/split annotations, use aliases: |
column_annotation_agg |
A function to aggregate the values in the column annotation. |
row_annotation |
A character string/vector of the column name(s) to use as the row annotation. Or a list with the keys as the names of the annotation and the values as the column names. |
row_annotation_side |
A character string specifying the side of the row annotation. Could be a list with the keys as the names of the annotation and the values as the sides. |
row_annotation_palette |
A character string specifying the palette of the row annotation. The default is "Paired". Could be a list with the keys as the names of the annotation and the values as the palettes. |
row_annotation_palcolor |
A character vector of colors to override the palette of the row annotation. Could be a list with the keys as the names of the annotation and the values as the palcolors. |
row_annotation_type |
A character string specifying the type of the row annotation. The default is "auto". Other options are "simple", "pie", "ring", "bar", "violin", "boxplot", "density". Could be a list with the keys as the names of the annotation and the values as the types. If the type is "auto", the type will be determined by the type and number of the row data. |
row_annotation_params |
A list of parameters passed to the annotation function.
Could be a list with the keys as the names of the annotation and the values as the parameters.
For the name/split annotations, use aliases: |
row_annotation_agg |
A function to aggregate the values in the row annotation. |
flip |
A logical value indicating whether to flip the heatmap.
The idea is that, you can simply set |
alpha |
A numeric value between 0 and 1 specifying the transparency of the heatmap cells. |
seed |
The random seed to use. Default is 8525. |
return_grob |
A logical value indicating whether to return the grob object of the heatmap. This is useful when merging multiple heatmaps using patchwork. |
padding |
A numeric vector of length 4 specifying the padding of the heatmap in the order of top, right, bottom, left.
Like padding in css. Note that it is different than the |
base_size |
A positive numeric scalar used as a scaling factor for the overall heatmap size.
Default is |
aspect.ratio |
A positive numeric scalar giving the height-to-width ratio of a single heatmap
cell. When
|
draw_opts |
A named list of additional arguments passed to |
layer_fun_callback |
A function to add additional layers to the heatmap.
The function should have the following arguments: |
cell_type |
A character string specifying the type of the heatmap cells.
The default is "tile" Other options are "bars", "label", "mark", "label+mark" (or equivalently "mark+label"),
"dot", "violin", "boxplot" and "pie".
Use "label+mark" to render both marks (drawn first, as background) and text labels (drawn on top)
in each cell simultaneously, combining all |
cell_agg |
A function to aggregate the values in the cell, for the cell type "tile" and "label".
The default is |
... |
Other arguments passed to |
A drawn HeatmapList object if return_grob = FALSE. Otherwise, a grob/gTree object.
Removed parameters: rows_palette, rows_palcolor, columns_palette, columns_palcolor,
columns_split_palette, columns_split_palcolor, rows_split_palette, rows_split_palcolor —
use row_annotation_palette/row_annotation_palcolor with key .row (alias for rows_by) or
.rows.split (alias for rows_split_by); similarly column_annotation_palette/
column_annotation_palcolor with .col/.column or .col.split/.column.split.
Also removed: row_name_annotation, row_name_legend, column_name_annotation, column_name_legend —
set row_annotation_params$.row to FALSE to disable the row name annotation; use $show_legend
inside the param entry to control legend visibility. Use column_annotation_params$.col similarly.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.