This method generates and plots a heatmap for MultifeatureGrid objects. It allows customization of the heatmap's appearance based on several parameters.

# S4 method for class 'MultifeatureGrid'
plot_heatmap(
  object,
  pValueColumn = "p",
  lowColor = "yellow",
  highColor = "red",
  borderColor = "grey60",
  columnForNumber = "number_of_genes",
  independantVariable = "timePoint"
)

Arguments

object

An object of class MultifeatureGrid. This object contains the data and configuration for the heatmap to be plotted.

pValueColumn

A character string specifying the name of the column in the data frame that contains p-values. These values are used to calculate and plot the negative log10 of the p-values. Default is "p".

lowColor

A character string specifying the color to use for the low end of the color gradient for p-values. Default is "yellow".

highColor

A character string specifying the color to use for the high end of the color gradient for p-values. Default is "red".

borderColor

A character string specifying the color to use for the border of each tile in the heatmap. Default is "grey60".

columnForNumber

A character string specifying the name of the column in the data frame that contains the number of items (e.g., genes) for each feature. This value is used to determine the size of the points plotted on the heatmap. Default is "number_of_genes".

independantVariable

A character string specifying the name of the column used as an independent variable for faceting the plot into multiple panels, one for each level of the independent variable. Default is "timePoint".

Value

A ggplot object representing the heatmap, which is also printed to the current plotting device.

Examples

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),
                   timePoint = rep(c("Time1", "Time2"), 4))
mg <- MultifeatureGrid(data)
plot_heatmap(mg)