Learn R Programming

WGCNA (version 1.61)

plotClusterTreeSamples: Annotated clustering dendrogram of microarray samples

Description

This function plots an annotated clustering dendorgram of microarray samples.

Usage

plotClusterTreeSamples(
  datExpr, 
  y = NULL, 
  traitLabels = NULL, 
  yLabels = NULL,
  main = if (is.null(y)) "Sample dendrogram" else 
                         "Sample dendrogram and trait indicator", 
  setLayout = TRUE, autoColorHeight = TRUE, colorHeight = 0.3,
  dendroLabels = NULL, 
  addGuide = FALSE, guideAll = TRUE, 
  guideCount = NULL, guideHang = 0.2, 
  cex.traitLabels = 0.8, 
  cex.dendroLabels = 0.9, 
  marAll = c(1, 5, 3, 1), 
  saveMar = TRUE, 
  abHeight = NULL, abCol = "red", 
  ...)

Arguments

datExpr

a data frame containing expression data, with rows corresponding to samples and columns to genes. Missing values are allowed and will be ignored.

y

microarray sample trait. Either a vector with one entry per sample, or a matrix in which each column corresponds to a (different) trait and each row to a sample.

traitLabels

labels to be printed next to the color rows depicting sample traits. Defaults to column names of y.

yLabels

Optional labels to identify colors in the row identifying the sample classes. If given, must be of the same dimensions as y. Each label that occurs will be displayed once.

main

title for the plot.

setLayout

logical: should the plotting device be partitioned into a standard layout? If FALSE, the user is responsible for partitioning. The function expects two regions of the same width, the first one immediately above the second one.

autoColorHeight

logical: should the height of the color area below the dendrogram be automatically adjusted for the number of traits? Only effective if setLayout is TRUE.

colorHeight

Specifies the height of the color area under dendrogram as a fraction of the height of the dendrogram area. Only effective when autoColorHeight above is FALSE.

dendroLabels

dendrogram labels. Set to FALSE to disable dendrogram labels altogether; set to NULL to use row labels of datExpr.

addGuide

logical: should vertical "guide lines" be added to the dendrogram plot? The lines make it easier to identify color codes with individual samples.

guideAll

logical: add a guide line for every sample? Only effective for addGuide set TRUE.

guideCount

number of guide lines to be plotted. Only effective when addGuide is TRUE and guideAll is FALSE.

guideHang

fraction of the dendrogram height to leave between the top end of the guide line and the dendrogram merge height. If the guide lines overlap with dendrogram labels, increase guideHang to leave more space for the labels.

cex.traitLabels

character expansion factor for trait labels.

cex.dendroLabels

character expansion factor for dendrogram (sample) labels.

marAll

a 4-element vector giving the bottom, left, top and right margins around the combined plot. Note that this is not the same as setting the margins via a call to par, because the bottom margin of the dendrogram and the top margin of the color underneath are always zero.

saveMar

logical: save margins setting before starting the plot and restore on exit?

abHeight

optional specification of the height for a horizontal line in the dendrogram, see abline.

abCol

color for plotting the horizontal line.

other graphical parameters to plot.hclust.

Value

None.

Details

The function generates an average linkage hierarchical clustering dendrogram (see hclust) of samples from the given expression data, using Eclidean distance of samples. The dendrogram is plotted together with color annotation for the samples.

The trait y must be numeric. If y is integer, the colors will correspond to values. If y is continouos, it will be dichotomized to two classes, below and above median.

See Also

dist, hclust, plotDendroAndColors