Learn R Programming

RaceID (version 0.2.3)

graphCluster: Function for infering Louvain clustering of the pruned k nearest neighbour graph

Description

This function derives a graph object from the pruned nearest neighbours and infers clusters by the the Louvain clustering method 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, rseed = 12345)

Value

List object of three components:

graph

graph derived from the pruned adjacency matrix computed with the igraph package.

louvain

Louvain clustering returned by the cluster_louvain function from the igraph package.

fr

Fruchterman-Rheingold graph layout derived from the pruned adjacency matrix.

Arguments

res

List object with k nearest neighbour information returned by pruneKnn function.

pvalue

Positive real number between 0 and 1. All nearest neighbours with link probability < pvalue are discarded. Default is 0.01.

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.

rseed

Integer number. Random seed to enforce reproducible clustering results. Default is 12345.

Examples

Run this code
res <- pruneKnn(intestinalDataSmall,metric="pearson",knn=10,alpha=1,no_cores=1,FSelect=FALSE)
cl <- graphCluster(res,pvalue=0.01)

Run the code above in your browser using DataLab