graphCluster {RaceID} | R Documentation |
Function for infering clustering of the pruned k nearest neighbour graph
Description
This function derives a graph object from the pruned k nearest neighbours and infers clusters by modularity optimizatio nusing the Louvain or the Leiden algorithm on this graph. A Fruchterman-Rheingold graph layout is also derived from the pruned nearest neighbours.
Usage
graphCluster(
res,
pvalue = 0.01,
use.weights = TRUE,
use.leiden = FALSE,
leiden.resolution = 1,
min.size = 2,
rseed = 12345
)
Arguments
res |
List object with k nearest neighbour information returned by |
pvalue |
Positive real number between 0 and 1. All nearest neighbours with link probability |
use.weights |
logical. If TRUE, then nearest-neighbor link probabilities are used to build a graph as input for Louvain clustering. If FALSE, then all links have equal weight. Default is TRUE. |
use.leiden |
logical. If TRUE, then the Leiden algorithm is used. If FALSE, the Louvain algorithm is used. Default is FALSE. |
leiden.resolution |
Positive real number. Resolution parameter for the Leiden algorithm. |
min.size |
Positive integer number. Minimum cluster size. All clusters with less than |
rseed |
Integer number. Random seed to enforce reproducible clustering results. Default is 12345. |
Value
List object of three components:
partition |
Vector with clustering partition. |
fr |
Data.frame with Fruchterman-Rheingold graph layout. |
residual.cluster |
In case clusters with less than |
Examples
res <- pruneKnn(intestinalDataSmall,knn=10,alpha=1,no_cores=1,FSelect=FALSE)
cl <- graphCluster(res,pvalue=0.01)