build_knn_graph | R Documentation |
Calculate the kNN-network given a data matrix
build_knn_graph(
data,
k = 20,
dist_type = c("euclidean", "pearson", "raw"),
use_seurat_snn = TRUE,
mutual = TRUE,
jaccard_weighted = TRUE,
jaccard_prune = 1/15,
return_igraph = FALSE,
verbose = TRUE
)
data |
The data matrix |
k |
The number of neighbors |
dist_type |
The type of distance. Should be one of "euclidean", "pearson" and "raw" |
use_seurat_snn |
If TRUE, the FindNeighbors function in Seurat will be called to calculate |
mutual |
Only consider mutual nearest neighbors. Ignore if use_seurat_snn is TRUE |
jaccard_weighted |
If TRUE, edges of the resulted graph are weighted by Jaccard index. Ignore if use_seurat_snn is TRUE |
jaccard_prune |
Prune an edge if its weight is smaller than this value. Ignore if use_seurat_snn is FALSE and jaccard_weighted is FALSE |
return_igraph |
if TRUE, an igraph object instead of the adjacent matrix will be returned |
verbose |
If TRUE, progress message is provided |
A Matrix of kNN network adjacant matrix. If return_igraph is TRUE, the corresponding igraph object is returned
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.