BatchRemove {MAGeCKFlute} | R Documentation |
Batch effect removal
BatchRemove( mat, batchMat, log2trans = FALSE, pca = TRUE, positive = FALSE, cluster = FALSE, outdir = NULL )
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. |
A list contrains two objects, including data
and p
.
Wubing Zhang
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)