Skip to contents

Remove named factors without refitting

Usage

remove_factors(fit, factors)

Arguments

fit

Native flash fit.

factors

Unique factor IDs to remove.

Value

Native fit retaining remaining factor IDs.

Details

Origin: WRAPPER / call_only. Credits flash_factors_remove; use factor_provenance("remove_factors") for audited sources and runtime versions. Input units and basis are retained; display/conditional results do not establish biological replication.

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

if (FALSE) {
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"
)
view <- standardize_factors(fit)
remaining <- remove_factors(fit, "F1")
colnames(factor_activity(remaining))
}