Skip to contents

Method to smooth sparse scores (e.g. RNA expression, ATAC gene scores, or DORC scores) per cell per feature using cell K nearest neighbors (NNs). Useful for visualizing scores in single cells for tSNE and UMAP plots.

Usage

smoothScoresNN(NNmat, mat, geneList = NULL, barcodesList = NULL, nCores = 1)

Arguments

NNmat

matrix of K Nearest neighbor indices for each cell (row), where each column is one of K nearest neighbors per cell. See the knn.index function for obtaining these K nearest neighbor maps. Rownames must be valid cell IDs.

mat

matrix of single cell scores. Rownames must be valid gene symbols, and column names must be valid cell IDs matching the rownames in the cell NN matrix.

geneList

vector of valid gene names to compute smoothed TSS accessibility scores for. If geneList is NULL, all genes (rows) in the TSS matrix are used

barcodesList

vector of valid barcode IDs to subset data using and compute smoothed TSS accessibility scores for. If barcodesList is NULL, all cell barcodes (columns) in the TSS matrix are used

nCores

integer specifying the number of cores to use, if running in parallel. Default is 1 (i.e. no parallelization)

Value

a matrix of scores for each gene TSS and each cell, smoothed over its K nearest neighbors

Author

Vinay Kartha