runScranSNN: Get clustering with SNN graph

Description Usage Arguments Value References Examples

View source: R/getCluster.R

Description

Perform SNN graph clustering on a SingleCellExperiment object, with graph construction by buildSNNGraph and graph clustering by "igraph" package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
runScranSNN(
  inSCE,
  useAssay = NULL,
  useReducedDim = NULL,
  useAltExp = NULL,
  altExpAssay = "counts",
  clusterName = "scranSNN_cluster",
  k = 10,
  nComp = 50,
  weightType = c("rank", "number", "jaccard"),
  algorithm = c("walktrap", "louvain", "infomap", "fastGreedy", "labelProp",
    "leadingEigen")
)

Arguments

inSCE

A SingleCellExperiment object.

useAssay

A single character, specifying which assay to perform the clustering algorithm on. Default NULL.

useReducedDim

A single character, specifying which low-dimension representation (reducedDim) to perform the clustering algorithm on. Default NULL.

useAltExp

A single character, specifying the assay which altExp to perform the clustering algorithm on. Default NULL.

altExpAssay

A single character, specifying which assay in the chosen altExp to work on. Only used when useAltExp is set. Default "counts".

clusterName

A single character, specifying the name to store the cluster label in colData. Default "scranSNN_cluster".

k

An integer, the number of nearest neighbors used to construct the graph. Smaller value indicates higher resolution and larger number of clusters. Default 10.

nComp

An integer, the number of components to use when useAssay or useAltExp is specified. WON'T work with useReducedDim. Default 50.

weightType

A single character, that specifies the edge weighing scheme when constructing the Shared Nearest-Neighbor (SNN) graph. Choose from "rank", "number", "jaccard". Default "rank".

algorithm

A single character, that specifies the community detection algorithm to work on the SNN graph. Choose from "walktrap", "louvain", "infomap", "fastGreedy", "labelProp", "leadingEigen". Default "walktrap".

Value

The input SingleCellExperiment object with factor cluster labeling updated in colData(inSCE)[[clusterName]].

References

Aaron Lun and et. al., 2016

Examples

1
2
3
data("mouseBrainSubsetSCE")
mouseBrainSubsetSCE <- runScranSNN(mouseBrainSubsetSCE,
                                   useReducedDim = "PCA_logcounts")

singleCellTK documentation built on Nov. 8, 2020, 5:21 p.m.