Visualizes missing data patterns in a MultiAssayExperiment
object using summary bar plots or feature-level lollipop plots.
Usage
plot_missing(
expomicset,
threshold = 5,
plot_type = c("summary", "lollipop"),
layers = NULL
)
Arguments
- expomicset
A
MultiAssayExperiment
object containing exposure and omics assays. Missing data is inferred directly from the assays.- threshold
Numeric. The percentage threshold (0–100) above which features are counted as missing in the summary plot. Default is
5
.- plot_type
Character. Type of plot to generate. Either
"summary"
for a bar plot showing number of features above the missing threshold, or"lollipop"
for a per-feature lollipop plot with layer annotations. Default is"summary"
.- layers
Optional character vector. If specified, filters the plot to include only selected layers (e.g.,
"Exposure"
,"Transcriptome"
).
Details
The function calculates missing data per feature (or variable) across all assays (including exposure variables) and generates:
Summary plot (
plot_type = "summary
): A bar plot showing the number of variables in each assay exceeding the specified missingness threshold.Lollipop plot (
plot_type = "lollipop
): A feature-level plot where each feature's percent missingness is shown, along with a color-coded tile on the side indicating its layer of origin.
The tile colors in the lollipop plot match the experiment colors used in other visualizations (e.g., via scale_color_tidy_exp()
).
Examples
if (FALSE) { # \dontrun{
# Summary bar plot of missing data
plot_missing(expom, threshold = 10, plot_type = "summary")
# Lollipop plot for all features with any missingness
plot_missing(expom, plot_type = "lollipop")
# Lollipop plot only for exposure and proteomics layers
plot_missing(expom, plot_type = "lollipop", layers = c("Exposure", "Proteomics"))
} # }