optHeatmap: Optimal Hierarchical Clustering Heat Map

View source: R/optCluster-Functions.R

optHeatmapR Documentation

Optimal Hierarchical Clustering Heat Map


optHeatmap creates a heat map from an object of class "optCluster" if the optimal clustering algorithm is one of the available hierarchical algorithms: "hierarchical", "agnes", or "diana".


optHeatmap(x, dendroClusters = TRUE, barClusters = FALSE, 
			clusterColors = "rainbow", 
			mapColors = colorRampPalette(c("green", "black", "red"))(256), 
			Colv = FALSE, dendrogram = "row", density.info = "none", ...)



An object of class "optCluster".


If TRUE, the row dendrogram is colored to represent the optimal k clusters.


If TRUE, a colored sidebar is produced down the rows to represent the optimal k clusters.


Character vector listing the k colors for the clustering paritions. Default is
rainbow(k) where k is the optimal number of clusters.


Specifies colors to use for heat map image.


Determines if and how the column dendrogram should be reordered. If TRUE, a dendrogram is computed and the columns are reordered by means. A dendrogram object or vector of integers can also be used to specify the reordering.


Character string specifying which dendrogram(s) to display. Options include: "none", "row", "column", "both".


Character string specifying the type of plot to superimpose on the color-key. Options include: "none", "histogram", "density".


Additional plotting parameters from the heatmap.2 function.


This function utilizes the heatmap.2 function to produce a heat map based on the clustering results from the optimal clustering algorithm and number of clusters (as determined by the optCluster function). The rows in the heat map are ordered based on the optimal hierarchical clustering algorithm, with the corresponding dendrogram displayed to the left side of the map. The clustering partition of the rows into the optimal number of clusters can be visualized using the
'dendroClusters' argument and/or the 'barClusters' argument.

Because the optCluster function performs a cluster analysis on the rows of the dataset, only the rows are reordered as default in the optHeatmap function. However, columns can be reordered and displayed with a dendrogram using the 'Colv' and 'dendrogram' arguments, respectively. The heat map can also be further customized by passing additional agruments to the heatmap.2 function through the optHeatmap function.

See Also

heatmap.2, optCluster-class


	## Obtain Dataset	
	## Normalize Data with Respect to Library Size	
	obj <- t(t(arabid)/colSums(arabid))	
	## Analysis with Only UPGMA using Internal and Stability Validation Measures
	hier1 <- optCluster(obj, 2:10, clMethods = "hierarchical")

	## Create Default Heat Map Reordering Rows Only
	## Create a Heat Map Reordering Both Rows and Columns
	optHeatmap(hier1, Colv = TRUE, dendrogram = "both")
	## Customized Heat Map Using Several heatmap.2 Arguments
	optHeatmap(hier1, Colv = TRUE, dendrogram = "both", 
	labRow = "", cexCol = 1.0, keysize = 1)

optCluster documentation built on April 16, 2022, 5:05 p.m.