correct_data: Correct data using ComBat

View source: R/02_batch_correct.R

correct_dataR Documentation

Correct data using ComBat

Description

Compute the batch correction on the data using the ComBat algorithm. Define a covariate, either as a character vector or name of tibble column. The covariate should preferable be the cell condition types but can be any column that infers heterogeneity in the data. The function assumes that the batch information is in the "batch" column and the data contains a "sample" column with sample information.

Usage

correct_data(
  df,
  label,
  covar = NULL,
  anchor = NULL,
  markers = NULL,
  parametric = TRUE
)

Arguments

df

tibble with expression values

label

The cluster or cell type label. Either as a column name or vector.

covar

The covariate ComBat should use. Can be a vector or a column name in the input tibble. If NULL, no covar will be used

anchor

Experimental: A column or vector specifying which samples are replicates and which are not. If specified, this column will be used as a covariate in ComBat. Be aware that it may be confounded with the condition.

markers

Markers to normalize. If NULL, markers will be found using the get_markers function.

parametric

Default: TRUE. If TRUE, the parametric version of ComBat is used. If FALSE, the non-parametric version is used.

See Also

Other batch: batch_correct(), create_som(), normalize(), quantile_norm()

Examples

## Not run: 
corrected <- uncorrected %>%
  correct_data(label = labels, covar = "condition")
  
## End(Not run)

shdam/cyCombine documentation built on June 12, 2022, 11:29 p.m.