<- colnames(adni)[c(43:104)]
features <- c("timedays", "AGE", "SEX", "DIAGNOSIS")
covariates <- c("timedays,DIAGNOSIS")
interaction <- "manufac"
batch <- combat_harm(type = "lm", features = features, batch = batch, covariates = covariates, interaction = interaction, smooth = NULL, random = NULL, df = adni)
combat_model head(combat_model$harmonized_df)
Harmonization
ComBatFamQC provides four types of commonly used harmonization techniques, integrated through the ComBatFamily package developed by Dr. Andrew Chen, for users to consider. The four harmonization techniques include:
- Original ComBat (Johnson et al., 2007)
- Longitudinal ComBat (Beer et al., 2020)
- ComBat-GAM (Pomponio et al., 2020)
- CovBat (Chen et al., 2021)
There are two types of harmonization scenarios users can choose from:
- First-time Harmonization (Can also do interactive harmonization through Rshiny)
- Out of Sample Harmonization
- predict from existing ComBat model (works only for original ComBat and ComBat-GAM)
- harmonize new data toward existing reference data (works for all built-in ComBat harmonization methods)
First Harmonization
Specify parameters carefully based on the harmonization method to be applied.
Users can also use the command-line interface via ComBatQC_CLI.R to start the harmonization stage. Apart from the same required parameters as the diagnosis stage(features
, covariates
, batch
, smooth
, random
), using the command-line interface also requires users to set the following parameter:
--diagnosis/-d
: FALSE--outdir
: Path to save the harmonized dataset (in .csv format)--mout
: Path to save the ComBat model (optional if users do not wish to save the model; in .rds format)
Original ComBat
A method designed for batch effect correction in cross-sectional data with linear covariate effects.
Longitudinal ComBat
A method accounts for intra-subject correlation in longitudinal data by incorporating random effects into the model.
ComBat-GAM
A method allows for preservation of non-linear covariate effects through use of the generalized additive model.
CovBat
CovBat is used for correcting covariance batch effects.
Out-of-Sample Harmonization
from ComBat Model
Specify predict
parameter to be TRUE and object
parameter to be saved ComBat model.
Using the command-line interface requires users to set the following parameter:
--predict
: TRUE--object/-o
: Path to the saved ComBat model (in .rds format)
from Reference Data
Specify reference
parameter to be saved reference data. To be noticed, the reference data should have identical columns as the new data and the new data should contain reference data as its sub sample.
Using the command-line interface requires users to set the following parameter:
--reference
: Path to the reference dataset