Presentation is loading. Please wait.

Presentation is loading. Please wait.

. Sequence Alignment Tutorial #3 © Ydo Wexler & Dan Geiger.

Similar presentations


Presentation on theme: ". Sequence Alignment Tutorial #3 © Ydo Wexler & Dan Geiger."— Presentation transcript:

1 . Sequence Alignment Tutorial #3 © Ydo Wexler & Dan Geiger

2 2 Sequence Alignment - Reminder Global Alignment : Input: two sequences s 1, s 2 over the same alphabet Output: two sequences s’ 1, s’ 2 of equal length s’ 1, s’ 2 are s 1, s 2 with possibly additional gaps (‘-’). Example: u S 1 = GCGCATGGATTGAGCGA u S 2 = TGCGCCATTGATGACC A possible alignment: S’ 1 = -GCGC-ATGGATTGAGCGA S’ 2 = TGCGCCATTGAT-GACC-- Goal: How similar are two sequences s 1 and s 2

3 3 Sequence Alignment - Reminder Local Alignment : Input: two sequences s 1, s 2 over the same alphabet Output: two sequences s’ 1, s’ 2 of equal length s’ 1, s’ 2 are substrings of s 1, s 2 with possibly additional gaps (‘-’). Example: u S 1 = GCGCATGGATTGAGCGA u S 2 = TGCGCCATTGATGACC A possible alignment: S’ 1 = ATTGA-G S’ 2 = ATTGATG Goal: Find the pair of substrings in two input sequences which have the highest similarity

4 4 Alignments -GCGC-ATGGATTGAGCGA TGCGCCATTGAT-GACC-A Three elements: u Perfect matches u Mismatches u Insertions & deletions (indel)

5 5 אם לא קיים k כזה אז מספר השבירה הוא. מתקיים כמובן,. Sequence Alignment – Question מולקולת DNA היא מחרוזת סופית מעל הא"ב. יהיו ו מולקולות DNA, כאשר הן אותיות מהא"ב. מספר השבירה של הזוג (E,M) מוגדר כשלם המינימלי kכך שניתן לפרק את M ואת E לתת מחרוזות ו כך ש היא תת מחרוזת רציפה של לכל. דוגמא: M=AAAATTTAAATTTA E=AATTATA E 1 =AATT M 1 =AAAATTT E 2 =AT M 2 =AAATT E 3 =A M 3 =A הצע רעיון לאלגוריתם לחישוב מספר השבירה של (E,M) בסיבוכיות זמן O(np). הוכח את נכונות הרעיון וסיבוכיות הזמן.

6 6 ניקוד: u התאמה – 0 u אי התאמה – מינוס אינסוף u פתיחת בלוק רווחים (אלא אם הוא בקצה) – 1- u הארכת בלוק רווחים - 0 Sequence Alignment – Question פתרון: נשתמש (כמובן) ב global alignment עם מספר שינויים: u לא ינתן עונש על רווחים בקצוות u נרשה הכנסת רווחים רק ב E (ולא ב M) u נוריד ניקוד רק על פתיחת בלוק רווחים ולא על הארכתו u לא נאפשר mismatches

7 7 Sequence Alignment – Question פתרון: על מנת לממש שינויים אלה, נשתמש ב alignment with affine gaps כאשר d=1 ו e=0. נכונות: מנכונות global sequence alignment אנו יודעים כי ההתאמה שתתקבל תהיה הטובה ביותר תחת הניקוד שהגדרנו. מספר השבירה הוא מספר בלוקי הרווחים ועוד אחד (מינוס ציון ההתאמה ועוד אחד). נראה מהי התאמה זו: (נתייחס רק להתאמות שציונן סופי. אחרת, k אינסופי). u הניקוד היחיד מתקבל מפתיחת בלוק רווחים שאינו בקצה u כל רצף אותיות ב E שנמצא בין שני בלוקים כאלה מתאים לרצף ב M u הרצפים הנ"ל לא חופפים

8 8 Multiple Sequence Alignment S 1 =AGGTC S 2 =GTTCG S 3 =TGAAC Possible alignment A-TA-T GGGGGG G--G-- TTATTA -TA-TA CCCCCC -G--G- AG-AG- GTTGTT GTGGTG T-AT-A --A--A CCACCA -GC-GC

9 9 Multiple Sequence Alignment Definition: Given stings S 1, S 2, …,S k a multiple (global) alignment map them to strings S’ 1, S’ 2, …,S’ k that may contain spaces, where: 1.|S’ 1 |= |S’ 2 |=…= |S’ k | 2.The removal of spaces from S’ i leaves S i Definition: The sum-of-pairs (SP) value for a multiple global alignment A of k strings is the sum of the values of all pairwise alignments induced by A

10 10 Multiple Sequence Alignment - Example Consider the following alignment: a c - c d b - - c - a d b d a - b c d a d Using a distance function and for this alignment has a SP value of 3 3 +4 3 + 4 + 5 = 12

11 11 Multiple Sequence Alignment Given k strings of length n, there is a generalization of the dynamic programming algorithm that finds an optimal SP alignment. NP completeness: Instead of a 2-dimensional table we now have a k-dimensional table to fill. Each dimension’s size is n+1. Each entry depends on 2 k-1 adjacent entries. Complexity: O(2 k n k )

12 12 Multiple Sequence Alignment – Approximation Algorithm Polynomial time algorithm: assumption: the cost function δ is a distance function: (triangle inequality) Let D(S,T) be the value of the minimum global alignment between S and T.

13 13 Multiple Sequence Alignment – Approximation Algorithm (cont.) Polynomial time algorithm: The input is a set Γ of k strings S i. 1. Find the string S 1 that minimizes 2. Call the remaining strings S 2, …,S k. 3. Add a string to the multiple alignment that initially contains only S 1 as follows: Suppose S 1, …,S i-1 are already aligned as S’ 1, …,S’ i-1. Add S i by running dynamic programming algorithm on S’ 1 and S i to produce S’’ 1 and S’ i. Adjust S’ 2, …,S’ i-1 by adding spaces to those columns where spaces were added to get S’’ 1 from S’ 1. Replace S’ 1 by S’’ 1.

14 14 Multiple Sequence Alignment – Approximation Algorithm (cont.) Time analysis: Choosing S 1 – running dynamic programming algorithm times – O(k 2 n 2 ) When S i is added to the multiple alignment, the length of S 1 is at most in, so the time to add all k strings is

15 15 Multiple Sequence Alignment – Approximation Algorithm (cont.) Error analysis: M - The alignment produced by this algorithm. For all i, d(1,i)=D(S 1,S i ) (we performed optimal alignment between S’ 1 and S i and ) d(i,j) - the distance M induces on the pair S i,S j. M* - optimal alignment.

16 16 Multiple Sequence Alignment – Approximation Algorithm (cont.) Error analysis: Triangle inequality Definition of S 1


Download ppt ". Sequence Alignment Tutorial #3 © Ydo Wexler & Dan Geiger."

Similar presentations


Ads by Google