Skip to contents

Visualizes a correlation matrix as a heatmap tile plot using correlation results stored in the metadata of a MultiAssayExperiment object. When feature_type = "pcs", the function forces PCs to appear on the x-axis and exposures on the y-axis, and it adds a barplot showing how many PCs are significantly associated with each exposure. Otherwise, it handles symmetric correlation results by reordering variable pairs with pmin/pmax. It also suppresses nonsignificant tiles based on a specified p-value threshold.

Usage

plot_correlation_tile(
  expomicset,
  feature_type = c("pcs", "degs", "omics", "factors", "factor_features", "exposures"),
  pval_cutoff = 0.05,
  na_color = "grey100",
  fill_limits = c(-1, 1),
  midpoint = 0
)

Arguments

expomicset

A MultiAssayExperiment object containing correlation results in metadata.

feature_type

Type of correlation results to plot. One of "pcs", "degs", "omics", "factors", "factor_features", or "exposures". Must match the key used in metadata(expomicset)$correlation[[feature_type]].

pval_cutoff

Numeric p-value cutoff below which correlations are displayed. Nonsignificant tiles are rendered in the na_color. Default is 0.05.

na_color

Color used to represent nonsignificant or missing correlations. Default is "grey100".

fill_limits

Numeric vector of length 2 defining the scale limits for correlation values. Default is c(-1, 1).

midpoint

Numeric value for centering the fill gradient. Default is 0.

Value

A ggplot2 tile plot (or a combined tile + barplot if feature_type = "pcs").

Examples

if (FALSE) { # \dontrun{
# After running `run_correlation()` with feature_type = "pcs"
plot_correlation_tile(expomicset = expom_1, feature_type = "pcs")
} # }