pub fn remove_batch_effect(
x: &Array2<f64>,
batch: Option<&[String]>,
batch2: Option<&[String]>,
covariates: Option<&Array2<f64>>,
design: Option<&Array2<f64>>,
) -> Result<Array2<f64>>Expand description
Remove batch effects from x (n_genes x n_samples).
batch,batch2— optional per-sample factor labels (lengthn_samples) for one or two blocking factors, coded with sum-to-zero contrasts.covariates— optionaln_samples x knumeric covariates to remove (mean-centred before fitting).design— optionaln_samples x pdesign matrix of experimental conditions to preserve. Defaults to a single intercept column (one-group experiment) whenNone.
Returns the batch-corrected matrix (n_genes x n_samples). With all of
batch, batch2, covariates None the input is returned unchanged.