make_cds_nn_index: Make and store a nearest neighbor index in the cell_data_set.

View source: R/nearest_neighbors.R

make_cds_nn_indexR Documentation

Make and store a nearest neighbor index in the cell_data_set.

Description

Make a nearest neighbor index from the specified reduction_method matrix in the cell_data_set using either the default nearest neighbor method or the method specified in the nn_control list parameter, and store the index in the cell_data_set. This function returns a cell_data_set.

Usage

make_cds_nn_index(
  cds,
  reduction_method = c("UMAP", "PCA", "LSI", "Aligned", "tSNE"),
  nn_control = list(),
  verbose = FALSE
)

Arguments

cds

a cell_data_set with the reduced dimension matrix from which to make the nearest neighbor index and with which the index is stored.

reduction_method

a string giving the reduced dimension matrix to use for making the nn_index nearest neighbor index. Note: distances in tSNE space reflect spatial differences poorly so using nearest neighbors with it may be meaningless.

nn_control

a list of parameters to use for making the nearest neighbor index. See the set_nn_control help for details.

verbose

a boolean indicating whether to emit verbose output.

Value

a cell_data_set with the stored index.

Examples

  
    cds <- load_a549()
    cds <- preprocess_cds(cds)
    cds <- make_cds_nn_index(cds, 'PCA')
  


cole-trapnell-lab/monocle3 documentation built on May 24, 2022, 5:25 p.m.