
Generates the neighbour graph
rs_sc_knn_graph.Rd
Symmetrises a kNN matrix into an undirected, weighted graph. Three options:
the bluster/Seurat shared nearest neighbour graph (
"snn"), the ScanPy/UMAP
fuzzy simplicial set ("umap") or the plain kNN union ("knn").
Arguments
- knn_mat
Integer matrix. Rows represent cells and the columns represent the neighbours (0-indexed!), self excluded and sorted by distance.
- knn_dist
Optional numeric matrix of the same shape with the distances. Required for
knn_sym = "umap".- graph_params
Named list. Recognised keys:
knn_sym(one ofc("snn", "umap", "knn")); for"snn":snn_similarity(one ofc("jaccard", "rank")),pruningandrescue; for"umap":local_connectivityandmix_ratio; for"knn":binary.- verbose
Integer.
0L- quiet;1L- normal verbosity;2L- detailed verbosity.
Value
External pointer to the Rust graph. See rs_graph_info(),
rs_graph_to_edges() and rs_graph_to_bytes().