Main function to perform neuroCombat harmonization.

neuroCombat(
  dat,
  batch,
  mod = NULL,
  eb = TRUE,
  parametric = TRUE,
  mean.only = FALSE,
  ref.batch = NULL,
  verbose = TRUE,
  BPPARAM = bpparam("SerialParam")
)

Arguments

dat

Numeric matrix with imaging features as rows, and scans/images as columns.

batch

Numeric or character vector specifying the batch/scanner variable needed for harmonization. Length must be equal to the number of columns in dat.

mod

Optional model matrix for outcome of interest and other covariates besides batch/scanner.

eb

Should Empirical Bayes adjustements be performed? TRUE by default. Specifying eb=FALSE will perform location/scale (L/S) adjustments for each feature separately, that is without pooling information aross features to estimate batch correction parameters.

parametric

Should parametric priors be used in the EB estimation? TRUE by default. Note that the non-parametric option (parametric=FALSE) is usually very slow.

mean.only

Should only correction factors be calculated for location? FALSE by default.

ref.batch

NULL by default.

verbose

Should progress messages be printed? TRUE by default.

BPPARAM

BiocParallelParam for parallel operation. This is mostly useful when parametric=FALSE.

Value

A named list of length 5. The 1st element (dat.combat) contains the harmonized data. The 2nd element (estimates) contains estimates and other parameters used during harmonization. The 3rd element (dataDict) contains information about the dataset and the batch covariate information that were provided to the neuroCombat function. The 4th element (data.original) contains the raw data that were provided to neuroCombat. The 5th element (data.standardized) contains the standardized original data: each feature is scaled and centered after adjusting for biological covariates).