Plot Top Features by Factor from Integration Results
Source:R/plot_top_factor_features.R
plot_top_factor_features.Rd
Visualizes the top loading features for each factor from multi-omics integration results (e.g., MOFA, MCIA, DIABLO, RGCCA).
Usage
plot_top_factor_features(
expomicset,
feature_col = "feature",
factors = NULL,
top_n = 5,
facet_cols = NULL,
exp_name_cols = NULL,
alpha = 0.5
)
Arguments
- expomicset
A
MultiAssayExperiment
object containing integration results in themetadata
slot (must includeintegration_results
).- factors
Character vector of factors to include (e.g., "Factor1", "Factor2"). If
NULL
, all factors are plotted.- top_n
Integer specifying the number of top features to show per factor. Default is
5
.- facet_cols
Optional color palette for facet strip backgrounds (one per
exp_name
), used to distinguish factors.- exp_name_cols
Optional color palette for experiment labels in the plot (
exp_name
), passed toscale_color_manual()
.- alpha
Numeric value between 0 and 1 controlling the transparency of facet strip background fill. Default is
0.5
.
Value
A ggplot2
object with one facet per factor, showing the top features and their loadings by experiment.
Details
This function supports the following integration methods:
"MOFA"
: Uses feature weights from MOFA2 (get_weights()
)."MCIA"
: Uses block loadings from MCIA (@block_loadings
)."DIABLO"
: Extracts block-specific loadings fromloadings
."RGCCA"
: Extracts block-specific loadings froma
.
For each factor, it:
Selects the top
top_n
features by absolute loading.Creates a point-range plot showing the loading magnitude.
Facets each factor with a customizable strip background.
If palettes are not provided, defaults are chosen using ggpubr::get_palette()
.