Local Alignment: Smith-Waterman algorithm

Similar documents
Pairwise alignment using HMMs

CISC 889 Bioinformatics (Spring 2004) Sequence pairwise alignment (I)

Bioinformatics (GLOBEX, Summer 2015) Pairwise sequence alignment

Pairwise Alignment. Guan-Shieng Huang. Dept. of CSIE, NCNU. Pairwise Alignment p.1/55

Pairwise sequence alignment

Pairwise alignment. 2.1 Introduction GSAQVKGHGKKVADALTNAVAHVDDMPNALSALSD----LHAHKL

Moreover, the circular logic

Sara C. Madeira. Universidade da Beira Interior. (Thanks to Ana Teresa Freitas, IST for useful resources on this subject)

20 Grundlagen der Bioinformatik, SS 08, D. Huson, May 27, Global and local alignment of two sequences using dynamic programming

Algorithms in Bioinformatics FOUR Pairwise Sequence Alignment. Pairwise Sequence Alignment. Convention: DNA Sequences 5. Sequence Alignment

Sequence Alignments. Dynamic programming approaches, scoring, and significance. Lucy Skrabanek ICB, WMC January 31, 2013

Sequence comparison: Score matrices

Sequence analysis and Genomics

Sequence comparison: Score matrices. Genome 559: Introduction to Statistical and Computational Genomics Prof. James H. Thomas

Sequence comparison: Score matrices. Genome 559: Introduction to Statistical and Computational Genomics Prof. James H. Thomas

Algorithms in Bioinformatics

Sequence analysis and comparison

8 Grundlagen der Bioinformatik, SS 09, D. Huson, April 28, 2009

Lecture 2, 5/12/2001: Local alignment the Smith-Waterman algorithm. Alignment scoring schemes and theory: substitution matrices and gap models

Practical considerations of working with sequencing data

Sequence Alignment: A General Overview. COMP Fall 2010 Luay Nakhleh, Rice University

Pairwise & Multiple sequence alignments

Pairwise alignment, Gunnar Klau, November 9, 2005, 16:

Lecture 2: Pairwise Alignment. CG Ron Shamir

Multiple Sequence Alignment using Profile HMM

3. SEQUENCE ANALYSIS BIOINFORMATICS COURSE MTAT

8 Grundlagen der Bioinformatik, SoSe 11, D. Huson, April 18, 2011

Bioinformatics for Computer Scientists (Part 2 Sequence Alignment) Sepp Hochreiter

THEORY. Based on sequence Length According to the length of sequence being compared it is of following two types

Computational Biology

Sequence Alignment (chapter 6)

C E N T R. Introduction to bioinformatics 2007 E B I O I N F O R M A T I C S V U F O R I N T. Lecture 5 G R A T I V. Pair-wise Sequence Alignment

Pairwise sequence alignments

Pairwise sequence alignment and pair hidden Markov models

Sequence Analysis '17 -- lecture 7

Hidden Markov Models

Biochemistry 324 Bioinformatics. Pairwise sequence alignment

Pairwise sequence alignments. Vassilios Ioannidis (From Volker Flegel )

Quantifying sequence similarity

An Introduction to Bioinformatics Algorithms Hidden Markov Models

Pairwise Sequence Alignment

Large-Scale Genomic Surveys

Homology Modeling (Comparative Structure Modeling) GBCB 5874: Problem Solving in GBCB

Evolution. CT Amemiya et al. Nature 496, (2013) doi: /nature12027

Sequence Comparison. mouse human

String Matching Problem

Introduction to Computation & Pairwise Alignment

An Introduction to Sequence Similarity ( Homology ) Searching

EECS730: Introduction to Bioinformatics

Exercise 5. Sequence Profiles & BLAST

1.5 Sequence alignment

HMMs and biological sequence analysis

bioinformatics 1 -- lecture 7

Alignment principles and homology searching using (PSI-)BLAST. Jaap Heringa Centre for Integrative Bioinformatics VU (IBIVU)

Local Alignment Statistics

Whole Genome Alignments and Synteny Maps

Algorithms in Bioinformatics I, ZBIT, Uni Tübingen, Daniel Huson, WS 2003/4 1

Stephen Scott.

BIO 285/CSCI 285/MATH 285 Bioinformatics Programming Lecture 8 Pairwise Sequence Alignment 2 And Python Function Instructor: Lei Qian Fisk University

Bioinformatics and BLAST

BINF 730. DNA Sequence Alignment Why?

Substitution matrices

Single alignment: Substitution Matrix. 16 march 2017

Week 10: Homology Modelling (II) - HHpred

2 Pairwise alignment. 2.1 References. 2.2 Importance of sequence alignment. Introduction to the pairwise sequence alignment problem.

Background: comparative genomics. Sequence similarity. Homologs. Similarity vs homology (2) Similarity vs homology. Sequence Alignment (chapter 6)

Introduction to Bioinformatics Algorithms Homework 3 Solution

Lecture 5,6 Local sequence alignment

Tools and Algorithms in Bioinformatics

Chapter 5. Proteomics and the analysis of protein sequence Ⅱ

Sequence Alignment: Scoring Schemes. COMP 571 Luay Nakhleh, Rice University

Sequence Database Search Techniques I: Blast and PatternHunter tools

EECS730: Introduction to Bioinformatics

Global alignments - review

Hidden Markov Models

Bioinformatics. Scoring Matrices. David Gilbert Bioinformatics Research Centre

Module: Sequence Alignment Theory and Applications Session: Introduction to Searching and Sequence Alignment

Hidden Markov Models. x 1 x 2 x 3 x K

In-Depth Assessment of Local Sequence Alignment

Pair Hidden Markov Models

Motivating the need for optimal sequence alignments...

Tools and Algorithms in Bioinformatics

Evolutionary Models. Evolutionary Models

Introduction to Bioinformatics

BLAST: Target frequencies and information content Dannie Durand

Sequence Comparison: Local Alignment. Genome 373 Genomic Informatics Elhanan Borenstein

Outline DP paradigm Discrete optimisation Viterbi algorithm DP: 0 1 Knapsack. Dynamic Programming. Georgy Gimel farb

Introduction to sequence alignment. Local alignment the Smith-Waterman algorithm

Collected Works of Charles Dickens

Analysis and Design of Algorithms Dynamic Programming

CISC 889 Bioinformatics (Spring 2004) Hidden Markov Models (II)

BIOINFORMATICS: An Introduction

Hidden Markov Models. Main source: Durbin et al., Biological Sequence Alignment (Cambridge, 98)

Lecture 13. More dynamic programming! Longest Common Subsequences, Knapsack, and (if time) independent sets in trees.

Hidden Markov Models

Similarity searching summary (2)

Aside: Golden Ratio. Golden Ratio: A universal law. Golden ratio φ = lim n = 1+ b n = a n 1. a n+1 = a n + b n, a n+b n a n

Algorithms in Bioinformatics: A Practical Introduction. Sequence Similarity

Similarity or Identity? When are molecules similar?

First generation sequencing and pairwise alignment (High-tech, not high throughput) Analysis of Biological Sequences

Transcription:

Local Alignment: Smith-Waterman algorithm Example: a shared common domain of two protein sequences; extended sections of genomic DNA sequence. Sensitive to detect similarity in highly diverged sequences. Algorithm: similar to global alignment with modified boundary conditions and recurrence rules. The top row and left column are now filled with 0. If the (sub-)alignment score becomes negative, restart the search: F (i, j) =max 0, F (i 1,j 1) + s(x i,y j ), F (i 1,j) d, F (i, j 1) d. Traceback: from the maximum of F (i, j) in the whole matrix to the first 0. Example: the optimal local alignment between HEAGAWGHEE and PAWHEAE is AWGHE::AW-HE. Issue: In gapped alignments, the expected score for a random match may be positive. Nam Tran 1

Example: repeated domains in proteins. Repeated matches Asymetric alignment: finding multiple (non-overlapping) matches of one sequence in the other. We want each match s score to be greater than T. The alignment score is the sum of the match scores substracted by T : score(alignment) = i(score(match i ) T ). Boundary conditions: F (0, 0) = 0. F (i, 0) = max F (i 1, 0), F (i 1,j) T,j =1,..., m; Recurrence rules: F (i, j) =max F (i, 0), F (i 1,j 1) + s(x i,y j ), F (i 1,j) d, F (i, j 1) d. F (i, 0) is the score of optimal alignment of y 1..m to x 1...(i 1). Nam Tran 2

The best alignment score is F (n +1, 0). Traceback from cell (n +1, 0) until meet 0. Complexity is still O(nm). Increasing T may exclude matches. Decreasing T may split them. Dilemma: a match of score T flanked by two matches of high positive scores. Nam Tran 3

Overlap matches Example: when comparing fragments of genomic DNA sequence to each other, one sequence may overlap the other, partially or completely. This is similar to global alignment, except for overhaning ends. An alignment will start from the top or left border of the matrix, and finishes on the right or bottom border. Boundary conditions: F (i, j) =0ifi =0orj =0. Recurrence rules like those of the global alignment. Repeat version: F (i, 0) = max F (i, j) = max F (i 1, 0), F (i 1,j) T ; j = m if i n, otherwise j =1..m; F (i 1,j 1) + s(x i,y j ), F (i 1,j) d, F (i, j 1) d. Nam Tran 4

Hybrid match conditions Variants can be formulated by changing boundary conditions and recurrence rules. Example 1: to find mutiple matches of y that appear in tandem copies, we use recurrence rules in the previous slide with a slight modification. F (i, 1) = max F (i 1, 0) + s(x i,y 1 ), F (i 1,n)+s(x i,y 1 ), F (i 1, 1) d, F (i, 0) d. Example 2: finding a match starting at the beginning of both sequences, ending at any point. - setting only F (0, 0) = 0. - using global recurrence rules, find maximum over the whole matrix. Ideally, we should be able to use algorithm designed with specific prior knowledge. In practice, people use good implementations available for a few standard cases then postprocess the results. Nam Tran 5

Other models Up to this point, we use the gap penalty γ(g) = g d. Affine gap score penalises gap extension less than gap opening: γ(g) = d (g 1) e, where e<d. With general gap penalty γ(g): F (i, j) =max F (i 1,j 1) + s(x i,y j ), F (k, j)+γ(i k),k =0,..., i 1, F (i, k)+γ(j k),k =0,..., j 1. Complexity is O(n 3 ) with general gap function, can be reduced to O(n 2 )ifk can be bounded. Nam Tran 6

O(n 2 ) implementation for affine gap scores M(i, j), or I x (i, j), or I y (i, j) is respectively the best score given that x i is aligned to y j,orx i to a gap, or y j to a gap. The recurrence rules: M(i, j) = max I x (i, j) = max I y (i, j) = max M(i 1,j 1) + s(x i,y j ), I x (i 1,j 1) + s(x i,y j ), I y (i 1,j 1) + s(x i,y j ); M(i 1,j) d, I x (i 1,j) e; M(i, j 1) d, I y (i, j 1) e. Implicit assumption: a deletion won t be followed directly by an insertion. Generally true if d e lowest mismatch score. The recurrence rules can be simulated by a finite state automation (FSA), which can be turned into a HMM! Nam Tran 7

Linear space alignment Simple to achieve if only maximal score is needed. To find the optimal global alignment: divide and conquer principle. Let u = n 2 and v be the row such that the cell (u, v) is on the optimal alignment. Split the DP matrix into 2 smaller submatrices: one from (0, 0) to (u, v), one from (u, v) to(n, m). Recursively split down until the submatrices are small enough for using standard O(n 2 ) DP procedure. Runtime still O(n 2 ). Way to find v: keep tracks of c(i, j) such that c(i, j) =v for i>u. If the cell (i,j ) precedes (i, j), set c(i, j) =j if i = u, elsec(i, j) =c(i,j ). Nam Tran 8

Substitution matrices Recap: scores are to measure the relative likelihood that the sequences are related as opposed to being unrelated. Model M for being related, R for unrelated. Prior probability P (R) =1 P (M). In R, the residues in the sequences occur independently: P (x, y R) = i q xi q yj j In M, aligned residue pairs have a joint distribution p ab : P (x, y M) = i p xi y i Let S = log ( P (x,y M) P (x,y R) ) and S = S + log ( ) P (M) P (R). P (M x, y) is probability of being relared versus being unrelated: P (M x, y) = es 1+e S Nam Tran 9

P (M x, y) increases with S. If we fixed the prior log-odds ratio log ( ) P (M) P (R), we only need to maximize S. S = i log p xi y i q xi q yi The substitution matrix contains the log likelihood ratio of residue pair (a, b) being related as opposed to being unrelated: s(a, b) =log( p ab q a q ) b Counting frequencies in confirmed alignments won t work! - protein sequences come in families, so alignments tend not to be independent from each other. - when divergence is higher, p ab tends to background frequency q a q b, so scores should correspond to expected divergence of the sequences. Common matrices PAM and BLOSUM take the difficulties into account. Prior odds ratio becomes important when searching database for a possible significant match. When the ratio is fixed, the probability of finding a match increases with the number of queries. Changing the ratio can corrigate this probability. Nam Tran 10