R/runBatchCorrection.R
runHarmony.Rd
Harmony is an algorithm that projects cells into a shared embedding in which cells group by cell type rather than dataset-specific conditions.
runHarmony(
inSCE,
useAssay = "logcounts",
useReducedDim = NULL,
batch = "batch",
reducedDimName = "HARMONY",
nComponents = 50,
lambda = 0.1,
theta = 5,
sigma = 0.1,
nIter = 10,
verbose = TRUE,
...
)
Input SingleCellExperiment object
A single character indicating the name of the assay requiring
batch correction. Default "logcounts"
.
A single character indicating the name of the reducedDim
used to be corrected. Specifying this will ignore useAssay
. Default
NULL
.
A single character indicating a field in colData
that
annotates the batches of each cell; or a vector/factor with the same length
as the number of cells. Default "batch"
.
A single character. The name for the corrected
low-dimensional representation. Will be saved to reducedDim(inSCE)
.
Default "HARMONY"
.
An integer. The number of PCs to use and generate.
Default 50L
.
A Numeric scalar. Ridge regression penalty parameter. Must be
strictly positive. Smaller values result in more aggressive correction.
Default 0.1
.
A Numeric scalar. Diversity clustering penalty parameter. Larger
values of theta result in more diverse clusters. theta=0 does not encourage
any diversity. Default 5
.
A Numeric scalar. Width of soft kmeans clusters. Larger values
of sigma result in cells assigned to more clusters. Smaller values of sigma
make soft kmeans cluster approach hard clustering. Default 0.1
.
An integer. The max number of iterations to perform. Default
10L
.
Whether to print progress messages. Default TRUE
.
Other arguments passed to HarmonyMatrix
.
See details.
The input SingleCellExperiment object with
reducedDim(inSCE, reducedDimName)
updated.
Since some of the arguments of HarmonyMatrix
is controlled by this wrapper function. The additional arguments users can
work with only include: nclust
, tau
, block.size
,
max.iter.cluster
, epsilon.cluster
, epsilon.harmony
,
plot_convergence
, reference_values
and cluster_prior
.
Ilya Korsunsky, et al., 2019