BatchRemove {MAGeCKFlute} | R Documentation |
Batch effect removal
BatchRemove(mat, batchMat, log2trans = FALSE)
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. |
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)