Learn R Programming

SnapATAC (version 1.0.0)

runCluster: 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 <U+2018>communities<U+2019> 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

Run this code
# NOT RUN {
data(demo.sp);
demo.sp = runCluster(obj=demo.sp, tmp.folder=tempdir(), louvain.lib="R-igraph");

# }

Run the code above in your browser using DataLab