combatPlot: Adjust for batch effects using an empirical Bayes framework...

Description Usage Arguments Value Examples

View source: R/batchQC.R

Description

Adjust for batch effects using an empirical Bayes framework ComBat allows users to adjust for batch effects in datasets where the batch covariate is known, using methodology described in Johnson et al. 2007. It uses either parametric or non-parametric empirical Bayes frameworks for adjusting data for batch effects. Users are returned an expression matrix that has been corrected for batch effects. The input data are assumed to be cleaned and normalized before batch effect removal.

Usage

1
combatPlot(dat, batch, mod = NULL, par.prior = TRUE, prior.plots = TRUE)

Arguments

dat

Genomic measure matrix (dimensions probe x sample) - for example, expression matrix

batch

Batch covariate (only one batch allowed)

mod

Model matrix for outcome of interest and other covariates besides batch

par.prior

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

prior.plots

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

Value

data A probe x sample genomic measure matrix, adjusted for batch effects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
nbatch <- 3
ncond <- 2
npercond <- 10
data.matrix <- rnaseq_sim(ngenes=50, nbatch=nbatch, ncond=ncond, npercond=
    npercond, basemean=10000, ggstep=50, bbstep=2000, ccstep=800, 
    basedisp=100, bdispstep=-10, swvar=1000, seed=1234)
batch <- rep(1:nbatch, each=ncond*npercond)
condition <- rep(rep(1:ncond, each=npercond), nbatch)
pdata <- data.frame(batch, condition)
mod = model.matrix(~as.factor(condition), data = pdata)
combatPlot(data.matrix, batch, mod=mod)

Example output

sh: 1: cannot create /dev/null: Permission denied
Found 3 batches
Adjusting for 1 covariate(s) or covariate level(s)
Standardizing Data across genes
Fitting L/S model and finding priors

	One-sample Kolmogorov-Smirnov test

data:  gamma.hat[1, ]
D = 0.079192, p-value = 0.8879
alternative hypothesis: two-sided

BatchQC documentation built on Nov. 8, 2020, 8:30 p.m.