| .ggmlr_neighbors_gpu | R Documentation |
Builds the two neighbour graphs that Seurat's FindNeighbors produces:
a binary kNN graph and a shared-nearest-neighbour (SNN) graph whose edge
weights are the Jaccard overlap of the two endpoints' neighbourhoods. The kNN
search uses the FNN kd-tree when available, otherwise the pairwise distance
matrix (GPU pairwise_dist.comp or CPU). The SNN step is sparse matrix
arithmetic. Matches Seurat numerically: SNN weight = |N(i) cap N(j)| /
|N(i) cup N(j)| with the neighbour set including the point itself, pruned
below prune_snn.
.ggmlr_neighbors_gpu(
mat,
n_neighbors = 20L,
prune_snn = 1/15,
gpu_neighbor_max_cells = NULL,
backend = c("vulkan", "cpu"),
knn_backend = c("cpu", "vulkan")
)
mat |
Dense numeric matrix, features x cells (e.g. PC coordinates). |
n_neighbors |
kNN graph size (Seurat default 20). |
prune_snn |
Drop SNN edges with Jaccard below this (Seurat default 1/15). |
gpu_neighbor_max_cells |
Cell ceiling for the GPU distance fallback;
|
backend |
|
knn_backend |
Which backend runs the kNN search: |
A ggml_result with metadata$kind = "graph" and
the two graphs (nn, snn) as sparse matrices in
metadata; embedding is the SNN graph (the one clustering uses).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.