
Remove batch effects from a log-expression matrix
rs_remove_batch_effect.Rd
limma's
removeBatchEffect, via the edge-rs crate. Batch gets
sum-to-zero contrasts, is fitted jointly with the design of interest and
only the batch part is subtracted. Meant for plotting and unsupervised
work; for testing put batch into the design.
Arguments
- x
Numeric matrix. Log-expression values of genes x samples.
- batch
Integer vector. Batch label per sample, e.g.
as.integer(factor(x)). Needs at least two distinct labels.- design
Numeric matrix or NULL. The design of interest, samples x coefficients, whose effects are protected. NULL is an intercept only.