ClusterTest-class | R Documentation |
This is a base class for tests that attempt to determine whether the groups found by an unsupervised clustering method are statistically significant.
## S4 method for signature 'ClusterTest'
image(x, dendrogram, ...)
x |
An object of the |
dendrogram |
An object with S3 class |
... |
Additional graphical parameters to be passed to the
standard |
Objects can be created by calls of the form new("ClusterTest", ...)
.
Most users, however, will only create objects from one of the derived
classes such as BootstrapClusterTest
or
PerturbationClusterTest
.
call
:An object of class call
, which shows
how the object was constructed.
result
:A symmetric matrix
containing the
results of the cluster reproducibility test. The size of the
matrix corresponds to the number of samples (columns) in the data
set on which the test was performed. The result
matrix
should contain "agreement" values between 0 and 1, representing for
each pair of samples the fraction of times that they were
collected into the same cluster.
signature(x = "ClusterTest")
: Produces a
histogram of the agreement fractions. When a true group structure
exists, one expects a multimodal distribution,with one group of
agreements near 0 (for pairs belonging to different clusters) and
one group of agreements near 1 (for pairs belonging to the same
cluster).
signature(x = "ClusterTest")
: Uses the
heatmap
function to display the agreement matrix. The
optional dendrogram
argument should be used to display the
extent to which the agreement matrix matches the results of
hierarchical clustering using the full data set. This method
invisibly returns the result of a call to heatmap
; thus, you
can use keep.dendro=TRUE
to recover the cluster assignments
from the dendrograms.
signature(object = "ClusterTest")
: Write out a
summary of the object.
Kevin R. Coombes krc@silicovore.com
Kerr MK, Churchill GJ.
Bootstrapping cluster analysis: Assessing the reliability of
conclusions from microarray experiments.
PNAS 2001; 98:8961-8965.
BootstrapClusterTest
,
PerturbationClusterTest
,
heatmap
showClass("ClusterTest")
## simulate data from two different classes
d1 <- matrix(rnorm(100*30, rnorm(100, 0.5)), nrow=100, ncol=30, byrow=FALSE)
d2 <- matrix(rnorm(100*20, rnorm(100, 0.5)), nrow=100, ncol=20, byrow=FALSE)
dd <- cbind(d1, d2)
## cluster the data
hc <- hclust(distanceMatrix(dd, 'pearson'), method='average')
## make a fake reproducibility matrix
fraud <- function(x) {
new('ClusterTest', result=abs(cor(x)), call=match.call())
}
fake <- fraud(dd)
summary(fake)
hist(fake)
image(fake) # let heatmap compute a new dendrogram from the agreements
image(fake, dendrogram=hc) # use the actual dendrogram from the data
image(fake, dendrogram=hc, col=blueyellow(64)) # change the colors
## cleanup
rm(fake, fraud, hc, dd, d1, d2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.