R/MultifeatureGrid.R
MultifeatureGrid.Rd
This class facilitates the creation of 2D heatmaps for visualizing biological data, integrating significant levels and z-scores with customizable heatmap configurations.
This function initializes a MultifeatureGrid
object with data and configuration
for creating a multi-feature grid heatmap. It allows customization of the heatmap's
title, axis labels, color palette, and more.
MultifeatureGrid(
data,
title = "Heatmap",
x_label = "X Label",
y_label = "Y Label",
logpval_label = "-log10(p-value)",
zscore_label = "Activation z-score",
numitems_label = "Number of Genes",
color_palette = "RdYlBu",
breaks = seq(-1, 1, 0.5)
)
A data.frame
containing the data to be visualized in the heatmap.
The data frame should have columns that match the expected metadata fields
(e.g., significance values, z-scores).
The title of the heatmap. Default is "Heatmap".
The label for the x-axis. Default is "X Label".
The label for the y-axis. Default is "Y Label".
The label for the legend describing the -log10(p-value). Default is "-log10(p-value)".
The label for the legend describing the activation z-score. Default is "Activation z-score".
The label for the legend describing the number of genes or items. Default is "Number of Genes".
The name of the color palette to use for the heatmap. Default is "RdYlBu". This should be a valid palette name recognized by RColorBrewer.
A numeric vector specifying the breakpoints for color mapping
across the heatmap's values. Default is seq(-1, 1, 0.5)
.
An object of class MultifeatureGrid
initialized with the specified
parameters.
data
A data frame containing heatmap data.
title
The title of the heatmap.
x_label
Label for the X-axis.
y_label
Label for the Y-axis.
logpval_label
Label for the legend of log10(p-value).
zscore_label
Label for the legend of z-scores.
numitems_label
Label for the legend describing the number of items (e.g., genes).
color_palette
The name of the RColorBrewer color palette to be used.
breaks
Numeric vector of breakpoints for color mapping.
data <- data.frame(
tissue = factor(rep(c("Tissue1", "Tissue2"), each = 4)),
signaling = factor(rep(c("Pathway1", "Pathway2", "Pathway3", "Pathway4"), 2)),
Activation_z_score = runif(8, -2, 2),
p = runif(8, 0, 0.05),
number_of_genes = sample(1:100, 8)
)
mg <- MultifeatureGrid(data)
library(MultiModalGraphics)
data <- get_multifeature_grid_df()
mg <- MultifeatureGrid(data)
plot_heatmap(mg, independantVariable = "tissue")
#> Warning: Removed 32 rows containing missing values or values outside the scale range
#> (`geom_point()`).