
Generate GPU kNN data for single cells
generate_gpu_knn_sc.RdThis function generates a SingleCellNearestNeighbour object using
GPU-accelerated kNN algorithms via the bixverse.gpu package. Three methods
are available: "exhaustive" performs an exact brute-force search on the
GPU; "ivf" builds an inverted file index that partitions the embedding
space into Voronoi cells and probes only a subset at query time; and
"nndescent" builds a dense NNDescent graph and prunes it into a CAGRA
navigational graph, which is then either beam searched or handed back as the
descent left it (params_nn_gpu(extract_knn = TRUE), faster, lower recall).
This function is the GPU counterpart of generate_knn_sc().
Usage
generate_gpu_knn_sc(
object,
embd_to_use = "pca",
cells_to_use = NULL,
no_embd_to_use = NULL,
modality = c("rna", "adt"),
knn_method = c("nndescent", "exhaustive", "ivf"),
nn_params = params_nn_gpu(),
k = 15L,
seed = 42L,
gpu_method = lifecycle::deprecated(),
ivf_params = lifecycle::deprecated(),
dist_metric = lifecycle::deprecated(),
.verbose = TRUE
)Arguments
- object
SingleCells(orSingleCellsMultiModal) class.- embd_to_use
String. The embedding to use. Whichever you choose, it needs to be part of the object for the selected modality.
- cells_to_use
Optional string vector. Cell names to include. If
NULLall cells in the object will be used.- no_embd_to_use
Optional integer. Number of embedding dimensions to use. If
NULLall will be used.- modality
String. One of
c("rna", "adt"). You can only use"adt"onSingleCellsMultiModalclass.- knn_method
String. One of
c("nndescent", "exhaustive", "ivf").- nn_params
List. Output of
params_nn_gpu().- k
Integer. Number of neighbours.
- seed
Integer. For reproducibility.
- gpu_method
- ivf_params
- dist_metric
- .verbose
Boolean or integer. Controls verbosity.