Constructs a Shared Nearest Neighbor (SNN) Graph for a given dataset. We first determine the k-nearest neighbors of each cell (defined by k.param * k.scale). We use this knn graph to construct the SNN graph by calculating the neighborhood overlap (Jaccard distance) between every cell and its k.param * k.scale nearest neighbors (defining the neighborhood for each cell as the k.param nearest neighbors).
BuildSNN(object, genes.use = NULL, reduction.type = "pca",
dims.use = NULL, k.param = 10, k.scale = 10, plot.SNN = FALSE,
prune.SNN = 1/15, print.output = TRUE, distance.matrix = NULL,
force.recalc = FALSE)
Seurat object
A vector of gene names to use in construction of SNN graph if building directly based on expression data rather than a dimensionally reduced representation (i.e. PCs).
Name of dimensional reduction technique to use in construction of SNN graph. (e.g. "pca", "ica")
A vector of the dimensions to use in construction of the SNN graph (e.g. To use the first 10 PCs, pass 1:10)
Defines k for the k-nearest neighbor algorithm
Granularity option for k.param
Plot the SNN graph
Sets the cutoff for acceptable Jaccard distances when computing the neighborhood overlap for the SNN construction. Any edges with values less than or equal to this will be set to 0 and removed from the SNN graph. Essentially sets the strigency of pruning (0 --- no pruning, 1 --- prune everything).
Whether or not to print output to the console
Build SNN from distance matrix (experimental)
Force recalculation of SNN.
Returns the object with object@snn filled