runCluster: Find Clusters Using Louvain/Leiden Algorithm

View source: R/runClusters.R

runClusterR Documentation

Find Clusters Using Louvain/Leiden Algorithm

Description

Using the constructed knn graph returned by function runKNN, we next applied community finding algorithm to identify the ‘communities’ in the resulting graph which represents groups of cells sharing similar accessibility profiles.

Usage

runCluster(obj, tmp.folder, louvain.lib, resolution, seed.use, ...)

Arguments

obj

A snap object.

tmp.folder

Directory to store temporary files.

louvain.lib

Louvain implementation method to use ["R-igraph", "leiden"]. "R-igraph" uses "cluster_louvain" implemented by igraph package in R. "Leiden" uses "Leiden" algorithm for finding clusters (recommanded). Leiden allows for multiple resolutions, but requires "leiden" to be pre-installed seperately. see how to install "leiden" (https://github.com/TomKellyGenetics/leiden).

resolution

A numeric value that indicates the resolution for louvain clustering [1].

seed.use

Random seed [10].

...

Paramters passed to leiden.

Value

Returns a snap obj with the cluster stored in obj@cluster

Examples

data(demo.sp);
demo.sp = runCluster(obj=demo.sp, tmp.folder=tempdir(), louvain.lib="R-igraph");


r3fang/SnapATAC documentation built on March 29, 2022, 4:33 p.m.