Learn R Programming

EMA (version 1.4.7)

clustering.plot: Clustering plots for one or two ways representation

Description

Creates plots for a clustering analysis.

Usage

clustering.plot(tree, tree.sup, data, lab, lab.sup,
dendro=TRUE, dendro.sup=TRUE, title="", scale="row", heatcol,
names=TRUE, names.sup=TRUE, names.dist=TRUE,
trim.heatmap=1, palette="rainbow", legend=TRUE, legend.pos="topright", ...)

Arguments

tree

an object of class 'agnes' representing the first clustering.

tree.sup

optional - an object of class 'agnes' representing the second clustering.

data

optional - expression data for the heatmap plot

lab

optional - a matrix or data.frame of labels for 'tree' (by columns)

lab.sup

optional - a matrix or data.frame of labels for 'tree.sup' (by columns)

dendro

display dendrogram of tree object - The default is TRUE

dendro.sup

display dendogram of tree.sup object - The default is TRUE

title

optional - title of the graphic

scale

optional - character indicating if the values should be centered and scaled in either the row direction (gene) or the column direction (sample),or none. The default is '"row"'

heatcol

colors for the heatmap generated by myPalette

names

optional - if names=FALSE, the labels for 'tree' are not written - The default is TRUE

names.sup

optional - if names.sup=FALSE, the labels for 'tree.sup' are not written - The default is TRUE

names.dist

Display the distance used for the Hierachical Clustering - The default is TRUE

trim.heatmap

Percentile of the data to be trimmed. This helps to keep an informative color scale in the heatmap

palette

Palette used for color selection. see as.colors()

legend

Draw legend of the labels. Default is TRUE

legend.pos

Position of the legend (topright, topleft, bottomright, bottomleft). Default is topright

...

Arguments to be passed to methods, such as graphical parameters (see 'par').

Details

If the data matrix is specified, the function draws a clustering using the heatmap representation. If tree.sup is specified the function draws a two-ways clustering using the heatmap representation. Otherwise, a classical dendrogram is displayed. If a labels matrix is specified, each column of the matrix is represented under the dendrogram. If a pdfname is specified, the output is a pdf file. Setting 'trim.heatmap' to a number between 0 and 1 uses equidistant classes between the (trim.heatmap)- and (1-trim.heatmap)-quantile, and lumps the values below and above this range into separate open-ended classes. If the data comes from a heavy-tailed distribution, this can save the display from putting too many values into to few classes.

See Also

clustering, heatmap.plus

Examples

Run this code
# NOT RUN {
data(marty)

##Clustering on 50 most variant genes amongst 500 first 
mv.genes<-genes.selection(marty[1:500,], thres.num=50)
c.sample<-clustering(marty[mv.genes,], metric="pearson", metho="ward")
clustering.plot(c.sample, lab=marty.type.cl, title="H.Clustering\nPearson-Ward")

c.gene<-clustering(data=t(marty[mv.genes,]), metric="pearson",method="ward")

##Two-ways clustering
clustering.plot(tree=c.sample, tree.sup=c.gene, data=marty[mv.genes,], trim.heatmap=0.99)

# }

Run the code above in your browser using DataLab