Perform batch effect correction based on the function ComBat form R package sva. It requires that the "batches" in the data set are known. It uses either parametric or non-parametric empirical Bayes frameworks for adjusting data for batch effects.

batchEWAS(input,adjustVar = NULL,batch = NULL, plot = TRUE, par.prior = TRUE,
mean.only = FALSE,ref.batch = NULL)

Arguments

input

An R6 class integrated with all the information.

adjustVar

(Optional) Names of the variate of interest and other covariates besides batch, with each name separated by a comma. Ensure that when correcting for batch effects, the effects of other factors are appropriately considered and adjusted for.Ensure there are no space. e.g. "cov1,cov2".

batch

Name of the batch variable.

plot

(Optional) TRUE give prior plots with black as a kernel estimate of the empirical batch effect density and red as the parametric.

par.prior

(Optional) TRUE indicates parametric adjustments will be used, FALSE indicates non-parametric adjustments will be used.

mean.only

(Optional) Default to FALSE. If TRUE ComBat only corrects the mean of the batch effect (no scale adjustment).

ref.batch

(Optional) NULL If given, will use the selected batch as a reference for batch adjustment.

Value

input, An R6 class object integrating all information.

Examples

if (FALSE) { # \dontrun{
res <- initEWAS(outpath = "default")
res <- loadEWAS(input = res, ExpoData = "default", MethyData = "default")
res <- transEWAS(input = res, Vars = "cov1", TypeTo = "factor")
res <- batchEWAS(input = res, batch = "batch", par.prior=TRUE, ref.batch = NULL)
} # }