| RemoveBatchEffect | R Documentation |
Removes batch effects between two gene expression datasets, typically representing different sample types such as cancer cells and immune cells. Uses ComBat from the sva package for batch correction.
RemoveBatchEffect(cancer.exp, immune.exp, immune.cellType)
cancer.exp |
Matrix or data frame. Cancer cell expression data with genes as rows and samples as columns. |
immune.exp |
Matrix or data frame. Immune cell expression data with genes as rows and samples as columns. |
immune.cellType |
Vector. Cell type for each column in 'immune.exp'. |
A list containing:
Batch effect corrected cancer expression data
Batch effect corrected immune expression data
Aggregated immune expression data (median per cell type)
Bo Li
set.seed(123)
gene_names <- paste0("Gene", 1:100)
sample_names_cancer <- paste0("CancerSample", 1:10)
cancer.exp <- matrix(runif(1000, 1, 1000),
nrow = 100, ncol = 10,
dimnames = list(gene_names, sample_names_cancer)
)
sample_names_immune <- paste0("ImmuneSample", 1:5)
immune.exp <- matrix(runif(500, 1, 1000),
nrow = 100, ncol = 5,
dimnames = list(gene_names, sample_names_immune)
)
immune.cellType <- c("T-cell", "B-cell", "T-cell", "NK-cell", "B-cell")
names(immune.cellType) <- sample_names_immune
result <- RemoveBatchEffect(cancer.exp, immune.exp, immune.cellType)
if (!is.null(result)) str(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.