e624033d |
% Generated by roxygen2: do not edit by hand
|
0976382f |
% Please edit documentation in R/runBatchCorrection.R
|
e624033d |
\name{runFastMNN}
\alias{runFastMNN}
|
c722bc30 |
\title{Apply a fast version of the mutual nearest neighbors (MNN) batch effect
|
e624033d |
correction method to SingleCellExperiment object}
\usage{
|
64d3a71f |
runFastMNN(
inSCE,
|
5e61389e |
useAssay = "logcounts",
|
93e2414e |
useReducedDim = NULL,
|
5e61389e |
batch = "batch",
|
93e2414e |
reducedDimName = "fastMNN",
k = 20,
propK = NULL,
ndist = 3,
minBatchSkip = 0,
cosNorm = TRUE,
nComponents = 50,
weights = NULL,
BPPARAM = BiocParallel::SerialParam()
|
64d3a71f |
)
|
e624033d |
}
\arguments{
|
93e2414e |
\item{inSCE}{Input \linkS4class{SingleCellExperiment} object}
|
e624033d |
|
c722bc30 |
\item{useAssay}{A single character indicating the name of the assay requiring
|
93e2414e |
batch correction. Default \code{"logcounts"}.}
\item{useReducedDim}{A single character indicating the dimension reduction
used for batch correction. Will ignore \code{useAssay} when using.
Default \code{NULL}.}
\item{batch}{A single character indicating a field in \code{colData} that
annotates the batches of each cell; or a vector/factor with the same length
as the number of cells. Default \code{"batch"}.}
|
e624033d |
|
c722bc30 |
\item{reducedDimName}{A single character. The name for the corrected
|
93e2414e |
low-dimensional representation. Default \code{"fastMNN"}.}
\item{k}{An integer scalar specifying the number of nearest neighbors to
consider when identifying MNNs. See "See Also". Default \code{20}.}
\item{propK}{A numeric scalar in (0, 1) specifying the proportion of cells in
each dataset to use for mutual nearest neighbor searching. See "See Also".
Default \code{NULL}.}
|
e624033d |
|
93e2414e |
\item{ndist}{A numeric scalar specifying the threshold beyond which
neighbours are to be ignored when computing correction vectors. See "See
Also". Default \code{3}.}
|
e624033d |
|
93e2414e |
\item{minBatchSkip}{Numeric scalar specifying the minimum relative magnitude
of the batch effect, below which no correction will be performed at a given
merge step. See "See Also". Default \code{0}.}
\item{cosNorm}{A logical scalar indicating whether cosine normalization
should be performed on \code{useAssay} prior to PCA. See "See Also". Default
\code{TRUE}.}
\item{nComponents}{An integer scalar specifying the number of dimensions to
produce. See "See Also". Default \code{50}.}
\item{weights}{The weighting scheme to use. Passed to
\code{\link[batchelor]{multiBatchPCA}}. Default \code{NULL}.}
\item{BPPARAM}{A \linkS4class{BiocParallelParam} object specifying whether
the SVD should be parallelized.}
|
e624033d |
}
\value{
|
c722bc30 |
The input \linkS4class{SingleCellExperiment} object with
\code{reducedDim(inSCE, reducedDimName)} updated.
|
e624033d |
}
\description{
|
c722bc30 |
fastMNN is a variant of the classic MNN method, modified for speed and more
robust performance. For introduction of MNN, see \code{\link{runMNNCorrect}}.
|
e624033d |
}
\examples{
data('sceBatches', package = 'singleCellTK')
|
93e2414e |
logcounts(sceBatches) <- log1p(counts(sceBatches))
sceCorr <- runFastMNN(sceBatches, useAssay = 'logcounts')
|
679e2352 |
}
|
e624033d |
\references{
Lun ATL, et al., 2016
}
|
93e2414e |
\seealso{
\code{\link[batchelor]{fastMNN}} for using \code{useAssay}, and
\code{\link[batchelor]{reducedMNN}} for using \code{useReducedDim}
}
|