PredictAssay: Predict value from nearest neighbors

View source: R/clustering.R

PredictAssayR Documentation

Predict value from nearest neighbors

Description

This function will predict expression or cell embeddings from its k nearest neighbors index. For each cell, it will average its k neighbors value to get its new imputed value. It can average expression value in assays and cell embeddings from dimensional reductions.

Usage

PredictAssay(
  object,
  nn.idx,
  assay,
  reduction = NULL,
  dims = NULL,
  return.assay = TRUE,
  slot = "scale.data",
  features = NULL,
  mean.function = rowMeans,
  seed = 4273,
  verbose = TRUE
)

Arguments

object

The object used to calculate knn

nn.idx

k near neighbour indices. A cells x k matrix.

assay

Assay used for prediction

reduction

Cell embedding of the reduction used for prediction

dims

Number of dimensions of cell embedding

return.assay

Return an assay or a predicted matrix

slot

slot used for prediction

features

features used for prediction

mean.function

the function used to calculate row mean

seed

Sets the random seed to check if the nearest neighbor is query cell

verbose

Print progress

Value

return an assay containing predicted expression value in the data slot


Seurat documentation built on May 29, 2024, 4:20 a.m.