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.
PredictAssay( object, nn.idx, assay, reduction = NULL, dims = NULL, return.assay = TRUE, slot = "scale.data", features = NULL, mean.function = rowMeans, seed = 4273, verbose = TRUE )
The object used to calculate knn
k near neighbour indices. A cells x k matrix.
Assay used for prediction
Cell embedding of the reduction used for prediction
Number of dimensions of cell embedding
Return an assay or a predicted matrix
slot used for prediction
features used for prediction
the function used to calculate row mean
Sets the random seed to check if the nearest neighbor is query cell
return an assay containing predicted expression value in the data slot