imputeKNN | R Documentation |
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
)
object |
liger object with aligned factor loading computed in advance. |
reference |
Name of a dataset containing peak data to impute into query dataset(s). |
queries |
Names of datasets to be augmented by imputation. Should not
include |
nNeighbors |
The maximum number of nearest neighbors to search. Default
|
weight |
Logical. Whether to use KNN distances as weight matrix. Default
|
norm |
Logical. Whether to normalize the imputed data. Default
|
scale |
Logical. Whether to scale but not center the imputed data.
Default |
verbose |
Logical. Whether to show information of the progress. Default
|
... |
Optional arguments to be passed to |
knn_k |
Deprecated. See Usage section for replacement. |
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
.
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")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.