cuda_cell_neighbors: Construct a nearest-neighbour representation

View source: R/cell-workflow.R

cuda_cell_neighborsR Documentation

Construct a nearest-neighbour representation

Description

Construct a nearest-neighbour representation

Usage

cuda_cell_neighbors(
  embedding,
  k = 15L,
  metric = c("euclidean", "cosine"),
  device = c("auto", "cuda", "cpu"),
  batch_size = 256L
)

Arguments

embedding

Cell-by-component matrix or cuda_pca result.

k

Number of neighbours.

metric

Distance metric.

device

Computation device.

batch_size

Maximum query rows per exact kNN distance block. Smaller values reduce peak distance memory.

Value

A cuda_knn object retaining cell names from the embedding.

Examples

cuda_cell_neighbors(
  matrix(rnorm(60), 20, 3),
  k = 5,
  batch_size = 4,
  device = "cpu"
)

cudacellr documentation built on Oct. 28, 2026, 1:07 a.m.