View source: R/optimizeNewParam.R
optimizeSubset | R Documentation |
Uses an efficient strategy for updating that takes advantage of the information in the existing factorization.
optimizeSubset(
object,
clusterVar = NULL,
useClusters = NULL,
lambda = NULL,
nIteration = 30,
cellIdx = NULL,
scaleDatasets = NULL,
seed = 1,
verbose = getOption("ligerVerbose"),
cell.subset = cellIdx,
cluster.subset = useClusters,
max.iters = nIteration,
datasets.scale = scaleDatasets,
thresh = NULL
)
object |
liger object. Should have integrative
factorization (e.g. |
clusterVar , useClusters |
Together select the clusters to subset the
object conveniently. |
lambda |
Numeric regularization parameter. By default |
nIteration |
Maximum number of block coordinate descent iterations to
perform. Default |
cellIdx |
Valid index vector that applies to the whole object. See
|
scaleDatasets |
Names of datasets to re-scale after subsetting.
Default |
seed |
Random seed to allow reproducible results. Default |
verbose |
Logical. Whether to show information of the progress. Default
|
cell.subset , cluster.subset , max.iters , datasets.scale |
These arguments are now replaced by others and will be removed in the future. Please see usage for replacement. |
thresh |
Deprecated. New implementation of iNMF does not require
a threshold for convergence detection. Setting a large enough
|
Subset object
with factorization matrices optimized, including
the W
matrix in liger object, and W
and V
matrices in each ligerDataset object in the datasets
slot. scaleData
in the ligerDataset objects of
datasets specified by scaleDatasets
will also be updated to reflect
the subset.
pbmc <- normalize(pbmc)
pbmc <- selectGenes(pbmc)
pbmc <- scaleNotCenter(pbmc)
if (requireNamespace("RcppPlanc", quietly = TRUE)) {
# Only running a few iterations for fast examples
pbmc <- runINMF(pbmc, k = 20, nIteration = 2)
pbmc <- optimizeSubset(pbmc, cellIdx = sort(sample(ncol(pbmc), 200)),
nIteration = 2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.