Mosaic {ClassDiscovery} | R Documentation |
Produce “Eisen” plots of microarray or proteomics data.
Mosaic(data, sampleMetric = "pearson", sampleLinkage = "average", geneMetric = "euclid", geneLinkage = "average", usecor = FALSE, center = FALSE, name = "My mosaic") ## S4 method for signature 'Mosaic': pltree(x, colors, labels, ...) ## S4 method for signature 'Mosaic, missing': plot(x, main=x@name, center=FALSE, limits=NULL, sampleColors=NULL, sampleClasses=NULL, geneColors=NULL, geneClasses=NULL, ...)
data |
Either a data frame or matrix with numeric values or an
exprSet as defined in the BioConductor tools for
analyzing microarray data. |
sampleMetric |
Any valid distance metric that can be passed to the
distanceMatrix function |
sampleLinkage |
Any valid linkage method that can be passed to the
hclust function |
geneMetric |
Any valid distance metric that can be passed to the
distanceMatrix function |
geneLinkage |
Any valid linkage method that can be passed to the
hclust function |
center |
A logical flag; should the data rows be centered? |
usecor |
A logical flag; should the data rows be scaled to have standard deviation one? |
name |
A character string; the name of this object. |
x |
A Mosaic object. |
colors |
An optional vector of character strings containing color names to be used when labeling the trees in the dendrogram. If provided, then the length should equal the number of columns in the original data matrix. |
labels |
An optional vector of character strings used to label the leaves in the dendrogram. If omitted, the column names are used. |
main |
A character string; the plot title |
limits |
An numeric vector. If provided, the data is truncated
for display purposes, both above and below, at the minimum and
maximum values of limits . |
sampleColors |
An optional character vector containing colors that will be used to label different sample types with a color bar across the top of the heat map. |
sampleClasses |
A logical vector or factor used to classify the
samples into groups. Alternatively, an integer specifying the number
k of groups into which to cut the sample dendrogram. |
geneColors |
An optional character vector containing colors that will be used to label different gene types with a color bar along the side of the heat map. |
geneClasses |
A logical vector or factor used to classify the
genes into groups. Alternatively, an integer specifying the number
k of groups into which to cut the gene dendrogram. |
... |
Additional parameters for heatmap . |
One of the earliest papers in the microaray literature used
independent clustering of the genes (rows) and samples (columns) to
produce dendrograms that were plotted along with a red-green heat map
of the centered expression values. Since that time, literally thousand
of additional papers have published variations on these red-green
images. R includes a function, heatmap
that builds such
figures. However, that function is general purpose and has numerous
optional parameters to tweak the display. The purpose of the
Mosaic
class is to provide a simplified object-oriented wrapper
around heatmap
, which as a side benefit allows us to
keep track of the distance metrics and linkage rules that were used to
produce the resulting figure.
The Mosaic
function constructs and returns a valid object of
the Mosaic
class.
Objects should be created with the Mosaic
function.
data
:matrix
contaiing the numerical data samples
:hclust
produced
by clustering the biological samples (columns of data
). genes
:hclust
produced by
clustering the genes (columns of data
).sampleMetric
:character
string; the distance
metric used to cluster the samples. sampleLinkage
:character
string; the linkage
rule used to cluster the samples. geneMetric
:character
string; the distance
metric used to cluster the genes. geneLinkage
:character
string; the linkage
rule used to cluster the genes. call
:call
recording how the
object was constructed. name
:character
string; the name of this object. signature(x = Mosaic, y = missing)
: Produce the
“Eisen” plot, using heatmap
. signature(x = Mosaic)
: Plot the sample class
dendrogram in the object. signature(object = Mosaic)
: Write out a
summary of the object. Kevin R. Coombes <kcoombes@mdanderson.org>
Eisen MB, Spellman PT, Brown PO, Botstein D. Cluster analysis and display of genome-wide expression patterns. Proc Natl Acad Sci U S A. 1998 Dec 8;95(25):14863-8.
# simulate data from three different sample groups d1 <- matrix(rnorm(100*10, rnorm(100, 0.5)), nrow=100, ncol=10, byrow=FALSE) d2 <- matrix(rnorm(100*10, rnorm(100, 0.5)), nrow=100, ncol=10, byrow=FALSE) d3 <- matrix(rnorm(100*10, rnorm(100, 0.5)), nrow=100, ncol=10, byrow=FALSE) dd <- cbind(d1, d2, d3) kind <- factor(rep(c('red', 'green', 'blue'), each=10)) # prepare the Mosaic object m <- Mosaic(dd, sampleMetric='pearson', geneMetric='spearman', center=TRUE, usecor=TRUE) summary(m) # The default plot with red-green color map plot(m, col=redgreen(64)) # change to a blue-yellow color map, and mark the four top splits in the sample # direction with a color bar along the top plot(m, col=blueyellow(128), sampleClasses=4, sampleColors=c('red', 'green', 'blue', 'black')) # This time, mark the three classes that we know are there plot(m, col=blueyellow(128), sampleClasses=kind, sampleColors=c('red', 'green', 'blue')) plot(m, col=blueyellow(128), geneClasses=3, geneColors=c('red', 'green', 'black')) # In addition, mark the top 5 splits in the gene dendrogram plot(m, col=blueyellow(128), sampleClasses=kind, sampleColors=c('red', 'green', 'black'), geneClasses=5, geneColors=c('cyan', 'magenta', 'royalblue', 'darkgreen', 'orange')) # plot the sample dendrogram by itself cols <- as.character(kind) pltree(m, labels=1:30, colors=cols) # cleanup rm(d1, d2, d3, dd, kind, cols, m)