Anne-Laure Boulesteix 20 May 2004
R EXERCISE - CLUSTERING
Preliminary a) Load the colon data set (Alon et al.), the leukemia data set (Golub et al.) and the lymphoma data set (Alizadeh et al.). b) Display the ve rst columns and the ve rst lines of each data matrix as well as the vectors of classes. c) Load the library cluster.
Exercise 1: Clustering of samples In this exercise, we use a few common clustering methods to nd groups of samples. When applying a clustering method, we ignore the information we have about cancer class. a) k-means clustering. Perform k-means clustering using the function kmeans on the colon data with centers = 2. Display the clustering results. b) Partitioning around medoids (PAM). Perform clustering using the function pam with k = 2 and k = 3 on the colon data. Do the same for the leukemia data set, giving the euclidean distance matrix as input. For each data set, compare the cluster assignments obtained with k = 2 to the real cancer class. Use the function clusplot to visualize the clusters on the two rst principal components. c) Fuzzy clustering. Perform fuzzy clustering using the function fanny on the colon data with k = 2, using only observations 1 to 5 and 23 to 27 (for computational reasons). d) Agglomerative clustering. Compute the correlation distance matrix for the leukemia data using the function cor. Perform agglomerative clustering with the function hclust using successively the single and complete linkage. Plot the corresponding dendograms.
Display the attribute merge of the dendogram and try to understand what it means by using the online help. How many clusters do you obtain if you cut (with the functioncutree) the dendogram obtained by complete linkage at height 0.4 ? Cut the dendogram so as to obtain 2 clusters. Compare the obtained clusters to the real cancer class. e) Divisive clustering. Perform divisive clustering with the function diana on the leukemia data using the euclidean metric for calculating dissimilarities between observations.
Exercise 2: Clustering of genes Clustering methods can also be used to cluster genes, i.e. to nd groups of genes with similar expression patterns. a) Compute the correlation distance matrix between genes for the colon data set. b) Perform agglomerative clustering of the genes using the complete linkage. Plot the obtained dendogram. c) Cut the dendogram so as to obtain 50 clusters of genes. d) Display the correlation matrix for the genes contained in cluster 1.
Exercise 3: Silhouettes The silhouette value for each observation can be seen as a measure of how similar this observation is to observations in its own cluster compared to observations in other clusters. A high silhouette indicates high similarity. The average silhouette computed for several numbers of clusters can be used to determine the right number of clusters. a) For the lymphoma data set, use the function pam to cluster the samples, successively with k = 2, 3, 4, 5. For each k, plot the corresponding silhouette plot, using the functions silhouette and plot. b) Determine which observations have a negative silhouette for k = 3. c) When looking at the silhouette information for k = 3, which cluster seems to be between the two other clusters? Can this statement be qualitatively conrmed by principal components analysis ? Plot the two rst principal components using dierent colors for each cluster.