This function is designed for creating peak data for a dataset with only gene expression. This function uses aligned cell factor loading to find nearest neighbors between cells from the queried dataset (without peak) and cells from reference dataset (with peak). And then impute the peak for the former basing on the weight. Therefore, the reference dataset selected must be of "atac" modality setting.
imputeKNN(
object,
reference,
queries = NULL,
nNeighbors = 20,
weight = TRUE,
norm = TRUE,
scale = FALSE,
verbose = getOption("ligerVerbose", TRUE),
...,
knn_k = nNeighbors
)
The input object
where queried ligerDataset
objects in datasets
slot are replaced. These datasets will all be
converted to ligerATACDataset class with an additional slot
rawPeak
to store the imputed peak counts, and normPeak
for
normalized imputed peak counts if norm = TRUE
.
liger object with aligned factor loading computed in advance.
Name of a dataset containing peak data to impute into query dataset(s).
Names of datasets to be augmented by imputation. Should not
include reference
. Default NULL
uses all datasets except the
reference.
The maximum number of nearest neighbors to search. Default
20
.
Logical. Whether to use KNN distances as weight matrix. Default
FALSE
.
Logical. Whether to normalize the imputed data. Default
TRUE
.
Logical. Whether to scale but not center the imputed data.
Default TRUE
.
Logical. Whether to show information of the progress. Default
getOption("ligerVerbose")
or TRUE
if users have not set.
Optional arguments to be passed to normalize
when
norm = TRUE
.
Deprecated. See Usage section for replacement.
bmmc <- normalize(bmmc)
bmmc <- selectGenes(bmmc, datasets.use = "rna")
bmmc <- scaleNotCenter(bmmc)
if (requireNamespace("RcppPlanc", quietly = TRUE)) {
bmmc <- runINMF(bmmc, k = 20)
bmmc <- alignFactors(bmmc)
bmmc <- normalizePeak(bmmc)
bmmc <- imputeKNN(bmmc, reference = "atac", queries = "rna")
}
Run the code above in your browser using DataLab