Presentation is loading. Please wait.

Presentation is loading. Please wait.

Www.bioalgorithms.infoAn Introduction to Bioinformatics Algorithms Clustering.

Similar presentations


Presentation on theme: "Www.bioalgorithms.infoAn Introduction to Bioinformatics Algorithms Clustering."— Presentation transcript:

1 www.bioalgorithms.infoAn Introduction to Bioinformatics Algorithms Clustering

2 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Proposed Changes Microarrays – very poor intro – can we find better slides in BIO section?

3 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Outline Microarrays Hierarchical Clustering K-Means Clustering Corrupted Cliques Problem CAST Clustering Algorithm

4 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Applications of Clustering Viewing and analyzing vast amounts of biological data as a whole set can be perplexing It is easier to interpret the data if they are partitioned into clusters combining similar data points.

5 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Inferring Gene Functionality Researchers want to know the functions of newly sequenced genes Simply comparing the new gene sequences to known DNA sequences often does not give away the function of gene For 40% of sequenced genes, functionality cannot be ascertained by only comparing to sequences of other known genes Microarrays allow biologists to infer gene function even when sequence similarity alone is insufficient to infer function.

6 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Microarrays and Expression Analysis Microarrays measure the activity (expression level) of the genes under varying conditions/time points Expression level is estimated by measuring the amount of mRNA for that particular gene A gene is active if it is being transcribed More mRNA usually indicates more gene activity

7 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Microarray Experiments Produce cDNA from mRNA (DNA is more stable) Attach phosphor to cDNA to see when a particular gene is expressed Different color phosphors are available to compare many samples at once Hybridize cDNA over the micro array Scan the microarray with a phosphor-illuminating laser Illumination reveals transcribed genes Scan microarray multiple times for the different color phosphor’s

8 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Microarray Experiments (con ’ t) www.affymetrix.com Phosphors can be added here instead Then instead of staining, laser illumination can be used

9 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Using Microarrays Each box represents one gene’s expression over time Track the sample over a period of time to see gene expression over time Track two different samples under the same conditions to see the difference in gene expressions

10 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Using Microarrays (cont ’ d) Green: expressed only from control Red: expressed only from experimental cell Yellow: equally expressed in both samples Black: NOT expressed in either control or experimental cells

11 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Microarray Data Microarray data are usually transformed into an intensity matrix (below) The intensity matrix allows biologists to make correlations between diferent genes (even if they are dissimilar) and to understand how genes functions might be related Time:Time XTime YTime Z Gene 1108 Gene 21009 Gene 348.63 Gene 4783 Gene 5123 Intensity (expression level) of gene at measured time

12 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Microarray Data-REVISION- show in the matrix which genes are similar and which are not. Microarray data are usually transformed into an intensity matrix (below) The intensity matrix allows biologists to make correlations between diferent genes (even if they are dissimilar) and to understand how genes functions might be related Clustering comes into play Time:Time XTime YTime Z Gene 1108 Gene 21009 Gene 348.63 Gene 4783 Gene 5123 Intensity (expression level) of gene at measured time

13 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Clustering of Microarray Data Plot each datum as a point in N-dimensional space Make a distance matrix for the distance between every two gene points in the N- dimensional space Genes with a small distance share the same expression characteristics and might be functionally related or similar. Clustering reveal groups of functionally related genes

14 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Clustering of Microarray Data (cont ’ d) Clusters

15 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Homogeneity and Separation Principles Homogeneity: Elements within a cluster are close to each other Separation: Elements in different clusters are further apart from each other …clustering is not an easy task! Given these points a clustering algorithm might make two distinct clusters as follows

16 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Bad Clustering This clustering violates both Homogeneity and Separation principles Close distances from points in separate clusters Far distances from points in the same cluster

17 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Good Clustering This clustering satisfies both Homogeneity and Separation principles

18 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Clustering Techniques Agglomerative: Start with every element in its own cluster, and iteratively join clusters together Divisive: Start with one cluster and iteratively divide it into smaller clusters Hierarchical: Organize elements into a tree, leaves represent genes and the length of the pathes between leaves represents the distances between genes. Similar genes lie within the same subtrees

19 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Hierarchical Clustering

20 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Hierarchical Clustering

21 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Hierarchical Clustering: Example

22 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Hierarchical Clustering: Example

23 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Hierarchical Clustering: Example

24 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Hierarchical Clustering: Example

25 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Hierarchical Clustering: Example

26 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Hierarchical Clustering (cont ’ d) Hierarchical Clustering is often used to reveal evolutionary history

27 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Hierarchical Clustering Algorithm 1.Hierarchical Clustering (d, n) 2. Form n clusters each with one element 3. Construct a graph T by assigning one vertex to each cluster 4. while there is more than one cluster 5. Find the two closest clusters C 1 and C 2 6. Merge C 1 and C 2 into new cluster C with |C 1 | +|C 2 | elements 7. Compute distance from C to all other clusters 8. Add a new vertex C to T and connect to vertices C 1 and C 2 9. Remove rows and columns of d corresponding to C 1 and C 2 10. Add a row and column to d corrsponding to the new cluster C 11. return T The algorithm takes a n x n distance matrix d of pairwise distances between points as an input.

28 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Hierarchical Clustering Algorithm 1.Hierarchical Clustering (d, n) 2. Form n clusters each with one element 3. Construct a graph T by assigning one vertex to each cluster 4. while there is more than one cluster 5. Find the two closest clusters C 1 and C 2 6. Merge C 1 and C 2 into new cluster C with |C 1 | +|C 2 | elements 7. Compute distance from C to all other clusters 8. Add a new vertex C to T and connect to vertices C 1 and C 2 9. Remove rows and columns of d corresponding to C 1 and C 2 10. Add a row and column to d corrsponding to the new cluster C 11. return T Different ways to define distances between clusters may lead to different clusterings

29 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Hierarchical Clustering: Recomputing Distances d min (C, C * ) = min d(x,y) for all elements x in C and y in C * Distance between two clusters is the smallest distance between any pair of their elements d avg (C, C * ) = (1 / |C * ||C|) ∑ d(x,y) for all elements x in C and y in C * Distance between two clusters is the average distance between all pairs of their elements

30 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Squared Error Distortion Given a data point v and a set of points X, define the distance from v to X d(v, X) as the (Eucledian) distance from v to the closest point from X. Given a set of n data points V={v 1 …v n } and a set of k points X, define the Squared Error Distortion d(V,X) = ∑d(v i, X) 2 / n 1 < i < n

31 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means Clustering Problem: Formulation Input: A set, V, consisting of n points and a parameter k Output: A set X consisting of k points (cluster centers) that minimizes the squared error distortion d(V,X) over all possible choices of X

32 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info 1-Means Clustering Problem: an Easy Case Input: A set, V, consisting of n points Output: A single points x (cluster center) that minimizes the squared error distortion d(V,x) over all possible choices of x

33 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means Clustering Problem: Formulation The basic step of k-means clustering is simple: Iterate until stable (= no object move group): 1.Determine the centroid coordinate 2.Determine the distance of each object to the centroids 3.Group the object based on minimum distance Ref:http://www.people.revoledu.com/k ardi/tutorial/kMean/NumericalExa mple.htmhttp://www.people.revoledu.com/k ardi/tutorial/kMean/NumericalExa mple.htm

34 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means Clustering Problem: Formulation Suppose we have several objects (4 types of medicines) and each object have two attributes or features as shown in table below. Our goal is to group these objects into K=2 group of medicine based on the two features (pH and weight index). Object attribute 1 (X): attribute 2 (Y): weight index pH Medicine A 1 1 Medicine B 2 1 Medicine C 4 3 Medicine D 5 4 Each medicine represents one point with two attributes (X, Y) that we can represent it as coordinate in an attribute space as shown in the figure on the right.

35 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means Clustering Problem: Formulation 1. Initial value of centroids : Suppose we use medicine A and medicine B as the first centroids. Let C 1 and C 2 denote the coordinate of the centroids, then C 1 =(1,1) and C 2 =(2,1).

36 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means Clustering Problem: Formulation

37 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means Clustering Problem: Formulation

38 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means Clustering Problem: Formulation

39 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means Clustering Problem: Formulation

40 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means Clustering Problem: Formulation

41 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means Clustering Problem: Formulation

42 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means Clustering Problem: Formulation Similar to other algorithm, K-mean clustering has many weaknesses: When the numbers of data are not so many, initial grouping will determine the cluster significantly. The number of cluster, k, must be determined before hand. We never know the real cluster, using the same data, if it is inputted in a different order may produce different cluster if the number of data is a few. Sensitive to initial condition. Different initial condition may produce different result of cluster. The algorithm may be trapped in the local optimum. We never know which attribute contributes more to the grouping process since we assume that each attribute has the same weight. Weakness of arithmetic mean is not robust to outliers. Very far data from the centroid may pull the centroid away from the real one. The result is circular cluster shape because based on distance.distance

43 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info 1-Means Clustering Problem: an Easy Case Input: A set, V, consisting of n points Output: A single points x (cluster center) that minimizes the squared error distortion d(V,x) over all possible choices of x 1-Means Clustering problem is easy. However, it becomes very difficult (NP-complete) for more than one center. An efficient heuristic (learn by discovering things 探索法 ) method for K-Means clustering is the Lloyd algorithm Perform two steps until either it converges to until the fluctuations become very small Assign each data point to the cluster C, corresponding to the closest cluster representative xi (1 ≦ i ≦ k) After the assignments of all n data points, compute new cluster representatives according to the center of gravity of each cluster, that is, the new cluster representative is for every cluster C

44 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means Clustering: Lloyd Algorithm 1.Lloyd Algorithm 2. Arbitrarily assign the k cluster centers 3. while the cluster centers keep changing 4. Assign each data point to the cluster C i corresponding to the closest cluster representative (center) (1 ≤ i ≤ k) 5. After the assignment of all data points, compute new cluster representatives according to the center of gravity of each cluster, that is, the new cluster representative is ∑v \ |C| for all v in C for every cluster C *This may lead to merely a locally optimal clustering rather than global minimum.

45 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info x1x1 x2x2 x3x3

46 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info x1x1 x2x2 x3x3

47 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info x1x1 x2x2 x3x3

48 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info x1x1 x2x2 x3x3

49 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Conservative K-Means Algorithm Lloyd algorithm is fast but in each iteration it moves many data points, not necessarily causing better convergence. A more conservative method would be to move one point at a time only if it improves the overall clustering cost The smaller the clustering cost of a partition of data points is the better that clustering is Different methods (e.g., the squared error distortion) can be used to measure this clustering cost

50 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info K-Means “ Greedy ” Algorithm 1.ProgressiveGreedyK-Means(k) 2.Select an arbitrary partition P into k clusters 3.while forever 4. bestChange  0 5. for every cluster C 6. for every element i not in C 7. if moving i to cluster C reduces its clustering cost 8. if (cost(P) – cost(P i  C ) > bestChange 9. bestChange  cost(P) – cost(P i  C ) 10. i *  I 11. C *  C 12. if bestChange > 0 13. Change partition P by moving i * to C * 14. else 15. return P

51 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Clique Graphs A clique is a graph with every vertex connected to every other vertex A clique graph is a graph where each connected component is a clique

52 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Transforming an Arbitrary Graph into a Clique Graphs A graph can be transformed into a clique graph by adding or removing edges

53 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Clique Graphs (cont ’ d) – REVISION – show yet another way of transformation and compare the costs. A graph can be transformed into a clique graph by adding or removing edges Example: removing two edges to make a clique graph

54 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Corrupted Cliques Problem Input: A graph G Output: The smallest number of additions and removals of edges that will transform G into a clique graph

55 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Distance Graphs Turn the distance matrix into a distance graph Genes are represented as vertices in the graph Choose a distance threshold θ If the distance between two vertices is below θ, draw an edge between them The resulting graph may contain cliques These cliques represent clusters of closely located data points!

56 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Transforming Distance Graph into Clique Graph The distance graph (threshold θ=7) is transformed into a clique graph after removing the two highlighted edges After transforming the distance graph into the clique graph, the dataset is partitioned into three clusters

57 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info Heuristics for Corrupted Clique Problem Corrupted Cliques problem is NP-Hard, some heuristics exist to approximately solve it: CAST (Cluster Affinity Search Technique): a practical and fast algorithm: CAST is based on the notion of genes close to cluster C or distant from cluster C Distance between gene i and cluster C: d(i,C) = average distance between gene i and all genes in C Gene i is close to cluster C if d(i,C)< θ and distant otherwise

58 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info CAST Algorithm 1.CAST(S, G, θ) 2. P  Ø 3. while S ≠ Ø 4. V  vertex of maximal degree in the distance graph G 5. C  {v} 6. while a close gene i not in C or distant gene i in C exists 7. Find the nearest close gene i not in C and add it to C 8. Remove the farthest distant gene i in C 9. Add cluster C to partition P 10. S  S \ C 11. Remove vertices of cluster C from the distance graph G 12. return P S – set of elements, G – distance graph, θ - distance threshold

59 An Introduction to Bioinformatics Algorithmswww.bioalgorithms.info References http://ihome.cuhk.edu.hk/~b400559/array.html#Glos sarieshttp://ihome.cuhk.edu.hk/~b400559/array.html#Glos saries http://www.umanitoba.ca/faculties/afs/plant_science/ COURSES/bioinformatics/lec12/lec12.1.htmlhttp://www.umanitoba.ca/faculties/afs/plant_science/ COURSES/bioinformatics/lec12/lec12.1.html http://www.genetics.wustl.edu/bio5488/lecture_note s_2004/microarray_2.ppt - For Clustering Examplehttp://www.genetics.wustl.edu/bio5488/lecture_note s_2004/microarray_2.ppt


Download ppt "Www.bioalgorithms.infoAn Introduction to Bioinformatics Algorithms Clustering."

Similar presentations


Ads by Google