
Find GPU-accelerated neighbours for single cells
find_neighbours_gpu_sc.RdThis function generates kNN data using GPU-accelerated algorithms via the
bixverse.gpu package, then turns it into a SingleCellConnectivity for
downstream clustering. See generate_gpu_knn_sc() for the three searches on
offer. This function lives in a separate package from the CPU-based
find_neighbours_sc() so that users without GPU hardware do not need to
install the GPU dependencies.
Usage
find_neighbours_gpu_sc(
object,
embd_to_use = "pca",
no_embd_to_use = NULL,
modality = c("rna", "adt", "atac"),
knn_method = c("nndescent", "cagra", "exhaustive", "ivf"),
nn_params = params_nn_gpu(),
k = 15L,
graph_params = bixverse::params_knn_graph_defaults(),
seed = 42L,
gpu_method = lifecycle::deprecated(),
ivf_params = lifecycle::deprecated(),
dist_metric = lifecycle::deprecated(),
snn_params = lifecycle::deprecated(),
backend = c("wgpu", "mlx"),
.verbose = TRUE
)Arguments
- object
SingleCells(orSingleCellsMultiModal) class.- embd_to_use
String. The embedding to use.
- no_embd_to_use
Optional integer. Number of embedding dimensions to use. If
NULLall will be used.- modality
String. One of
c("rna", "adt", "atac")."adt"needs aSingleCellsMultiModal,"atac"aSingleCellsMultiModalor aSingleCellsAtac.- knn_method
String. One of
c("nndescent", "cagra", "exhaustive", "ivf").- nn_params
List. Output of
params_nn_gpu().- k
Integer. Number of neighbours.
- graph_params
List. Output of
bixverse::params_knn_graph_defaults(). Controls how the kNN is turned into the connectivities graph.- seed
Integer. For reproducibility.
- gpu_method
- ivf_params
- dist_metric
- snn_params
- backend
String. One of
c("wgpu", "mlx")."mlx"runs the search on Apple Silicon via MLX and needs a build with the MLX backend, seemlx_available().- .verbose
Boolean. Controls verbosity.