batchEffectRemoval: Corrects the batch effect of the data by using the selected...

View source: R/batchEffectRemoval.R

batchEffectRemovalR Documentation

Corrects the batch effect of the data by using the selected method.

Description

This function corrects the batch effect of the expression matrix indicated by parameter. There are two method to choose such as ComBat or SVA.

Usage

batchEffectRemoval(
  expressionMatrix,
  labels,
  method = "combat",
  batchGroups = c()
)

Arguments

expressionMatrix

The original expression matrix to treat the batch effect.

labels

A vector that contains the labels of the samples in expressionMatrix.

method

The method that will be used to remove the batch effect. The possibilities are "combat" or "sva". Next release will add RUV.

batchGroups

A numeric vector with the different known batch groups for the samples.

Value

A matrix with the batch effect corrected for combat or a model for DEGsExtraction function in the case of sva.

Examples

dir <- system.file("extdata", package="KnowSeq")
load(paste(dir,"/expressionExample.RData",sep = ""))

batchGroups <- c(1,1,1,1,2,2,1,2,1,2)

expressionMatrixNoBatch <- batchEffectRemoval(expressionMatrix, labels, batchGroups = batchGroups)
expressionMatrixNoBatch <- batchEffectRemoval(expressionMatrix, labels, method = "sva")

CasedUgr/KnowSeq documentation built on Aug. 16, 2022, 6:19 a.m.