knnSmooth: knnSmooth

View source: R/knnSmooth.R

knnSmoothR Documentation

knnSmooth

Description

Smooth bincounts based on k nearest neighbors.

Usage

knnSmooth(scCNA, k = 4, BPPARAM = bpparam())

Arguments

scCNA

The CopyKit object.

k

A numeric with the k nearest neighbor value for smoothing

BPPARAM

A BiocParallelParam specifying how the function should be parallelized.

Details

This function uses a k-nearest neighbors approach to smooth cells raw bincounts. To do so, the k-nearest neighbors are calculated with findKNN. The bincounts of the k-nearest neighbors for each cell are tallied and an assay called smoothed_bincounts is added to assay. After, runVst and runSegmentation. Are re-run by knnSmooth.

This function results in a trade-off for the elimination of noise at the cost of risk of loss of subclonal structure. To minimize the risk of subclonal structure loss we recommend using the very small values of k.

This function should be followed by applying runVst and runSegmentation to the CopyKit object.

Value

The CopyKit object with an assay smoothed_bincounts

Author(s)

Darlan Conterno Minussi

Runmin Wei

Examples

copykit_obj <- mock_bincounts(ncells = 10)
copykit_obj <- runSegmentation(copykit_obj)
copykit_obj <- knnSmooth(copykit_obj)



navinlabcode/copykit documentation built on Sept. 22, 2023, 9:16 a.m.