Learn R Programming

rliger (version 1.0.0)

imputeKNN: Impute the query cell expression matrix

Description

Impute query features from a reference dataset using KNN.

Usage

imputeKNN(
  object,
  reference,
  queries,
  knn_k = 20,
  weight = TRUE,
  norm = TRUE,
  scale = FALSE,
  verbose = TRUE
)

Arguments

object

liger object.

reference

Dataset containing values to impute into query dataset(s).

queries

Dataset to be augmented by imputation. If not specified, will pass in all datasets.

knn_k

The maximum number of nearest neighbors to search. (default 20)

weight

Whether to use KNN distances as weight matrix (default FALSE).

norm

Whether normalize the imputed data with default parameters (default TRUE).

scale

Whether scale but not center the imputed data with default parameters (default TRUE).

verbose

Print progress bar/messages (TRUE by default)

Value

liger object with raw data in raw.data slot replaced by imputed data (genes by cells)

Examples

Run this code
# NOT RUN {
# ligerex (liger object), factorization complete
# impute every dataset other than the reference dataset
ligerex <- imputeKNN(ligerex, reference = "y_set", weight = FALSE)
# impute only z_set dataset
ligerex <- imputeKNN(ligerex, reference = "y_set", queries = list("z_set"), knn_k = 50)
# }

Run the code above in your browser using DataLab