Learn R Programming

COMMUNAL (version 1.0)

COMMUNAL-class: Class "COMMUNAL"

Description

This is the class of the object returned by the COMMUNAL function. It contains all the clustering results, including the values of the validation measures, and the cluster assignments. Cluster assignments for a particular number of clusters can be conveniently extracted with the getClustering(k) method.

Arguments

Extends

All reference classes extend and inherit methods from "envRefClass".

See Also

Vignette and COMMUNAL. The function COMMUNAL returns an object of this class.

Examples

Run this code
showClass("COMMUNAL")
## create artificial data set with 3 distinct clusters
set.seed(1)
V1 = c(abs(rnorm(100, 2)), abs(rnorm(100, 50)), abs(rnorm(100, 140)))
V2 = c(abs(rnorm(100, 2, 8)), abs(rnorm(100, 55, 4)), abs(rnorm(100, 105, 1)))
data <- t(data.frame(V1, V2))
colnames(data) <- paste("Sample", 1:ncol(data), sep="")
rownames(data) <- paste("Gene", 1:nrow(data), sep="")

## run COMMUNAL with defaults
result <- COMMUNAL(data=data, ks=seq(2,5))  # result is a COMMUNAL object
k <- 3                                # suppose optimal cluster number is 3
clusters <- result$getClustering(k)   # extract clusters
mat.key <- clusterKeys(clusters, k=k) # get core clusters
examineCounts(mat.key)                # all algorithms agree
core <- returnCore(mat.key, agreement.thresh=50) # find 'core' cluster assignments
table(core) # the 'core' cluster sizes

result$measures # access validation measures

Run the code above in your browser using DataLab