Hierarchical clustering is a statistical method used to assign similar objects into groups called clusters. It is typically performed on results of statistical analyses, such as a list of significant genes / transcripts, but can also be invoked on the full data set, as a part of exploratory analysis.
Hierarchical clustering is an unsupervised technique, meaning that the number of clusters is not specified up front. In the beginning, each row and/or column is considered a cluster. The two most similar clusters are combined and continue to combine until all objects are in the same cluster. Hierarchical clustering produces a tree (called a dendrogram) that shows the hierarchy of the clusters.
This tutorial will illustrate how to:
Invoking Hierarchical Clustering
To invoke hierarchical clustering, select a Quantification data node (to cluster samples) or a Feature list data node (to cluster significant genes/transcripts) and then click on the Hierarchical clustering option in the context sensitive menu (Figure 1).
The hierarchical clustering setup dialog (Figure 2) enables you to control the clustering algorithm. Starting from the top, you can choose to Cluster samples, Cluster features (genes/transcripts) or both. By default, if there are less than 3000 samples, the Cluster samples check button is selected, if there are less than 3000 features, the Cluster features check button is selected. Otherwise the check button is de-selected.
Cluster distance metric is used to determine how the distance between two clusters will be calculated. Single Linkage: the distance between two clusters is determined by the distance of the closest objects in the two clusters. Complete Linkage: the distance between two clusters is equal to the distance between the two furthest members of those clusters. Average Linkage: the average distance between all the pairs of objects in the two different clusters is used as the measure of distance between the two clusters. Centroid method: the distance between two clusters is equal to the distance between the centroids of those clusters. Ward's method: the distance between two clusters is designed to minimize the size of an error measure based on the sum of squares.
Point distance metric is used to determine the distance between two rows or columns. For a thorough discussion, we refer you to the distance metrics chapter.
If you do not want to cluster all the samples, but select a subset based on specific sample attributes (i.e. group membership), use the Filtering drop down list (Figure 3). The default value of the Filtering option is All samples.
You can choose to how the data is normalized. Under the Normalization mode dropdown, Standardize (default) will make each column mean as zero and standard deviation as 1 in all features. This is the default normalization and it makes makes all the features (e.g., genes) have equal weight. The normalization mode Shift will make each column mean as zero. Choose None to perform clustering on the values in the quantified data node.
Customizing the Heat Map
The output of a Hierarchical clustering task is a heat map (Figure 4) with or without dendrogram depends on whether you perform cluster on samples/cells or features. By default, samples are on rows (sample labels are displayed as seen in the Data tab) and variables (genes or transcripts, depending on the input data) on columns. Colors are based on standardized expression values (mean of 0, standard deviation of 1; performed on the fly), with green indicating low and red indicating high levels of a variable (i.e. low or high expression levels). Dendrograms show clustering of rows (samples) and columns (variables).
Depending on the number of samples and variables that need to be displayed, some binning may be involved. The viewer aims for 200 × 200 heat map cells visible at any given time, i.e. 200 samples and 200 variables (Figure 4 shows an example with nine samples and 32 variables). If there are more than 200 cells in any dimension, they will be averaged together. Figure 5 shows clustering of the same nine samples as in Figure 4, but with 419 variables. Note binning of genes in the X-axis.
Heat map controls are on the left-hand side (Figure 6). It can be collapsed, if needed, to maximize the space on the canvas, by clicking on the triangle icon (
).If the map is large and rows / columns are binned, you can zoom in by selecting the Zoom mode (
) and left-click & drag around the region of the map that you are interested in. Alternatively, use the mouse wheel to zoom in / out. To move the map around when zoomed in, switch to the Pan mode ( ) and drag the map. The Reset zoom ( ) re-creates the initial enlargement of the heat map. To transpose the map, i.e. to see samples on columns and genes on rows, select the Transpose view button( ). To flip rows or columns belonging to the same dendrogram branch, select the flip mode ( ) button.When select a cluster by left-clicking & dragging around the dendrogram line in selection mode (
), the export button ( will be enabled. Click on it to export the selected features and samples with the normalized values which the heatmap color represents into a text file.The heat map can be saved as a .svg image by selecting the Save image icon (
).The control dialog can be seen on Figure 7. The default filename is Dendrogram view.svg and it is downloaded to the local computer.To change a color on the map, click on the arrow head by the color box to get the color mixer (Figure 8). Then pick the color you prefer and select OK. Range of the colors can be changed by typing a different value in the text box to the left of the STD sign (i.e. sandardised).
The sample and/or feature dendrogram color can also be configured. By default, the dendrograms are all colored in black (Figure 9 ).
When the By cluster radio button is chosen, the number of clusters needs to be specified, and then the top N number of clusters will be in N different colors. For the sample dendrogram, it can also be colored with it's attributes by selecting the By sample attribute radio button and selecting the relevant attribute in the drop-down menu. If the cluster includes samples from different subgroup, the line of the cluster will be mixed color of the subgroup color.
Most of the times you will want to see sample attributes on the heat map. Select the Select attribute drop down list and point to the attribute (as defined in the Data tab) that you want to add to the dendrogram. To remove an attribute from the dendrogram, select the red minus icon (
). Selecting the gear icon ( ) opens the configuration dialog (Figure 10), which is used to manipulate the dendrogram annotation. Group labels can be turned on or off (Show labels), rotated (Rotation) or re-sized (Size). The color blocks around the labels can also be turned on or off (Show color blocks).The Labels section of the control panel deals with different labels. First, Show labels turns sample and feature labels on or off. For features with both gene- and transcript level-information, click on the drop-down menu to select which you would like to display, by default, both are shown (Figure 11).
If needed, scales for sample or feature dendrograms can also be added (Show scale). Column labels can be placed at the Top or at the Bottom, while Row labels can be on the Left or on the Right (Figure 12).
Commonly used plot customization can be saved by selecting the Save settings button. Give your setting set a name (Figure 13) and select Save. Saved settings will be available under the Saved settings list, and can be deleted by clicking on the red cross button(
). To revert to manufacturer settings at any time, use the Default settings hyperlink.Additional Assistance
If you need additional assistance, please visit our support page to submit a help ticket or find phone numbers for regional support.
Your Rating: |
![]() ![]() ![]() ![]() ![]() |
Results: |
![]() ![]() ![]() ![]() ![]() |
4 | rates |