Description Usage Arguments Value References See Also
View source: R/02_Evaluate_kNN.R
Finds k
closest neighbours to each point in high-dimensional space and the distances to these points.
You can choose from various exact or approximate algorithms to use: annoy
, kd_tree
, cover_tree
, CR
and brute
.
1 2 3 4 5 6 7 | ComputekNNMatrix(
exprs,
k,
method = "annoy",
dist = "euclidean",
out.systime = NULL
)
|
exprs |
numeric matrix: a coordinate matrix of biological expression data (columns correspond to markers, rows correspond to cells) |
k |
integer: number of nearest neighbours to find for each point |
method |
string: |
out.systime |
optional out-variable: if an object is passed as |
list with two slots: Indices
contains a matrix of nearest neighbours to each point (per row) and Distances
contains a matrix of corresponding Euclidean distances
The code for annoy
is adopted from ivis
: Szubert, B., Cole, J.E., Monaco, C. et al. Structure-preserving visualisation of high dimensional single-cell datasets. Sci Rep 9, 8914 (2019). https://doi.org/10.1038/s41598-019-45301-0
Denoise
: denoises high-dimensional expression data to drive down unwanted technical variation
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.