runScranSNN {singleCellTK} | R Documentation

## Get clustering with SNN graph

### Description

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

### Usage

    runScranSNN(
      inSCE,
      useAssay = NULL,
      useReducedDim = NULL,
      useAltExp = NULL,
      altExpAssay = "counts",
      altExpRedDim = NULL,
      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"`.
`altExpRedDim` | A single `character`, specifying which `reducedDim` within the `altExp` specified by `useAltExp` to use. Only used when `useAltExp` is set. Default `NULL`.
`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

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

[Package singleCellTK version 2.2.0 Index]