global and local alignment - brown...
TRANSCRIPT
![Page 1: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/1.jpg)
Global and Local Alignment
![Page 2: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/2.jpg)
Sequence Alignment Overview
Input: Two (or more) sequences over the same alphabetOutput: An alignment of the two sequences
ex) Input:GCGCATTTGAGCGATGCGTTAGGGTGACCA
Output:- GCGCATTTGAGCGA - -TGCG - - TTAGGGTGACC
![Page 3: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/3.jpg)
Global Alignment Summary
• Attempts to align every residue in every sequence• Most useful when sequences you are aligning are similar and of
roughly the same size• Can use the Needleman-Wunsch algorithm to solve this
• Uses dynamic programming!
![Page 4: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/4.jpg)
Dynamic Programming
• Brute force alignment impractical because of the many different alignments possible for even small sequences
• Dynamic programming works where a larger problem is solved by first solving smaller sub-problems first
• In the context of global alignment:
• We solve for S[i,j] by first solving subproblems first (this makes more sense once we look at the pseudocode!)
![Page 5: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/5.jpg)
Needleman-Wunsch Algorithm PseudocodeM-length of sequence 1N-length of sequence 2S-dynamic programming matrix of sizeM x Nδ(xi,-)-score from aligning xi with a gapδ(-,yj)-score from aligning yj with a gapδ(xi,yj)-score from aligning xi with yj
Output: Optimal alignment score for aligning M and N
Time Complexity: O(MN)
![Page 6: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/6.jpg)
Needleman-Wunsch Algorithm as an Edit Graph• We can think of S (our matrix) as a directed graph that we fill in
from the top left corner to the bottom right corner• Each alignment corresponds to a unique path through the
graph
![Page 7: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/7.jpg)
Example of Runthrough of Algorithm
Remembertorecordwhichedge(s)ledtothescoreatthegivennodesowecantracebacklater
![Page 8: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/8.jpg)
Example of Traceback
Start from the bottom right corner and traceback from there
![Page 9: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/9.jpg)
Local Alignment
• Very similar to global alignment!• Instead of having to align every single residue, local alignment
aligns arbitrary-length segments of the sequences, with no penalty for unaligned sequences
• Biological usefulness: If we have two dissimilar sequences and want to see if there is a conserved gene or region between the two
![Page 10: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/10.jpg)
Smith Waterman Algorithm
• Use the Smith-Waterman algorithm to calculate local alignment• Very similar to global alignment• Only have a change in recurrence relation
![Page 11: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/11.jpg)
Smith Waterman Algorithm Pseudocode
![Page 12: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/12.jpg)
Local Alignment Runthrough
![Page 13: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/13.jpg)
Local Alignment Traceback
![Page 14: global and local alignment - Brown Universitycs.brown.edu/courses/csci1810/resources/global_local_alignment.pdf · Local Alignment •Very similar to global alignment! •Instead](https://reader035.vdocuments.site/reader035/viewer/2022081522/5f02ef607e708231d406bd04/html5/thumbnails/14.jpg)
Graphics Source
• https://www.cs.umd.edu/class/fall2011/cmsc858s/Alignment.pdf