Skip to contents

Bar chart of each factor's native PVE from factor_pve(). Nonorthogonal factors do not give an additive partition, so bars need not sum to the total variance explained.

Usage

plot_factor_pve(fit, factors = NULL)

Arguments

fit

Native flash fit or a view that carries native PVE.

factors

Optional character factor IDs in the order wanted. Default all.

Value

A ggplot object whose $data is the factor_pve() table.

Details

Origin: WRAPPER / none. Credits native pve field; use factor_provenance("plot_factor_pve") for audited sources and runtime versions. Input units and basis are retained; display/conditional results do not establish biological replication.

See also

Author

Jason Willwerscheid; Peter Carbonetto; Wei Wang; Matthew Stephens. Full source and dependency credits: https://github.com/mdmanurung/flashier-utils/blob/main/CREDITS.md.

Examples

set.seed(3)
X <- tcrossprod(matrix(rnorm(48), 24, 2), matrix(rnorm(32), 16, 2)) +
  matrix(rnorm(384, sd = 0.2), 24, 16)
dimnames(X) <- list(paste0("s", 1:24), paste0("g", 1:16))
fit <- fit_ebmf(X, "rows",
  max_factors = 2, seed = 4, verbose = 0,
  ebnm_fn = list(ebnm::ebnm_normal, ebnm::ebnm_point_laplace),
  nullcheck = FALSE, backfit = TRUE, feature_scale = "simulated_centered_intensity"
)
plot_factor_pve(fit)