paint
Comp. Genomics
Recitation 10
Clustering and analysis of microarrays
paint
Exercise 1
A microarray that contains probes for allthe N metabolic enzymes of the bacteriumD.Angerous  was used for the followingtime-series microarray experiment:  Thebacteria population were exposed to adrug, and gene expression was measuredevery hour for M hours.
The expression values are discretized to{-1,0,1}
paint
Exercise 1
Find the longest expression pattern that iscommon to at least k enzymes.  Eachenzyme may start the pattern at adifferent time.
T7
T6
T5
T4
T3
T2
T1
-1
1
0
-1
1
0
-1
E1
1
0
-1
1
0
-1
-1
E2
0
-1
1
0
-1
-1
-1
E3
0
0
0
0
0
0
0
E4
1
1
0
1
1
1
1
E5
-1
0
-1
-1
-1
-1
1
E6
K=3
paint
Solution
Treat each expression vector as a string
Create a generalized suffix tree O(MN)
Find longest k-common substring
paint
Exercise 2
Expression of N genes was measuredunder a certain condition using amicroarray.
No discretization was performed.
Give a polynomial time algorithm forclustering these genes into exactly kclusters.
The objective function is
paint
Pictorially
G1
G2
G3
G4
G5
G6
Expression level
If {G3,G4,G5}is a cluster, its contribution to the
objective function is d(G3,G5)
paint
Solution
Create a weighted directed graph, everygene is a node and the edge from i to j
has weight d(i,j-1) if i’s expression islower than j’s (otherwise ∞)
G1
G2
G3
G4
G5
G6
The path in the graph that corresponds to this clustering
is G1G3G6.  The value of the objective function is
 d(G1,G2)+d(G3,G5)+0
paint
Solution
Next:
Find the shortest path that visits exactly knodes
Dynamic programming:
Start from k because if l<k Pl(k-1)=∞
paint
Exercise 3
A microarray experiment with N genesand M conditions was conducted
Describe a polynomial algorithm thatdetermines whether the genes can beclustered into 2 clusters such that themaximum distance d(Gi,Gj) in each cluster< W
paint
Illustration
0 1 1
0 0 1
111
1 1 0
W=2
G1
G2
G3
G4
paint
Solution
Create a graph with a node for every gene
Add an edge (i,j) if d(i,j)> W
Check if the resulting graph is bipartite:Run BFS, if you discover an edge (u,v) toa gray node and the depths of u and v areboth even or both odd, answer: “no”.
paint
Solution
Not Bipartite
paint
Exercise 4
We are given a microarray with N genesand M experiments
We want to cluster the genes into kclusters such that the distance betweengenes that belong to the same cluster willbe < W
Can you give a polynomial algorithm thatsolves this problem?
paint
Solution
Probably not
More specifically, if we could solve thisproblem in polynomial time, we couldsolve a large class of problem that arewidely believed to be unsolvable inpolynomial time
paint
Solution
How can we show that we can probablynot find a solution in polynomial time?
We will take a problem for which this hasalready been shown
We will construct a polynomial timereduction to our problem
So, if our problem could be solvedefficiently the “hard” problem could alsobe solved efficiently
paint
Graph description
The following graph can describe ourproblem:
G1
G2
G3
G6
G5
G4
There’s an edge (Gi,Gj) ifthe distance between Gi andGj is less than W
paint
Graph description
Clustering with k=3:
paint
3COL
3-Colorability:  Given a graph G, can we dyeits vertices with 3 different colors such thatno two adjacent nodes have the samecolor?
paint
Comparing the problems
What is common to both these problems?
In both we “cluster” the nodes
What are the differences?
First, in 3COL there are only 3 clustersinstead of k
Second, the elements that belong to thesame group in 3COL must not have edgesbetween them
paint
Reduction
Now that we understand the differences,we can take a graph G that is an input to3COL, and transform it to a graph G’ anda constant k that are the input to the k-clustering problem
We assume that we have a polynomial k-clustering algorithm, and we apply it to(G’,k) and translate the solution to 3COL
paint
Reduction
Given the first difference that we noted,what should be the value of k?
We set k to 3, i.e. the algorithm shouldfind exactly 3 clusters
How do we change G to get G’?
G’ has the complement edges of G
paint
Example
paint
Proof
 Suppose that G is 3 colorable.  LetV1,V2,V3 be the groups of nodes that canbe colored by distinct colors.  There areno edges between any pair of nodes in V1,and therefore it forms a legal cluster in G’.Similarly, the nodes of V2 and V3 formclusters. Since V1UV2UVcontains all thenodes all the genes are clustered in the 3corresponding clusters.
paint
Proof, second direction
Suppose that G’ contains a clustering to 3legal clusters.  These clusters correspond to3 nodes sets in G such that within each setthere are no edges between pairs of nodes.Therefore, assigning a different color toevery set is a 3-coloring.
paint
HW  2 question 5
Uniform lifted alignment – alignment inwhich for each level all string are eitherlifted from right or left.
Prove that the optimal uniform liftedalignment has cost at most twice of theoptimal alignment tree.
Give a polynomial algorithm to find theoptimal uniform lifted alignment.
paint
HW 2 question 5
Uniform lifted alignment, proof:
Assume we had the optimal tree T*.
Transform it in the following way:
To assign string at level k, consider:
Pick the minimal sum.
paint
HW 2 – question 5 – cont’d
Assign each‘non-zero’edge (T,S) toa path in theoptimal tree:
The path fromleaf (T) tonode (S*).
S (S*)
T
S
T
Together, these paths cover all edges of the tree.
paint
HW 2 – question 5 – cont’d
By triangle inequality:
D(S, T) ≤
 D(S, S*) + D(S*, T)
S (S*)
T
S
T
By choice of left/right:
Σs D(S,S*)+D(S*,T) ≤
Σs D(S*,T)+D(S*,T) =
Σs 2D(S*,T)
=> One-sided tree with cost at most twice the optimal.
paint
HW 2 – question 5 – cont’d
Algorithm:
Preprocess pairwise sequence distances.
Try all different assignments for a left/rightfor each level, and pick the minimal one.
Running time (n sequences of length m):
Proprocessing: O(m2n2).
Height h, different assignment 2h.
Calculation cost of tree O(n).