imputeKNN {rliger}R Documentation

Impute the peak counts from gene expression data referring to an ATAC dataset after integration

Description

This function is designed for creating peak data for a dataset with only gene expression. This function uses quantile normalized 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.

Usage

imputeKNN(
  object,
  reference,
  queries = NULL,
  nNeighbors = 20,
  weight = TRUE,
  norm = TRUE,
  scale = FALSE,
  verbose = getOption("ligerVerbose", TRUE),
  ...,
  knn_k = nNeighbors
)

Arguments

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 reference. Default NULL uses all datasets except the reference.

nNeighbors

The maximum number of nearest neighbors to search. Default 20.

weight

Logical. Whether to use KNN distances as weight matrix. Default FALSE.

norm

Logical. Whether to normalize the imputed data. Default TRUE.

scale

Logical. Whether to scale but not center the imputed data. Default TRUE.

verbose

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.

knn_k

Deprecated. See Usage section for replacement.

Value

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.

Examples

bmmc <- normalize(bmmc)
bmmc <- selectGenes(bmmc, datasets.use = "rna")
bmmc <- scaleNotCenter(bmmc)
if (requireNamespace("RcppPlanc", quietly = TRUE)) {
    bmmc <- runINMF(bmmc, k = 20)
    bmmc <- quantileNorm(bmmc)
    bmmc <- normalizePeak(bmmc)
    bmmc <- imputeKNN(bmmc, reference = "atac", queries = "rna")
}

[Package rliger version 2.0.1 Index]