Docsity

Computational Functional Genomics Lecture 14: Clustering in Bioinformatics, Study notes of Biology

Partial preview of the text

Download Computational Functional Genomics Lecture 14: Clustering in Bioinformatics and more Study notes Biology in PDF only on Docsity!

BioE 594 Computational Functional GenomicsLecture 14Genomic data-mining method 2 - clustering

Yang DaiUIC

Computational Functional Genomics

Clustering algorithms

Methods „

Sequential

Partition methods †

k-mean method

Partitioning around medoids (PAM)

Self-organizing maps (SOM)

Hierarchical

Cost function based

Others

Important tasks „

Estimate the number of clusters

Assign each point to a cluster

Assess the strength/confidence of cluster assignments forindividual observations

Assess cluster homogeneity

Computational Functional Genomics

4

Partition method - K-means clustering

A partitioning algorithm with a prefixed number

k

of

clusters, that tries to minimize the sum of within-cluster-variances

Algorithm

Randomly choose

K

points as the center of the

K

clusters

Visit each point and calculate the distances from this point to thecenter of every cluster

Assign each point to its closest cluster

Update the center of each newly formed cluster

Repeat steps (2)-(4) until there is no change to the centers (orreach the maximum cycles)

Pros

: Relatively efficient; Often terminates at a local optimum; The

global optimum may be found using techniques such as: deterministicannealing and genetic algorithms

Cons

: Applicable only when mean is defined; Need to specify

K

in

advance; Unable to handle noisy data and outliers; Not suitable todiscover clusters with non-convex shapes.

Computational Functional Genomics

K-means clustering, K=

Computational Functional Genomics

K-means clustering, K=

Computational Functional Genomics

K-means clustering in R

Use packagecclust

##load cluster package >library(cclust) ## randomly generate 150 objects > x <- rbind(matrix(rnorm(150,sd=0.3),ncol=3),+

matrix(rnorm(150,mean=1,sd=0.3),ncol=3),

matrix(rnorm(150,mean=2,sd=0.3),ncol=3))

##initial values for cluster centers are 6 >c1 <- cclust(x,6,20,verbose=TRUE,method="kmeans")Iteration:

1

Changes:

138

Iteration:

2

Changes:

8

Iteration:

3

Changes:

5

Iteration:

4

Changes:

7

Iteration:

5

Changes:

4

Iteration:

6

Changes:

4

Iteration:

7

Changes:

1

Iteration:

8

Changes:

0

##initial values for cluster centers are 3 >c2 <- cclust(x,3,20,verbose=TRUE,method="kmeans")Iteration:

1

Changes:

102

Iteration:

2

Changes:

3

Iteration:

3

Changes:

0

##plot the above results >opar <- par(mfrow = c(1,2))>plot(x, col=c1$cluster)>plot(x, col=c2$cluster)

Computational Functional Genomics

Different starts result different clusterings

x <- rbind(matrix(rnorm(150,sd=0.3),ncol=3),

matrix(rnorm(150,mean=1,sd=0.5),ncol=3),matrix(rnorm(150,mean=2,sd=0.5),ncol=3))

K=

Computational Functional Genomics Partitioning around medoids (PAM)

PAM is a partitioning method which operates on adistance matrix, e.g., Euclidean distance matrix.

Algorithm „

For a prespecified number of clusters

K

, the PAM procedure

is based on the search for

K

representative objects, or

medoids

M

m

1

m

k

), among the observations to be

clustered.

The medoids minimize the sum of the distances of theobservations to their closest medoid:

After finding a set of

K

medoids,

K

clusters are constructed

by assigning each observation to the nearest medoid.

PAM can be applied to general data types and tendsto be more robust than k-means

Computational Functional Genomics

Partitioning around medoids (PAM) – an example in R

## first load cluster package >library(cluster) ## randomly generate 25 objects, divided into two clusters

.

x <- rbind(cbind(rnorm(10,0,0.5), rnorm(10,0,0.5)),

cbind(rnorm(15,5,0.5), rnorm(15,5,0.5)))

pamx <- pam(x, 2)>pamx>summary(pamx)>plot(pamx) ## use obs. 1 & 16 as starting medoids – same result (typically) >p2m <- pam(x, 2, medoids = c(1,16))>p2m>summary(p2m)>plot(p2m) ## use obs. 1, 13 & 22 as starting medoids – three clusters >p3m <- pam(x, 3, medoids = c(1,13,22))>p3m>summary(p3m)>plot(p3m)

Computational Functional Genomics

Partitioning around medoids (PAM) – an example in R

Use randomly

selected

observations as starting medoids Use observation 1and 16 as starting

medoids

Computational Functional Genomics

Hierarchical methods

Hierarchical clustering methods produce a

tree

or

dendrogram

They avoid specifying how many clusters are appropriateby providing a partition for each

K

obtained from cutting

the tree at some level.

The tree can be built in two distinct ways „

bottom-up:

agglomerative

clustering

top-down:

divisive

clustering

Computational Functional Genomics

Agglomerative methods

Algorithm

Start with

N

clusters

At each step, merge the two closest clusters using a measure ofbetween-cluster distance which reflects the shape of theclusters. Until every point is in one cluster.

Between cluster distances (between subsets)

Single linkage

minimum distance

Complete linkage

maximum distance

Average linkage

average distance

Centroid linkage

the distance between their centroids

Ward

weight squared Euclidean distance between means

Computational Functional Genomics

Agglomerative methods in R – an example of microarray dataclustering

Experimental protocol

Screen shot of dataset in Excel file

Computational Functional Genomics

Agglomerative methods in R – an example of microarray dataclustering

Genes distinguishing ALL fromAML. The 50 genes most highlycorrelated with the ALL-AML classdistinction are shown. Each rowcorresponds to a gene, with thecolumns corresponding toexpression levels in differentsamples. Expression levels foreach gene are normalized acrossthe samples such that the mean is0 and the SD is 1. Expressionlevels greater than the mean areshaded in red, and those below themean are shaded in blue.

Reference: Golub

et al

. Molecular classification of cancer: class discovery and

class prediction by gene expression monitoring. Science. 1999 Oct15;286(5439):531-7. (http://www-genome.wi.mit.edu/mpr/data_set_ALL_AML.html)