Learn R Programming

Seurat (version 2.0.0)

BuildSNN: SNN Graph Construction

Description

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).

Usage

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)

Arguments

object

Seurat object

genes.use

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).

reduction.type

Name of dimensional reduction technique to use in construction of SNN graph. (e.g. "pca", "ica")

dims.use

A vector of the dimensions to use in construction of the SNN graph (e.g. To use the first 10 PCs, pass 1:10)

k.param

Defines k for the k-nearest neighbor algorithm

k.scale

Granularity option for k.param

plot.SNN

Plot the SNN graph

prune.SNN

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).

print.output

Whether or not to print output to the console

distance.matrix

Build SNN from distance matrix (experimental)

force.recalc

Force recalculation of SNN.

Value

Returns the object with object@snn filled