pairwise alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · pairwise...
TRANSCRIPT
![Page 1: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/1.jpg)
Pairwise Alignment
Guan-Shieng Huang
Dept. of CSIE, NCNU
Pairwise Alignment – p.1/55
![Page 2: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/2.jpg)
Approach
1. Problem definition
2. Computational method (algorithms)
3. Complexity and performance
Pairwise Alignment – p.2/55
![Page 3: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/3.jpg)
Motivations
• Reconstructing long sequences of DNA formoverlapping sequence fragments
• Determining physical and genetic maps fromprobe data under various experimentprotocols
• Database searching
Pairwise Alignment – p.3/55
![Page 4: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/4.jpg)
• Comparing two of more sequences forsimilarities
• Protein structure prediction (building profiles)• Comparing the same gene sequenced by two
different labs
Pairwise Alignment – p.4/55
![Page 5: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/5.jpg)
Similarity & Difference
1. Common Ancestor Assumption
2. Mutation:(a) substitution (transition, transversion)(b) deletion(c) insertion
We use indel to refer to deletion or insertion.
Pairwise Alignment – p.5/55
![Page 6: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/6.jpg)
What is the difference between acctga andagcta?
acctgaagctgaagct - a
Pairwise Alignment – p.6/55
![Page 7: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/7.jpg)
Key Issues
1. notion of similarity/difference
2. the scoring system used to rank alignments
3. the algorithm used to find optimal scoringalignment
4. the statistical method used to evaluate thesignificance of an alignment score
Pairwise Alignment – p.7/55
![Page 8: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/8.jpg)
Edit Distance
Measure similarity by
1. substitution: −1
2. indel: −2
3. match: +1
a c c t g aa g c t - a1 -1 1 1 -2 1 = 1
Pairwise Alignment – p.8/55
![Page 9: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/9.jpg)
a c c t g aa - g c t a1 -2 -1 -1 -1 1 = −3
a c c t g a- a g c t a
-2 -1 -1 -1 -1 1 = −5
Pairwise Alignment – p.9/55
![Page 10: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/10.jpg)
x: x1x2x3 . . . xm
y: y1y2y3 . . . yn
Alphabet:• Σ = {A,G,C, T} for DNA sequence
• Σ = {A,G,C, U} for RNA sequence
• Σ = {A,C,D,E, F,G,H, I,K, L,
M,N, P,Q,R, S, T, V,W, Y } for proteins
Pairwise Alignment – p.10/55
![Page 11: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/11.jpg)
s(a, b): the score to substitute a by b
s(a,−): delete a
s(−, b): insert b
Pairwise Alignment – p.11/55
![Page 12: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/12.jpg)
Nomenclature
BIOLOGY COMPUTER SCIENCE- sequence - string, word- subsequence - substring (contiguous)- N/A - subsequence- N/A - exact matching- alignment - inexact matching
Pairwise Alignment – p.12/55
![Page 13: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/13.jpg)
Algorithm for PairwiseAlignment
To find the best alignment (with the highestscore) through
• Brute-force• Dynamic programming
Pairwise Alignment – p.13/55
![Page 14: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/14.jpg)
Brute-force Algorithm
Try all possible alignments of x and y.
F (m, n) = F (m − 1, n) + F (m, n − 1) + F (m − 1, n − 1)
k
l
=
k − 1
l − 1
+
k − 1
l
m + n
m
=
m + n − 1
m − 1
+
m + n − 1
m
C(m, n) = C(m − 1, n) + C(m, n − 1)
∴ F (m, n) ≥ C(m, n) =
m + n
m
,
2n
n
'22n
√πn
.
Pairwise Alignment – p.14/55
![Page 15: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/15.jpg)
Dynamic Programming Approach
F (i, j): the score for the best alignment betweenx1 . . . xi and y1 . . . yj.
F (i, j) = max
F (i − 1, j − 1) + 1, xi = yi (match)
F (i − 1, j − 1) − 1, xi 6= yi (substitution)
F (i − 1, j) − 2, align xi with a gap
F (i, j − 1) − 2, align yj with a gap
Pairwise Alignment – p.15/55
![Page 16: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/16.jpg)
{
x1x2 . . . xi−1 xi
y1y2 . . . yj−1 yj
⇒ F (i − 1, j − 1) + s(xi, yi)
{
x1x2 . . . xi−1 xi
y1y2 . . . yj −⇒ F (i − 1, j) − d
{
x1x2 . . . xi −
y1y2 . . . yj−1 yj
⇒ F (i, j − 1) − d
Pairwise Alignment – p.16/55
![Page 17: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/17.jpg)
Alignment Graph
F (i − 1, j − 1) F (i − 1, j)
F (i, j − 1) F (i, j)
+s(xi , y
j )
−d
−d
Initial value:
F (0, 0) = 0, F (0, j) = −jd, F (i, 0) = −id.
Pairwise Alignment – p.17/55
![Page 18: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/18.jpg)
Example- a c c t g a
- 0 -2 -4 -6 -8 -10 -12
a -2 1 -1 -3 -5 -7 -9
g -4 -1 0 -2 -4 -4 -6
c -6 -3 0 1 -1 -3 -5
t -8 -5 -2 -1 2 0 -2
a -10 -7 -4 -3 0 1 1
Pairwise Alignment – p.18/55
![Page 19: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/19.jpg)
Example- a c c t g a
- 0 -2 -4 -6 -8 -10 -12
a -2 1 -1 -3 -5 -7 -9
g -4 -1 0 -2 -4 -4 -6
c -6 -3 0 1 -1 -3 -5
t -8 -5 -2 -1 2 0 -2
a -10 -7 -4 -3 0 1 1backtrace
Pairwise Alignment – p.19/55
![Page 20: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/20.jpg)
a c c t g aa g c t - a
Pairwise Alignment – p.20/55
![Page 21: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/21.jpg)
Complexity
1. time = O(mn)
2. space= O(mn) if we need to find out theoptimal alignment
The problem for space is more serious when m
and n are very large.
Pairwise Alignment – p.21/55
![Page 22: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/22.jpg)
Linear-space AlignmentAlgorithm
B(i, j): the best alignment score of the suffixesxm−i+1 . . . xm and yn−j+1 . . . yn
F (i, j): forward matrix, B(i, j): backward matrixThen
F (m,n) = max0≤k≤n
{F (m
2, k) + B(
m
2, n − k)}.
m2
m2
k n − k
Pairwise Alignment – p.22/55
![Page 23: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/23.jpg)
Algorithm
1. Compute F while saving the m2
-th row.
2. Compute B while saving the m2
-th row.
3. Find the column k∗ such that
F (m
2, k∗) + B(
m
2, n − k∗) = F (m,n).
4. Recursively partition the problem to two sub-problems:
(a) Find the path from (0, 0) to (m2, k∗).
(b) Find the path from (m2, k∗) to (m,n).
Pairwise Alignment – p.23/55
![Page 24: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/24.jpg)
Example- a c c t g a
- 0 -2 -4 -6 -8 -10 -12
a -2 1 -1 -3 -5 -7 -9
g -4 -1 0 -2 -4 -4 -6
c -6 -3 0 1 -1 -3 -5
t -8 -5 -2 -1 2 0 -2
a -10 -7 -4 -3 0 1 1(F (i, j) matrix)
Pairwise Alignment – p.24/55
![Page 25: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/25.jpg)
- a g t c c a
- 0 -2 -4 -6 -8 -10 -12
a -2 1 -1 -3 -5 -7 -9
t -4 -1 0 0 -2 -4 -6
c -6 -3 -2 -1 1 -1 -3
g -8 -5 -2 -3 -2 0 -2
a -10 -7 -4 -3 -4 -2 1(B(i, j) matrix)
Pairwise Alignment – p.25/55
![Page 26: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/26.jpg)
-4 -1 0 -2 -4 -4 -6
-6 -3 -2 -1 1 -1 -3
F (m
2, k∗) + B(
m
2, n − k∗) = F (m,n).
In this case, F (m,n) = 1 and k∗ = 2.
Hence, the best alignment of (acctga,agcta) is the
concatenation of (ac,ag) and (ctga,cta).
Pairwise Alignment – p.26/55
![Page 27: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/27.jpg)
Analysis of Complexity
Clearly, the required space is O(min(m,n)). Fortime complexity, let T (m,n) be the time bound ofthe algorithm.Hence, we have
T (m,n) = T (bm
2c, k) + T (d
m
2e, n − k) + O(mn)
for some k.
Pairwise Alignment – p.27/55
![Page 28: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/28.jpg)
T (m,n) = T (m
2, k) + T (
m
2, n − k) + cmn)
for some k.Suppose T (m,n) = αmn, then the right handside becomes
αm
2· k + α
m
2· (n − k) + cmn =
αmn
2+ cmn.
Let α = 2c, then it equals to the left-hand side.
Pairwise Alignment – p.28/55
![Page 29: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/29.jpg)
For more information on linear-space algorithmsin pairwise alignment, seeChao, K. M., Hardison, R. C., and Miller, W.1994. Recent developments in linear-spacealignment methods: a survey. Journal ofComputational Biology, 1:271–291.
Pairwise Alignment – p.29/55
![Page 30: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/30.jpg)
Revisiting Dynamic Programming
• Principle of optimality• Recurrence• Bottom up
Pairwise Alignment – p.30/55
![Page 31: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/31.jpg)
Substitution matrices
• Suppose we have two models:1. random model2. match model
• Given any two aligned sequencesx = x1 x2 . . . xn
y = y1 y2 . . . yn
where xi is aligned with yi.
Pairwise Alignment – p.31/55
![Page 32: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/32.jpg)
• In random model R, we suppose each letter a occursindependently with some frequency qa. Hence,
Pr(x, y|R) =∏
i
qxi
∏
j
qyj.
• In match model M, letters a and b are aligned with jointprobability pab. Suppose residues a and b have beenderived indep. from some unknown residue c. Hence,
Pr(x, y|M) =∏
i
pxiyi.
Pairwise Alignment – p.32/55
![Page 33: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/33.jpg)
• Define the odds ratio as
Pr(x, y|M)
Pr(x, y|R)=
∏
i pxiyi∏
i qxi
∏
j qyj
=∏
i
pxiyi
qxiqyi
.
• The log-odds ratio:
S =∑
i
s(xi, yi) where s(a, b) = log(pab
qaqb
).
• S > 0 means that x, y are more likely to be an instanceof the match model. (Maximum Likelihood)
• BLOSUM & PAM matrices for proteins
Pairwise Alignment – p.33/55
![Page 34: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/34.jpg)
PAM matrices
1. Dayhoff, Schwartz, Orcutt (1978)
2. The most widely used matrix is PAM250.
Pairwise Alignment – p.34/55
![Page 35: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/35.jpg)
Pairwise Alignment – p.35/55
![Page 36: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/36.jpg)
BLOSUM Matrices
1. Henikoff & Henikoff (1992)
2. Derived from a set of aligned, ungappedregions from protein families called theBLOCKS database.
3. BLOSUM62 is the standard for ungappedmatching.
4. BLOSUM50 is better for alignment with gaps.
Pairwise Alignment – p.36/55
![Page 37: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/37.jpg)
BLOSUM50
Pairwise Alignment – p.37/55
![Page 38: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/38.jpg)
Pairwise Alignment Problems
1. Global alignment (Needleman & Wunsch,1970)
2. Local alignment (Smith-Waterman, 1981)
3. End-space free alignment
4. Gap penality
The version we currently used was due to Gotoh
(1982).
Pairwise Alignment – p.38/55
![Page 39: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/39.jpg)
Global Alignment
Given two sequences x and y, what is the maxi-
mum similarity between them? Find a best align-
ment.
Pairwise Alignment – p.39/55
![Page 40: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/40.jpg)
Local Alignment
Given two sequences x and y, what is the maxi-
mum similarity between a subsequence of x and
a subsequence of y? Find most similar subse-
quences.
Pairwise Alignment – p.40/55
![Page 41: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/41.jpg)
End-space Free Alignment
or
Pairwise Alignment – p.41/55
![Page 42: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/42.jpg)
Global Alignment
F (i, j) = max
F (i − 1, j − 1) + s(xi, yj),
F (i − 1, j) − d,
F (i, j − 1) − d.
with initial value
F (0, 0) = 0, F (0, j) = −jd, F (i, 0) = −id.
And F (m,n) is the score.
Pairwise Alignment – p.42/55
![Page 43: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/43.jpg)
Example
Pairwise Alignment – p.43/55
![Page 44: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/44.jpg)
Local Alignment
Motivation:• Ignore stretches of non-coding DNA.• Protein domains
Pairwise Alignment – p.44/55
![Page 45: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/45.jpg)
Local Alignment
F (i, j) = max
0,
F (i − 1, j − 1) + s(xi, yj),
F (i − 1, j) − d,
F (i, j − 1) − d.
with initial value F (0, 0) = F (0, j) = F (i, 0) = 0. And the
highest value of F (i, j) over the whole matrix is the score.
Pairwise Alignment – p.45/55
![Page 46: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/46.jpg)
Example
Pairwise Alignment – p.46/55
![Page 47: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/47.jpg)
Ends-free Alignment
Motivation:• shotgun sequence assembly
Pairwise Alignment – p.47/55
![Page 48: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/48.jpg)
Ends-free Alignment
F (i, j) = max
F (i − 1, j − 1) + s(xi, yj),
F (i − 1, j) − d,
F (i, j − 1) − d.
with initial value
F (0, 0) = F (0, j) = F (i, 0) = 0.
And the highest value of F (i, j) in the last column F (i∗, n)
or the last row F (m, j∗) is the score.
Pairwise Alignment – p.48/55
![Page 49: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/49.jpg)
Example
Pairwise Alignment – p.49/55
![Page 50: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/50.jpg)
Complexity
All of the above algorithms can be implemented
in time O(mn) and in space O(m + n).
Pairwise Alignment – p.50/55
![Page 51: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/51.jpg)
Gap Penality
• A gap is any maximal consecutive run ofspaces in an alignment.
• The length of a gap is the number of indeloperations in it.
a t t c - - g a - t g g a c ca - - c g t g a t t - - - c c
Pairwise Alignment – p.51/55
![Page 52: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/52.jpg)
Motivation:• Insertion or deletion of an entire sequence
often occurs as a single mutation event.• Two protein sequences might be relatively
similar over several intervals.• cDNA: the complement of mRNA
Pairwise Alignment – p.52/55
![Page 53: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/53.jpg)
Gap Penality Models
1. constant gap penalty model: Wg × #gaps
2. affine gap penalty model: (y = ax + b)Wg × #gaps + Ws × #spaces
3. convex gap penalty model: Wg + log(q) whereq is the length of the gap.
4. arbitrary gap penalty model
Wg: gap-open penalty, Ws: gap-extension penalty
Pairwise Alignment – p.53/55
![Page 54: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/54.jpg)
Complexity
1. constant gap penalty model:Time= O(mn)
2. affine gap penalty model:Time= O(mn)
3. convex gap penalty model:Time= O(mn lg(m + n))
4. arbitrary gap penalty model:Time = O(mn(m + n))
Pairwise Alignment – p.54/55
![Page 55: Pairwise Alignmentstaffweb.ncnu.edu.tw/shieng/pairwise_alignment.pdf · 2003. 9. 25. · Pairwise Alignment Problems 1. Global alignment (Needleman & Wunsch, 1970) 2. Local alignment](https://reader035.vdocuments.site/reader035/viewer/2022081403/60aa8dbeaf93536e85738a56/html5/thumbnails/55.jpg)
Conclusion
Pairwise Alignment – p.55/55