View source: R/optCluster-Functions.R

optHeatmap | R Documentation |

`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", ...)

`x` |
An object of class |

`dendroClusters` |
If |

`barClusters` |
If |

`clusterColors` |
Character vector listing the k colors for the clustering
paritions. Default is |

`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` |
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 |

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.

`heatmap.2`

, `optCluster-class`

## 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)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.