# Inializaon for all i j fi 0 0 f0 j 0 2 terminaon

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: s Dan Jurafsky The Needleman ­Wunsch Algorithm •  Ini'aliza'on: D(i,0) = -i * d! D(0,j) = -j * d •  Recurrence Rela'on: D(i,j)= min D(i-1,j) - d! D(i,j-1) - d! D(i-1,j-1) + s[x(i),y(j)]! •  Termina'on: D(N,M) is distance ! ! Dan Jurafsky The Needleman ­Wunsch Matrix x1 xM y1 (Note that the origin is at the upper leB.) yN Slide adapted from Seraﬁm Batzoglou Dan Jurafsky A variant of the basic algorithm: •  Maybe it is OK to have an unlimited # of gaps in the beginning and end: ----------CTATCACCTGACCTCCAGGCCGATGCCCCTTCCGGC GCGAGTTCATCTATCAC--GACCGC--GGTCG-------------•  If so, we don’t want to penalize gaps at the ends Slide from Seraﬁm Batzoglou Dan Jurafsky Diﬀerent types of overlaps Example: 2 overlapping“reads” from a sequencing project Example: Search for a mouse gene within a human chromosome Slide from Seraﬁm Batzoglou Dan Jurafsky The Overlap Detec9on variant xM yN x1 Changes: 1.  Ini'aliza'on For all i, j,! !F(i, 0) = 0! !F(0, j) = 0! 2.  Termina'on ! maxi F(i, N)! y1 FOPT = max! ! maxj F(M, j)! Slide from Seraﬁm Batzoglou Dan Jurafsky The Local Alignment Problem Given two strings x = x1……xM, y = y1……yN Find substrings x’, y’ whose similarity (op'mal global alignment value) is maximum x = aaaacccccggggXa y = Xcccgggaaccaacc Slide from Seraﬁm Batzoglou Dan Jurafsky The Smith ­Waterman algorithm Idea: Ignore badly aligning regions Modiﬁca'ons to Needleman ­Wunsch: Ini9aliza9on: F(0, j) = 0! ! ! !F(i, 0) = 0! 0 !! Itera9on: F(i, j) = max F(i – 1, j) – d! ! ! ! ! F(i, j – 1) – d! ! ! ! ! F(i – 1, j – 1) + s(xi, yj) Slide from Seraﬁm Batzoglou ! Dan Jurafsky The Smith ­Waterman algorithm Termina9on: 1.  If we want the best local alignment… FOPT = maxi,j F(i, j)...
View Full Document

## This document was uploaded on 02/14/2014.

Ask a homework question - tutors are online