optHeatmap: Optimal Hierarchical Clustering Heat Map

View source: R/optCluster-Functions.R

optHeatmapR Documentation

Optimal Hierarchical Clustering Heat Map

Description

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".

Usage

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

Arguments

x

An object of class "optCluster".

dendroClusters

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

barClusters

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

clusterColors

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

mapColors

Specifies colors to use for heat map image.

Colv

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.

dendrogram

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

density.info

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.

Details

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

Examples

	## Obtain Dataset	
	data(arabid)			
	
	## 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")
	topMethod(hier1)

	## Create Default Heat Map Reordering Rows Only
	optHeatmap(hier1)
	
	## 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.