In limma::removeBatchEffect() there is an option to add columns that should be included in the adjusting model, but not adjusted for.
- This requires that all variables are are adjusted for are centered (continuous with
center(); factors with contr.sum).
- Then the coefficients for the non-adjusted variables are set to 0 before adjusting.