BatchRemove: Batch effect removal

View source: R/BatchRemove.R

BatchRemoveR Documentation

Batch effect removal

Description

Batch effect removal

Usage

BatchRemove(
  mat,
  batchMat,
  log2trans = FALSE,
  pca = TRUE,
  positive = FALSE,
  cluster = FALSE,
  outdir = NULL
)

Arguments

mat

A data frame, each row is a gene, and each column is a sample.

batchMat

A data frame, the first column should be 'Samples'(matched colnames of mat) and the second column is 'Batch'. The remaining columns could be Covariates.

log2trans

Boolean, specifying whether do logarithmic transformation before batch removal.

pca

Boolean, specifying whether return pca plot.

positive

Boolean, specifying whether all values should be positive.

cluster

Boolean, specifying whether perform hierarchical clustering.

outdir

Output directory for hierarchical cluster tree.

Value

A list contrains two objects, including data and p.

Author(s)

Wubing Zhang

See Also

ComBat

Examples

edata = matrix(c(rnorm(2000, 5), rnorm(2000, 8)), 1000)
colnames(edata) = paste0("s", 1:4)
batchMat = data.frame(sample = colnames(edata), batch = rep(1:2, each = 2))
edata1 = BatchRemove(edata, batchMat)
print(edata1$p)


WubingZhang/MAGeCKFlute documentation built on Jan. 27, 2024, 2:43 p.m.