Learn R Programming

WGCNA (version 0.95)

plotDendroAndColors: Dendrogram plot with color annotation of objects

Description

This function plots a hierarchical clustering dendrogram and color annotation(s) of objects in the dendrogram underneath.

Usage

plotDendroAndColors(
  dendro, 
  colors, 
  groupLabels = NULL, 
  colorText = NULL,
  setLayout = TRUE, 
  autoColorHeight = TRUE, 
  colorHeight = 0.2, 
  dendroLabels = NULL, 
  addGuide = FALSE, guideAll = FALSE, 
  guideCount = 50, guideHang = 0.2, 
  cex.colorLabels = 0.8, cex.dendroLabels = 0.9, 
  marAll = c(1, 5, 3, 1), saveMar = TRUE, 
  abHeight = NULL, abCol = "red", ...)

Arguments

dendro
a hierarchical clustering dendrogram such as one produced by hclust.
colors
Coloring of objects on the dendrogram. Either a vector (one color per object) or a matrix (can also be an array or a data frame) with each column giving one color per object. Each column will be plotted as a horizontal row of colors under the dendrogra
groupLabels
Labels for the colorings given in colors. The labels will be printed to the left of the color rows in the plot. If the argument is given, it must be a vector of length equal to the number of columns in colors. If not given,
colorText
Optional labels to identify colors in the color rows. If given, must be of the same dimensions as colors. Each label that occurs will be displayed once.
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.colorLabels
character expansion factor for trait labels.
cex.dendroLabels
character expansion factor for dendrogram (sample) labels.
marAll
a vector of length 4 giving the bottom, left, top and right margins of the combined plot. There is no margin between the dendrogram and the color plot underneath.
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 slits the plotting device into two regions, plots the given dendrogram in the upper region, then plots color rows in the region below the dendrogram.

See Also

plotColorUnderTree