View source: R/runBatchCorrection.R
runComBatSeq | R Documentation |
The ComBat-Seq batch adjustment approach assumes that batch effects represent non-biological but systematic shifts in the mean or variability of genomic features for all samples within a processing batch. It uses either parametric or non-parametric empirical Bayes frameworks for adjusting data for batch effects.
runComBatSeq(
inSCE,
useAssay = "counts",
batch = "batch",
covariates = NULL,
bioCond = NULL,
useSVA = FALSE,
assayName = "ComBatSeq",
shrink = FALSE,
shrinkDisp = FALSE,
nGene = NULL
)
inSCE |
Input SingleCellExperiment object |
useAssay |
A single character indicating the name of the assay requiring
batch correction. Default |
batch |
A single character indicating a field in
|
covariates |
A character vector indicating the fields in
|
bioCond |
A single character indicating a field in
|
useSVA |
A logical scalar. Whether to estimate surrogate variables and
use them as an empirical control. Default |
assayName |
A single characeter. The name for the corrected assay. Will
be saved to |
shrink |
A logical scalar. Whether to apply shrinkage on parameter
estimation. Default |
shrinkDisp |
A logical scalar. Whether to apply shrinkage on dispersion.
Default |
nGene |
An integer. Number of random genes to use in empirical Bayes
estimation, only useful when |
For the parameters covariates
and useSVA
, when the cell type
information is known, it is recommended to specify the cell type annotation
to the argument covariates
; if the cell types are unknown but
expected to be balanced, it is recommended to run with default settings, yet
informative covariates could still be useful. If the cell types are unknown
and are expected to be unbalanced, it is recommended to set useSVA
to TRUE
.
The input SingleCellExperiment object with
assay(inSCE, assayName)
updated.
data('sceBatches', package = 'singleCellTK')
sceBatches <- sample(sceBatches, 40)
# Cell type known
sceBatches <- runComBatSeq(sceBatches, "counts", "batch",
covariates = "cell_type",
assayName = "ComBat_cell_seq")
# Cell type unknown but balanced
#sceBatches <- runComBatSeq(sceBatches, "counts", "batch",
# assayName = "ComBat_seq")
# Cell type unknown and unbalanced
#sceBatches <- runComBatSeq(sceBatches, "counts", "batch",
# useSVA = TRUE,
# assayName = "ComBat_sva_seq")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.