BatchEC: Batch Effects Evaluation and Correction

Description Usage Arguments Value Examples

View source: R/BatchEC.R

Description

Evaluates if the batch effects with a gene expression dataset using linear regression and if the batch is associated with the data, the data is batch-corrected using the ComBat Algorithm.

Please set your working directory before you call the function as all output files will be saved to this folder.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
BatchEC(
  expr,
  batch.info,
  batch = "Batch",
  NameString = "",
  discrete.batch = TRUE,
  cond = "",
  clus.method = c("NMF", "km"),
  nrun.NMF = 30
)

Arguments

expr

gene expression data; rows should be genes and columns should be samples.

batch.info

contains the batch information. The first column should be sample names.

batch

The title of the batch for which you want to evaluate and do the correction. Default = "Batch"

NameString

String that will be added in all output filenames. Default=NA.

discrete.batch

Logical value indicating whether the samples are already grouped in discrete batches. If the value is FALSE, contiguous batch information is clustered into discrete batches. Useful for clustering batch variables that are contiguous, for example, used reads and useful reads in mClust. Default = TRUE

cond

The column name in the batch.info data which denotes a biological condition variable that may need to be considered for batch correction.

clus.method

Method to be used for clustering. "km" denotes k-means clustering, "NMF" denotes NMF with 30 runs. Default employs both the methods, using clus.method= c("NMF", "km").

nrun.NMF

number of runs for NMF. Default = 30.

Value

the batch-corrected dataset is returned.

Examples

1
2
3
4
5
6
7
## Not run: 
beacon(expr1 = dataset,
       batch.info = batch_info,
       batch = "Batch",
       discrete.batch = TRUE)

## End(Not run)

jankinsan/BatchEC documentation built on Sept. 9, 2021, 8:12 p.m.