search_nn_matrix: Search a subject matrix for nearest neighbors to a...

View source: R/nearest_neighbors.R

search_nn_matrixR Documentation

Search a subject matrix for nearest neighbors to a query_matrix.

Description

Make a nearest neighbors index using the subject matrix and search it for nearest neighbors to the query_matrix.

Usage

search_nn_matrix(
  subject_matrix,
  query_matrix,
  k = 25,
  nn_control = list(),
  verbose = FALSE
)

Arguments

subject_matrix

a matrix used to build a nearest neighbor index.

query_matrix

a matrix used to search the subject_matrix nearest neighbor index.

k

an integer for the number of nearest neighbors to return for each cell. Default is 25.

nn_control

a list of parameters used to make and search the nearest neighbor index. See the set_nn_control help for details.

verbose

a boolean indicating whether to emit verbose output.

Value

a list list(nn.idx, nn.dists) where nn.idx is a matrix of nearest neighbor indices and nn.dists is a matrix of the distance between the index given by the row number and the index given in nn.idx. If the query_matrix is the same as the subject matrix, the index given by the row number should be in the row, usually in the first column.


cole-trapnell-lab/monocle3 documentation built on April 7, 2024, 9:24 p.m.