View source: R/runBatchCorrection.R
runHarmony | R Documentation |
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 = NULL,
useReducedDim = NULL,
batch = "batch",
reducedDimName = "HARMONY",
nComponents = 50,
lambda = 0.1,
theta = 5,
sigma = 0.1,
nIter = 10,
seed = 12345,
verbose = TRUE,
...
)
inSCE |
Input SingleCellExperiment object |
useAssay |
A single character indicating the name of the assay requiring
batch correction. Default |
useReducedDim |
A single character indicating the name of the reducedDim
to be used. It is recommended to use a reducedDim instead of a full assay as
using an assay might cause the algorithm to not converge and throw error.
Specifying this will ignore |
batch |
A single character indicating a field in |
reducedDimName |
A single character. The name for the corrected
low-dimensional representation. Will be saved to |
nComponents |
An integer. The number of PCs to use and generate.
Default |
lambda |
A Numeric scalar. Ridge regression penalty parameter. Must be
strictly positive. Smaller values result in more aggressive correction.
Default |
theta |
A Numeric scalar. Diversity clustering penalty parameter. Larger
values of theta result in more diverse clusters. theta=0 does not encourage
any diversity. Default |
sigma |
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 |
nIter |
An integer. The max number of iterations to perform. Default
|
seed |
Set seed for reproducibility. Default is |
verbose |
Whether to print progress messages. Default |
... |
Other arguments passed to |
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
.
The input SingleCellExperiment object with
reducedDim(inSCE, reducedDimName)
updated.
Ilya Korsunsky, et al., 2019
data('sceBatches', package = 'singleCellTK')
logcounts(sceBatches) <- log1p(counts(sceBatches))
## Not run:
if (require("harmony"))
sceCorr <- runHarmony(sceBatches)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.