Skip to contents

Generates a bar plot summarizing the number of exposure variables that pass or fail normality tests (e.g., Shapiro-Wilk) before or after transformation.

Usage

plot_normality_summary(expomicset, transformed = FALSE)

Arguments

expomicset

A MultiAssayExperiment object with quality control metadata.

transformed

Logical; if TRUE, use results after transformation. Default is FALSE.

Value

A ggplot object summarizing the number of exposures classified as normal or not normal.

Details

This function assumes that run_normality_check() has been executed and that the results are stored in metadata(expomicset)$quality_control$normality. If transformed = TRUE, the function will instead plot the transformation summary stored in metadata(expomicset)$quality_control$transformation$norm_summary, which is populated by transform_exposure().

The plot includes both bar heights and overlaid line segments to reinforce the counts. Colors are drawn from the Lancet or UChicago palettes via ggsci and ggpubr.

Examples

if (FALSE) { # \dontrun{
# Plot original exposure normality results
plot_normality_summary(expomicset)

# Plot post-transformation normality summary
plot_normality_summary(expomicset, transformed = TRUE)
} # }