Local Alignment - Carnegie Mellon School of Computer Science

[Pages:16]Local Alignment

CMSC 423

Representing edits as alignments

prin-ciple |||| |||XX prinncipal (1 gap, 2 mm)

misspell ||| |||| mis-pell (1 gap)

aa-bb-ccaabb |X || | | | ababbbc-a-b(5 gaps, 1 mm)

prin-cip-le |||| ||| | prinncipal(3 gaps, 0 mm)

prehistoric ||||||||

---historic (3 gaps)

al-go-rithm|| XX ||X | alKhwariz-mi (4 gaps, 3 mm)

Maximization vs. Minimization

Edit distance:

Sequence Similarity: replace min with a max and negate the parameters. gap penalty gap benefit (probably negative) cost score

s

Local Alignment

t Local alignment between s and t: Best alignment between a subsequence of s and a subsequence of t.

Motivation: Many genes are composed of domains, which are subsequences that perform a particular function.

Recall: Global Alignment Matrix

OPT(i,j) contains the score for the best alignment between:

the first i characters of string x [prefix i of x] the first j character of string y [prefix j of y]

OPT(i-1, j)

9 9g

8 8g

7 7g

6 6g

j y

5 5g

4 4g

OPT(i, j) OPT(i, j-1)

3 3g

2 2g 1 1g

OPT(i-1, j-1)

0 0 1g 2g 3g 4g 5g 6g 7g 8g 9g 10g 11g 12g

0 1 2 3 4 5 6 7 8 9 10 11 12

ix

Local Alignment

New meaning of entry of matrix entry:

A[i, j] = best score between: some suffix of x[1...i] some suffix of y[1...j]

y C9 0

Best alignment between a suffix of x[1..5] and a suffix of y[1..5]

A8 0

G7 0

T6 0

T5 0

G4 0

C3 0

A2 0

A1 0

00000000000000

0 1 2 3 4 5 6 7 8 9 10 11 12

AAGGT A TGAA T C

x

How do we fill in the local

alignment matrix?

A i, [

j ]

=

max

8 >>>>>:A[i

j

1] 1, j] 1, j

+ gap + gap

1] +

(1) (2)

match(i,

j)

(3)

0

(1), (2), and (3): same cases as before:

gap in x, gap in y, match x and y

New case: 0 allows you to say the best alignment between a suffix of x and a suffix of y is the empty alignment.

Lets us "start over"

y C9 0

Best alignment between a suffix of x[1..5] and a suffix of y[1..5]

A8 0

G7 0

T6 0

T5 0

G4 0

C3 0

A2 0

A1 0

00000000000000

0 1 2 3 4 5 6 7 8 9 10 11 12

AAGGT A TGAA T C

x

Local Alignment

? Initialize first row and first column to be 0.

? The score of the best local alignment is the largest value

in the entire array.

? To find the actual local alignment:

? start at an entry with the maximum score ? traceback as usual ? stop when we reach an entry with a score of 0

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download