Pairwise alignments Introduction to Bioinformatics Jacques van Helden Université d’Aix-Marseille, France Lab. Technological.

Slides:



Advertisements
Similar presentations
Écriture créative: raconter une histoire Comment enrichir sa production écrite.
Advertisements

Global Sequence Alignment by Dynamic Programming.
Computational Biology, Part 7 Similarity Functions and Sequence Comparison with Dot Matrices Robert F. Murphy Copyright  1996, All rights reserved.
1 Introduction to Sequence Analysis Utah State University – Spring 2012 STAT 5570: Statistical Bioinformatics Notes 6.1.
EMBOSS – an application suite for Bioinformatics  Shahid Manzoor  Adnan Niazi SLU Global Bioinformatics Centre.
Alignment methods Introduction to global and local sequence alignment methods Global : Needleman-Wunch Local : Smith-Waterman Database Search BLAST FASTA.
Measuring the degree of similarity: PAM and blosum Matrix
1 ALIGNMENT OF NUCLEOTIDE & AMINO-ACID SEQUENCES.
DNA sequences alignment measurement
Lecture 8 Alignment of pairs of sequence Local and global alignment
C E N T R F O R I N T E G R A T I V E B I O I N F O R M A T I C S V U E Alignments 1 Sequence Analysis.
Introduction to Bioinformatics Burkhard Morgenstern Institute of Microbiology and Genetics Department of Bioinformatics Goldschmidtstr. 1 Göttingen, March.
Sequence alignment SEQ1: VLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHGKK VADALTNAVAHVDDPNALSALSDLHAHKLRVDPVNFKLLSHCLLVTLAAHLPAEFTPAVHA SLDKFLASVSTVLTSKYR.
Introduction to Bioinformatics Algorithms Sequence Alignment.
Summer Bioinformatics Workshop 2008 Sequence Alignments Chi-Cheng Lin, Ph.D. Associate Professor Department of Computer Science Winona State University.
Sequence Alignments Chi-Cheng Lin, Ph.D. Associate Professor Department of Computer Science Winona State University – Rochester Center
Sequence Comparison Intragenic - self to self. -find internal repeating units. Intergenic -compare two different sequences. Dotplot - visual alignment.
Sequence similarity.
Alignment methods June 26, 2007 Learning objectives- Understand how Global alignment program works. Understand how Local alignment program works.
Pairwise Alignment Global & local alignment Anders Gorm Pedersen Molecular Evolution Group Center for Biological Sequence Analysis.
Introduction to Bioinformatics Algorithms Sequence Alignment.
Computational Biology, Part 2 Sequence Comparison with Dot Matrices Robert F. Murphy Copyright  1996, All rights reserved.
Bioinformatics Unit 1: Data Bases and Alignments Lecture 3: “Homology” Searches and Sequence Alignments (cont.) The Mechanics of Alignments.
Pairwise alignment Computational Genomics and Proteomics.
Roadmap The topics:  basic concepts of molecular biology  more on Perl  overview of the field  biological databases and database searching  sequence.
Alignment methods II April 24, 2007 Learning objectives- 1) Understand how Global alignment program works using the longest common subsequence method.
Sequencing a genome and Basic Sequence Alignment
Assessment of sequence alignment Lecture Introduction The Dot plot Matrix visualisation matching tool: – Basics of Dot plot – Examples of Dot plot.
Sequence Alignment.
© Wiley Publishing All Rights Reserved.
Inferring function by homology The fact that functionally important aspects of sequences are conserved across evolutionary time allows us to find, by homology.
Pairwise alignments Introduction Introduction Why do alignments? Why do alignments? Definitions Definitions Scoring alignments Scoring alignments Alignment.
Pairwise & Multiple sequence alignments
Introduction to Bioinformatics Dot Plots. One of the simplest and oldest methods for sequence alignment Visualization of regions of similarity –Assign.
Assessment of sequence alignment Lecture Introduction The Dot plot Matrix visualisation matching tool: – Basics of Dot plot – Examples of Dot plot.
An Introduction to Bioinformatics
Protein Sequence Alignment and Database Searching.
CISC667, S07, Lec5, Liao CISC 667 Intro to Bioinformatics (Spring 2007) Pairwise sequence alignment Needleman-Wunsch (global alignment)
Computational Biology, Part 3 Sequence Alignment Robert F. Murphy Copyright  1996, All rights reserved.
Evolution and Scoring Rules Example Score = 5 x (# matches) + (-4) x (# mismatches) + + (-7) x (total length of all gaps) Example Score = 5 x (# matches)
Sequence Alignment Techniques. In this presentation…… Part 1 – Searching for Sequence Similarity Part 2 – Multiple Sequence Alignment.
Content of the previous class Introduction The evolutionary basis of sequence alignment The Modular Nature of proteins.
Sequence Alignment Goal: line up two or more sequences An alignment of two amino acid sequences: …. Seq1: HKIYHLQSKVPTFVRMLAPEGALNIHEKAWNAYPYCRTVITN-EYMKEDFLIKIETWHKP.
Pairwise Sequence Alignment. The most important class of bioinformatics tools – pairwise alignment of DNA and protein seqs. alignment 1alignment 2 Seq.
Pairwise alignment of DNA/protein sequences I519 Introduction to Bioinformatics, Fall 2012.
Sequence Analysis CSC 487/687 Introduction to computing for Bioinformatics.
Hugh E. Williams and Justin Zobel IEEE Transactions on knowledge and data engineering Vol. 14, No. 1, January/February 2002 Presented by Jitimon Keinduangjun.
Sequencing a genome and Basic Sequence Alignment
CISC667, F05, Lec9, Liao CISC 667 Intro to Bioinformatics (Fall 2005) Sequence Database search Heuristic algorithms –FASTA –BLAST –PSI-BLAST.
Multiple sequence alignments Introduction to Bioinformatics Jacques van Helden Aix-Marseille Université (AMU), France Lab.
Sequence alignment SEQ1: VLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHGKK VADALTNAVAHVDDPNALSALSDLHAHKLRVDPVNFKLLSHCLLVTLAAHLPAEFTPAVHA SLDKFLASVSTVLTSKYR.
Sequence Alignment Csc 487/687 Computing for bioinformatics.
Function preserves sequences Christophe Roos - MediCel ltd Similarity is a tool in understanding the information in a sequence.
Basic terms:  Similarity - measurable quantity. Similarity- applied to proteins using concept of conservative substitutions Similarity- applied to proteins.
A Table-Driven, Full-Sensitivity Similarity Search Algorithm Gene Myers and Richard Durbin Presented by Wang, Jia-Nan and Huang, Yu- Feng.
Intro to Alignment Algorithms: Global and Local Intro to Alignment Algorithms: Global and Local Algorithmic Functions of Computational Biology Professor.
Applied Bioinformatics Week 3. Theory I Similarity Dot plot.
Sequence Alignments with Indels Evolution produces insertions and deletions (indels) – In addition to substitutions Good example: MHHNALQRRTVWVNAY MHHALQRRTVWVNAY-
Sequence Alignment.
Construction of Substitution matrices
DNA sequences alignment measurement Lecture 13. Introduction Measurement of “strength” alignment Nucleic acid and amino acid substitutions Measurement.
Techniques for Protein Sequence Alignment and Database Searching G P S Raghava Scientist & Head Bioinformatics Centre, Institute of Microbial Technology,
Database Scanning/Searching FASTA/BLAST/PSIBLAST G P S Raghava.
Introduction to sequence alignment Mike Hallett (David Walsh)
LES TOLERANCES ET AJUSTEMENTS Suite ENPEI. LES TOLERANCES 1- LES AJUSTEMENTS 2- ALESAGE - TOLERANCES FONDAMENTALES 3- ARBRE - TOLERANCES FONDAMENTALES.
LSM3241: Bioinformatics and Biocomputing Lecture 4: Sequence analysis methods revisited Prof. Chen Yu Zong Tel:
Intro to Alignment Algorithms: Global and Local
Pairwise Sequence Alignment
Lecture #7: FASTA & LFASTA
It is the presentation about the overview of DOT MATRIX and GAP PENALITY..
Presentation transcript:

Pairwise alignments Introduction to Bioinformatics Jacques van Helden Université d’Aix-Marseille, France Lab. Technological Advances for Genomics and Clinics (TAGC, INSERM Unit U1090) FORMER ADDRESS ( ) Université Libre de Bruxelles, Belgique Bioinformatique des Génomes et des Réseaux (BiGRe lab)

Dot plots : intuitive visualization of “alignable” sequence segments Bioinformatics

Matrice de points (Matrice de pixels; dot-plot) Le dot plot est une représentation graphique simple des résidus identiques entre les deux séquences.  Les deux séquences sont représentées sur les deux axes  Un point (dot) est tracé pour chaque correspondance entre deux résidus de séquences.  Les lignes diagonales révèlent les régions alignables entre les deux séquences. Diapo: Emese Meglecz ADSTARYEMQSDQIYTQN | | | ||||| AETSAQYDMQSDQEFTRD

Matrice de points (Matrice de pixels; dot-plot) Outre les identités, on peut marquer les similarités entre acides aminés (substitutions conservatives, d’après une matrice de substitution donnée)  Exemple: marquage des paires de résidus ayant un score BLOSUM62 > 1. Diapo: Emese Meglecz ADSTARYEMQSDQIYTQN |:::|:|:||||| :|:: AETSAQYDMQSDQEFTRD

Matrice de points (Matrice de pixels; dot-plot) On peut appliquer à la matrice de points un filtrage par fenêtre glissante.  On n’affiche que les diagonale comportant au moins 2 points marqués successifs. À chaque position de la matrice on extrait la paire de mots de taille w qui commence aux positions correspondantes des deux séquences. Le score de la paire de mots est calculé en additionnant les scores des paires des résidus (d’après la matrice de substitution). Si le score dépasse un seuil défini par l’utilisateur, une diagonale noire s'affiche à la position correspondante. Adapté d’après Emese Meglecz

Matrice de points - Détections des INDELs Un décalage (gap) entre deux diagonales suggère soit une délétion (sur la première séquence dans l’exemple ci-contre), soit une insertion (dans la seconde séquence). Le simple alignement entre deux séquences ne permet pas de décider si l’événement évolutif était une délétion ou une insertion. On désigne par « indel » l’événement évolutif supposé. Adapté d’après Emese Meglecz

Dot plot A dot plot is a simple graphical representation of identical residues between two sequences.  The X axis represents the first sequence (PHO5),  The Y axis represents the second sequence (PHO3)  A dot is plotted for each match between two residues of the sequences.  Diagonal lines reveal regions of identity between the two sequences. 7 Example: protein sequences of the Pho5p and Pho3p phosphatases in the yeast Saccharomyces cerevisiae

8

9

Dot plot with word matches With nucleic sequences, each residue is expected every 4 positions on average. A letter-based dot plot is thus very confusing. The dot plot can be adapted to display only word matches, which correspond to a diagonal of dots in the letter-based dot plot. Example: alignment of PHO5 and PHO3 coding sequences, with different word sizes. Word size = 10Word size = 3Word size = 2 10

Matrice de points - Répétitions intra-séquence La matrice de points permet de repérer des segments répétés au sein d’une séquence. Pour cela, on aligne la séquence avec elle-même. Les segments répétées apparaissent comme des lignes obliques parallèles à la diagonale principale. Adaptée d’après Emese Meglecz RégionA RégionB Seq1 RégionB RégionA

Detecting repeats with a dot plot Sequence repeats are easily detected in a dot plot when a sequence is compared to itself.  The main diagonal is completely marked (by definition, since the sequence is identical do itself)  Repeats appear as segments of lines parallel to the diagonal. 12

Gray scale dottups Word matches require a perfect match over the whole word length. A more refined way to show partial similarities is to use windows. For each point, the window score is the sum of matches of its neighbours on the diagonal. The gray level reflects the window similarity score. 13 Source ?

Substitution matrices in dot plots Substitution matrices can be used in dot plots The user has to specify the following parameters:  Window size (=word size)  Score threshold  Substitution matrix At each position of the plot  A pair of words of size w are extracted from the first and second sequences.  The score of the word pair is calculated by summing the scores of the corresponding pairs of residues.  If the pair of words passes the threshold, a black diagonal is displayed at the corresponding position of the dot plot. The regions of similarity between the two sequences are appear as black diagonals on the dot plot. 14

Aspartokinases: dot plot with simple word matches Let us compare the peptidic sequences of two enzymes from the bacteria Escherichia coli K12.  LysCaspartokinase involved in lysine biosynthesis  MetLbifunctional enzyme which combines two domains aspartokinase catalyses the first step of methionine biosynthesis homoserine dehydrogenase catalyze the third step of methionine biosynthesis On the dot plot, the region of similarity between the two aspartokinase domains is barely visible.. 15 dottup result, window size=3

Aspartokinases: dot plot with substitution matrix (BLOSUM62) With dotmatcher, a substitution matrix is used to score the similarity between each pair of residues. This reveals the similarity between the aspartokinase domains of MetL and LysC. Note that this similarity only covers the N terminal half of MetL, because it is a bi-functional enzyme : the C-terminal domain is a homoserine dehydrogenase. It is quite tricky to find the appropriate parameters, because these can vary from case ot case. 16

Matrice de points – Extension à l’échelle génomique On peut transposer le concept de matrice de points à l’échelle génomique, en indiquant par un point la présence de gènes homologues entre les deux génomes. Cette approche permet de repérer  des régions génomiques où les gènes se succèdent de façon similaires (syntons);  des inversions chromosomiques.

Alignment matrix An alignment matrix is conceptually related to a dot plot One sequence is pasted horizontally, the other vertically A score is assigned to each match In the case of dot plots, the scoring scheme was very simple:  match = 1  mismatch = 0 In an alignment matrix, “good” alignments appear as high- scoring diagonals. Separations between high-scoring diagonals indicate gaps.  Vertical separation: a segment of the vertical sequence is aligned with a gap of the horizontal sequence.  Horizontal separation: gap in the vertical sequence. 18 AATCTTCAGC-----GTATTGCT -ATCTT-AGCCGGAGGTATT---

Software tools for displaying dot plot Dotlet  Junier T, Pagni M (2000) Dotlet: diagonal plots in a web browser. Bioinformatics. 16:  Dnadot   Draw nucleic acid dot plots, convenient for DNA/RNA alignment. Dotter  Sonnhammer EL, Durbin R (1995) A dot-matrix program with dynamic threshold control suited for genomic DNA and protein sequence analysis. Gene. 167:GC1-10. 

Finding the best alignment between two sequences

Example of gapless alignment The simplest way to align two sequences without gap is to slide one sequence over the other one, and score the alignment for each possible offset. TTGCGGT -| 1 TTAGCCGT TTGCGGT TTAGCCGT TTGCGGT TTAGCCGT TTGCGGT ---|- 1 TTAGCCGT TTGCGGT |--|-- 2 TTAGCCGT TTGCGGT || TTAGCCGT TTGCGGT |-||-|| 5 TTAGCCGT TTGCGGT | 1 TTAGCCGT TTGCGGT ---||- 2 TTAGCCGT TTGCGGT TTAGCCGT TTGCGGT --|- 1 TTAGCCGT TTGCGGT TTAGCCGT TTGCGGT -| TTAGCCGT TTGCGGT | 2 TTAGCCGT - substitution | match 21

Number of possible gapless alignments If we only consider substitutions (no deletion, no insertion), sequence alignment is very simple A simple (but not very efficient) algorithm :  Align last position of seq1 with first position of seq2  max score  0  while there are some aligned residues Current score  number of matching residues If the current score > max score, then max score  current score best alignment  current alignment Slide seq1 one residue left Required time :  Let us assume that L1 is the length of seq1 L2 is the length of seq2 L2 <= L1 (seq2 is the shortest sequence if their sizes differ)  There are L1+L2-1 possible offsets between sequence 1 and sequence 2  For each offset, one has to sum the score over the length of the alignment (max=L2, when seq2 completely overlaps seq1)  T ~ (L1 + L2 -1)*L2 - L2*(L2-1) 22

Exercise We dispose of the two following sequences  Seq1 TTTGCGTTAAATCGTGTAGCAATTTAA  Seq2 AAGAATGGCGTTTTTAATAGCAATAT Questions 1.By progressively shifting the sequences along each other, find the offset(s) that reveal similar regions ? 2.At each offset position, identify conserved segments (i.e. uninterrupted successions of identical residues) ? 3.Can you improve the number of matching positions by inserting some gaps ? 23

Number of possible alignments with gaps Gapless alignments are rarely informative, because they fail to detect insertions and deletions There might be several local matching regions, separated by a variable-length non-conserved region: ----TTTGCGTT--AAATCGTGTAGCAATTTAA s=substitution; |=match 1111s|s|||||11s||22222|||||||s|22 1=gap in the first sequence AAGAATGGCGTTTTTAA-----TAGCAATAT-- 2=gap in the second sequence Allowing gaps increases the complexity of the problem: at each position, there can be either  a gap in the first sequence  a gap in the second sequence  a superposition of residue 1 with residue 2 (match or substitution) In total, the computational size of the problem is N~3 L, where L is the size of the shortest sequence. The number of possibilities increases thus exponentially with sequence length. This rapidly becomes intractable.  For two sequences of size 1000, there are ~ (~ ) possible alignments. We want to find the optimal alignment, i.e. that associated with the highest score, among all possible alignments. It is however impossible to test each alignment and measure its score, because it would take an “infinite” time. 24

Example of pairwise alignment Example of alignment TTTGCGTT--AAATCGTGTAGCAATTT s=substitution s|ss||||ggs||ggggg|||||||s| g=gap ATGCCGTTTTTAA-----TAGCAATAT |=identical residues Gaps, insertions and deletions  Gaps can reflect either an insertion in one of the sequences, or a deletion in the other one.  The simple observation of two aligned sequences is insufficient to decide whether a gap results from an insertion or a deletion.  The term indel is sometimes used in this case to designate the evolutionary event. 25

Global (Needleman-Wunsch) versus local (Smith-Waterman) alignment Global alignment  Algorithm: Needleman-Wunsch (1970).  EMBOSS Web tool: needle (nucleic acids or proteins).nucleic acids proteins  Appropriate, for example, for proteins having a common ancestor and being conserved over their whole sequences.  The final alignment mandatorily includes the aligned sequences over their full lengths. LQGPSKGTGKGS-SRSWDN |----|--|||---|--|- LN-ITKSAGKGAIMRLGDA Local alignment  Algorithm: Smith-Waterman (1981).  EMBOSS Web tool: water (nucleic acids or proteins).nucleic acidsproteins  Appropriate, for example, for proteins sharing a common domain restricted to a segment of the sequence. LQGPSSKTGKGS-SSRIWDN |-||| LN-ITKKAGKGAIMRLGDA  The final alignment is restricted to the conserved segment(s) KTGKG |-||| KAGKG Needleman, S. B. & Wunsch, C. D. (1970). A general method applicable to the search for similarities in the amino acid sequence of two proteins. J Mol Biol 48, Smith, T. F. & Waterman, M. S. (1981). Identification of common molecular subsequences. J Mol Biol 147,

Algorithmic aspects Finding the optimal pairwise alignment by dynamical programming

Dynamical programming - global alignment Needleman-Wunsch proposed an algorithm called dynamical programming  Performs a global alignment (the sequences are aligned on the whole length)  The time of processing is proportional to the product of sequence lengths. It si thus increasing quadratically with the sequence length, instead of exponentially.  Guarantees to return the highest scoring alignment between two sequences. 28 Reference: Needleman, S. and Wunsch, C. (1970). A general method applicable to the search for similarities in the amino acid sequences of two proteins. J. Mol. Biol., 48:444–453.

Dynamical programming - global alignment For each position in the alignment, one can have  a gap in sequence 1  a gap in sequence 2  aligned residues (match or substitution) 29

Dynamical programming - paths Any possible alignment between the two sequences can be represented as a path from the left top corner to the right bottom corner. For example, the path highlighted in green corresponds to the alignment below. - - T A - C G T g g s s g s s g C T A G G A T – Obviously, this alignment is not optimal : it does not contain a single match ! TACGT C T A G G A T 30

Dynamical programming - global alignment Our goal is to find the best possible alignment, which corresponds to the path giving the optimal score (we still need to define how this score will be computed). As discussed before, the number of possible paths increases exponentially with the sequence sizes. Dynamical programming however allows us to find this optimal score in a quadratic time (L1*L2), by building the solution progressively. This progressive path finding allows us to avoid evaluating a large number of paths which would anyway return a sub-optimal score. TACGT C T A G G A T 31

Dynamical programming - initialization The top row and left column are initialized. We will now progressively fill the other cells of the matrix by calculating, for each cell, its optimal score as a function of the path used to reach this cell. Two possible ways to initialize  If you consider that there is no cost for an terminal gaps (start, end), initialize first row and column with 0.  If you want to penalize terminal gaps, initialize first row and column with gap penalties. TACGT C T A G G A T

Dynamical programming – the 3 way to leave a cell From each starting cell, we can take 3 possible moves:  Diagonal Align the two residues (match or substitution)  Rightward Align one residue of the horizontal sequence with a gap in the vertical sequence.  Downward Align one residue of the vertical sequence with a gap in the horizontal sequence. Diagonal move : align the two residues Alignment A C Substitution ACAC C C CCCC Match Rightward move: insert gap in vertical sequence A-A- A C Downward move: insert gap in horizontal sequence - C A C 33

Dynamical programming – the 3 way to leave a cell From each starting cell, we can take 3 possible moves:  Diagonal Align the two residues (match or substitution)  Rightward Align one residue of the horizontal sequence with a gap in the vertical sequence.  Downward Align one residue of the vertical sequence with a gap in the horizontal sequence. We can define a scoring scheme, and define the score of each possible direction.  match+1  substitution-1  gap-2 Diagonal move : align the two residues Alignment A C 2 1 Substitution ACAC C C CCCC Match Rightward move: insert gap in vertical sequence A-A- A C Downward move: insert gap in horizontal sequence - C A C

Exercise – what is the best way to reach a cell Let us assume the following scoring scheme  match+1  substitution-1  gap-2 At a given destination cell, 3 scores are calculated depending on the 3 possible starting positions:  upper neighbour + gap cost  left neighbour + gap cost  upper-left neighbour + match score if the residue match substitution cost if residues do not match For each of the cases besides  Compute the 3 possible scores.  Indicate the best score in the destination cell.  Mark the arrow giving this best score. A C A C A C Example 1 C C C C Example 2 C C C C C C Example 4 C C Example 3 C C C C C C Alignment? 35

Dynamical programming – the best way to reach a cell Let us assume the following scoring scheme  match+1  substitution-1  gap-2 At a given destination cell, 3 scores are calculated depending on the 3 possible starting positions:  upper neighbour + gap cost  left neighbour + gap cost  upper-left neighbour + match score if the residue match substitution cost if residues do not match The highest score is retained and the arrow is labelled In some cases (example 4), there are several equivalent highest scores A C A C A C Example 1: best move is a substitution C C C C Example 2: best move is a match -2 C C C C C C Example 4: bets move is either gap or match -2 C C Example 3: best move is a gap C C C C C C Alignment ACAC CCCC - C CCCC or - C 36

Dynamical programming - recursive computation The first row is processed from left to right TACGT C T A G G A T

Dynamical programming - recursive computation The second row is then processed TACGT C T A G G A T

Dynamical programming - recursive computation The process is iterated until the right corner is reached. Exercise: calculate the remaining scores. TACGT C T A G G A T

Needleman-Wunsch : exercise Using the Needleman-Wunsch algorithm, fill the scores of the alignment matrix with the following parameters  Substitution matrix: BLOSUM62  Gap opening penalty: -5  Gap extension penalty: -1  Initial and terminal gaps: 0 SVETD T S I N Q E T 40

Needleman-Wunsch : solution of the exercise A substitution matrix can be used to assign specific scores to each pair of residues. Exercise: fill the scores of the alignment matrix using the BLOSUM62 substitution matrix.  Gap opening penalty: -5  Gap extension penalty: -1  Initial and terminal gaps: 0 SVETD T S I N Q E T S V - - E T D - | : - - | | - T S I N Q E T - 41

Needleman-Wunsch example Alignment of E.coli metL and thrA proteins with Needleman-Wunsch algorithm. The vertical bars indicate identity between two amino- acids. The columns and dots indicate similarities, i.e. pairs of residues having a positive scores in the chosen substitution matrix (BLOSUM62). # Matrix: EBLOSUM62 # Gap_penalty: 10.0 # Extend_penalty: 0.5 # Length: 867 # Identity: 254/867 (29.3%) # Similarity: 423/867 (48.8%) # Gaps: 104/867 (12.0%) # Score: metL 1 MSVIAQAGAKGRQLHKFGGSSLADVKCYLRVAGIMAEYSQPDDM-MVVSA 49.::.||||:|:|:.:.:||||.|:...::...:.|:|| thrA 1 MRVLKFGGTSVANAERFLRVADILESNARQGQVATVLSA 39 metL 50 AGSTTNQLINWLK LSQTDRLSAHQVQQTLRRYQCDLISG ||.|:..:: :|..:|:.| :|::| thrA 40 PAKITNHLVAMIEKTISGQDALPNISDAERIFA ELLTG 77 metL 89 LLPAEEADSL--ISAFV-SDLERLAALLDSGIN------DAVYAEVVGHG 129 |..|:....| :..||.:..::..:|.||: |::.|.::..| thrA 78 LAAAQPGFPLAQLKTFVDQEFAQIKHVL-HGISLLGQCPDSINAALICRG 126 metL 130 EVWSARLMSAVLNQQGLPAAWLD-AREFLRAERAAQPQVD--EGLSYPLL 176 |..|..:|:.||..:|.....:|..:.|......:..|| | thrA 127 EKMSIAIMAGVLEARGHNVTVIDPVEKLLAVGHYLESTVDIAESTRRIAA 176 metL 177 QQLLVQHPGKRLVVTGFISRNNAGETVLLGRNGSDYSATQIGALAGVSRV 226.::...|.:::.||.:.|..||.|:||||||||||..:.| thrA 177 SRIPADH---MVLMAGFTAGNEKGELVVLGRNGSDYSAAVLAACLRADCC 223 metL 227 TIWSDVAGVYSADPRKVKDACLLPLLRLDEASELARLAAPVLHARTLQPV 276.||:||.|||:.|||:|.||.||..:...||.||:...|.|||.||:.|: thrA 224 EIWTDVDGVYTCDPRQVPDARLLKSMSYQEAMELSYFGAKVLHPRTITPI 273 metL 277 SGSEIDLQLRCSYTPDQ-----GSTRIERVLASGTGARIVTSHDDVCLIE 321 :..:|...::.:..|.. |::|.|..|..:.:::.:::.:.. thrA 274 AQFQIPCLIKNTGNPQAPGTLIGASRDEDELP----VKGISNLNNMAMFS 319 metL 322 FQVPASQDFKLAHKEIDQILKRAQVRPLAVGVHNDRQLLQFCYTSEVADS |..: :...:.||::..:.:...:....:.|| thrA 320 VSGPGMKGMVGMAARVFAAMSRARISVVLITQSSSEYSISFCVPQSDCVR 369 metL 372 ALKILDE AGLPGELRLRQGLALVAMVGAGVTRNPLHCHRFWQQ 414 |.:.:.|.||...|.:.:.||::::||.|: :. thrA 370 AERAMQEEFYLELKEGLLEPLAVTERLAIISVVGDGM RT 408 metL 415 LKGQPVE-FTWQSDDGISLVAVLRTGPTESL IQGLHQS 451 |:|...: |...:...|::||:.:.....|: ::..||. thrA 409 LRGISAKFFAALARANINIVAIAQGSSERSISVVVNNDDATTGVRVTHQM 458 metL 452 VFRAEKRIGLVLFGKGNIGSRWLELFAREQSTLSARTGFEFVLAGVVDSR 501 :|..::.|.:.:.|.|.:|...||...|:||.|..:..:..:.||.:|: thrA 459 LFNTDQVIEVFVIGVGGVGGALLEQLKRQQSWLKNK-HIDLRVCGVANSK 507 metL 502 RSLLSYDGLDASRALAFFNDEAVEQDEE----SLFLWMRAHPYDDLVVLD 547..|.:..||: |..:.:|..:..|..|...::.:...:.|::| thrA 508 ALLTNVHGLN----LENWQEELAQAKEPFNLGRLIRLVKEYHLLNPVIVD 553 metL 548 VTASQQLADQYLDFASHGFHVISANKLAGASDSNKYRQIHDAFEKTGRHW 597.|:||.:||||.||...||||::.||.|..|..:.|.|:..|.||:.|.: thrA 554 CTSSQAVADQYADFLREGFHVVTPNKKANTSSMDYYHQLRYAAEKSRRKF 603 metL 598 LYNATVGAGLPINHTVRDLIDSGDTILSISGIFSGTLSWLFLQFDGSVPF 647 ||:..||||||:...:::|:::||.::..|||.||:||::|.:.|..:.| thrA 604 LYDTNVGAGLPVIENLQNLLNAGDELMKFSGILSGSLSYIFGKLDEGMSF 653 metL 648 TELVDQAWQQGLTEPDPRDDLSGKDVMRKLVILAREAGYNIEPDQVRVES 697 :|....|.:.|.|||||||||||.||.|||:|||||.|..:|...:.:|. thrA 654 SEATTLAREMGYTEPDPRDDLSGMDVARKLLILARETGRELELADIEIEP 703 metL 698 LVPAHCEG-GSIDHFFENGDELNEQMVQRLEAAREMGLVLRYVARFDANG 746 ::||.... |.:..|..|..:|::....|:..||:.|.|||||...|.:| thrA 704 VLPAEFNAEGDVAAFMANLSQLDDLFAARVAKARDEGKVLRYVGNIDEDG 753 metL 747 KARVGVEAVREDHPLASLLPCDNVFAIESRWYRDNPLVIRGPGAGRDVTA 796..||.:..|..:.||..:...:|..|..|.:|:..|||:||.|||.|||| thrA 754 VCRVKIAEVDGNDPLFKVKNGENALAFYSHYYQPLPLVLRGYGAGNDVTA 803 metL 797 GAIQSDINR-LAQLL 810..:.:|:.| |:..| thrA 804 AGVFADLLRTLSWKLGV 820 #

Dynamical programming - local alignment The Needleman-Wunsch algorithm performs a global alignemnt (it finds the best path between the two corners of the alignment matrix). This is appropriate when the sequences are similar over their whole length, but local similarities could be missed. In 1981, Smith and Waterman published an adaptation of the Needleman- Wunsch algorithm, which allows to detect local similarities. Reference: Smith, T. F. and Waterman, M. S. (1981). Identification of common molecular subsequences. J. Mol. Biol., 147:195–

Dynamical programming - local alignment Smith-Waterman algorithm The algorithm is similar to Needleman- Wunsch, but negative scores are replaced by 0 Alignments stop after local maxima In this case we have two overlapping alignments, each having a score of 2 : TATACG TATAGG Basically, the cost of the C/G substitution is compensate by the benefit of the G/G match. Reference: Smith, T. F. and Waterman, M. S. (1981). Identification of common molecular subsequences. J. Mol. Biol., 147:195–197. TACGT C T A G G A T

Smith-Waterman: exercise Using the Smith-Waterman algorithm, fill the scores of the alignment matrix with the following parameters  Substitution matrix: BLOSUM62  Gap opening penalty: -5  Gap extension penalty: -1  Initial and terminal gaps: 0 SVETD T S I N Q E T 45

Smith-Waterman : solution of the exercise A substitution matrix can be used to assign specific scores to each pair of residues. Exercise: fill the scores of the alignment matrix using the BLOSUM62 substitution matrix.  Gap opening penalty: -5  Gap extension penalty: -1  Initial and terminal gaps: 0 SVETD T S I N Q E T S V - - E T | : - - | | S I N Q E T 46

Case study Bacterial aspartokinaes

Needleman-Wunsch with partial similarities Alignment of E.coli lysC and metL proteins with Needleman-Wunsch algorithm. metL contains two domains: aspartokinase and homoserine dehydrogenase. LysC only contains the aspartokinase domains. With Smith-Waterman, the %similarity is calculated over the whole length of the alignment (854aa), which gives 24.5%. Actually, most of the alignment length is in the terminal gap (the homoserine dehydrogenase domain of metL). This percentage is lower than the usual threshold for considering two proteins as homolog. # Matrix: EBLOSUM62 # Gap_penalty: 10.0 # Extend_penalty: 0.5 # Length: 854 # Identity: 136/854 (15.9%) # Similarity: 209/854 (24.5%) # Gaps: 449/854 (52.6%) # Score: metL 1 MSVIAQAGAKGRQLHKFGGSSLADVKCYLRVAGIMAEYSQPDDMMVVSAA 50 ||.|. :.||||:|:||.....|.|.|:...:...::|:||: lysC 1 MSEIV VSKFGGTSVADFDAMNRSADIVLSDANV-RLVVLSAS 41 metL 51 GSTTNQLINWLK-LSQTDRLSAHQVQQTLRRYQCDLISGL----LPAEEA 95...||.|:...: |...:|. :....:|..|..::..| :..||. lysC 42 AGITNLLVALAEGLEPGERF---EKLDAIRNIQFAILERLRYPNVIREEI 88 metL 96 DSLISAFVSDLERLAALLDSGINDAVYAEVVGHGEVWSARLMSAVLNQQG 145 :.|:.. ::.|...|||..|.|:..|:|.|||:.|..|...:|.::. lysC 89 ERLLEN-ITVLAEAAALATS---PALTDELVSHGELMSTLLFVEILRERD 134 metL 146 LPAAWLDAREFLRA-ERAAQPQVDEGLSYPLLQQLLVQHPGKRLVVT-GF 193 :.|.|.|.|:.:|. :|..:.:.|......|....|:....:.||:| || lysC 135 VQAQWFDVRKVMRTNDRFGRAEPDIAALAELAALQLLPRLNEGLVITQGF 184 metL 194 ISRNNAGETVLLGRNGSDYSATQIGALAGVSRVTIWSDVAGVYSADPRKV 243 |...|.|.|..|||.||||:|..:......|||.||:||.|:|:.|||.| lysC 185 IGSENKGRTTTLGRGGSDYTAALLAEALHASRVDIWTDVPGIYTTDPRVV 234 metL 244 KDACLLPLLRLDEASELARLAAPVLHARTLQPVSGSEIDLQLRCSYTPDQ 293..|..:..:...||:|:|...|.|||..||.|...|:|.:.:..|..|.. lysC 235 SAAKRIDEIAFAEAAEMATFGAKVLHPATLLPAVRSDIPVFVGSSKDPRA 284 metL 294 GSTRI ERVLASGTGARIVTSHDDVCLIEFQVPASQDFKLAH 334 |.|.:.|.||......::|.|...:..|:.| || lysC 285 GGTLVCNKTENPPLFRALALRRNQTLLTLH------SLNMLHSRGF-LA- 326 metL 335 KEIDQILKRAQVRPLAVGVHNDRQLLQFCYTSEVA D 370 |:..||.| ||.. :....||||: | lysC 327 -EVFGILAR HNIS--VDLITTSEVSVALTLDTTGSTSTGD 363 metL 371 SAL--KILDEAGLPGELRLRQGLALVAMVGAGVTR NPL 406 :.|.:|.|......:.:.:||||||::|..:::.|. lysC 364 TLLTQSLLMELSALCRVEVEEGLALVALIGNDLSKACGVGKEVFGVLEPF 413 metL 407 HCHRFWQQLKGQPVEFTWQSDDGISLVAVLRTGPTESLIQGLHQSVFRAE 456 : :.|....:|.|.::|.||.::|. lysC 414 NIRMICYGASSHNLCFLVPGED AEQVVQKLHSNLFE 449 metL 457 KRIGLVLFGKGNIGSRWLELFAREQSTLSARTGFEFVLAGVVDSRRSLLS 506 lysC metL 507 YDGLDASRALAFFNDEAVEQDEESLFLWMRAHPYDDLVVLDVTASQQLAD 556 lysC metL 557 QYLDFASHGFHVISANKLAGASDSNKYRQIHDAFEKTGRHWLYNATVGAG 606 lysC metL 607 LPINHTVRDLIDSGDTILSISGIFSGTLSWLFLQFDGSVPFTELVDQAWQ 656 lysC metL 657 QGLTEPDPRDDLSGKDVMRKLVILAREAGYNIEPDQVRVESLVPAHCEGG 706 lysC metL 707 SIDHFFENGDELNEQMVQRLEAAREMGLVLRYVARFDANGKARVGVEAVR 756 lysC metL 757 EDHPLASLLPCDNVFAIESRWYRDNPLVIRGPGAGRDVTAGAIQSDINRL 806 lysC metL 807 AQLL 810 lysC #

Smith-Waterman with partial similarities Alignment of E.coli lysC and metL proteins with Smith- Waterman algorithm. The alignment is almost identical to the one reported by Needleman-Wunsch, but the score is now considered on the aligned segments only (482 aa). On this region, there is 42.5% of similarity. # Matrix: EBLOSUM62 # Gap_penalty: 10.0 # Extend_penalty: 0.5 # Length: 482 # Identity: 133/482 (27.6%) # Similarity: 205/482 (42.5%) # Gaps: 85/482 (17.6%) # Score: metL 16 KFGGSSLADVKCYLRVAGIMAEYSQPDDMMVVSAAGSTTNQLINWLK-LS 64 ||||:|:||.....|.|.|:...:...::|:||:...||.|:...: |. lysC 8 KFGGTSVADFDAMNRSADIVLSDANV-RLVVLSASAGITNLLVALAEGLE 56 metL 65 QTDRLSAHQVQQTLRRYQCDLISGL----LPAEEADSLISAFVSDLERLA 110..:|. :....:|..|..::..| :..||.:.|:.. ::.|...| lysC 57 PGERF---EKLDAIRNIQFAILERLRYPNVIREEIERLLEN-ITVLAEAA 102 metL 111 ALLDSGINDAVYAEVVGHGEVWSARLMSAVLNQQGLPAAWLDAREFLRA- 159 ||..|.|:..|:|.|||:.|..|...:|.::.:.|.|.|.|:.:|. lysC 103 ALATS---PALTDELVSHGELMSTLLFVEILRERDVQAQWFDVRKVMRTN 149 metL 160 ERAAQPQVDEGLSYPLLQQLLVQHPGKRLVVT-GFISRNNAGETVLLGRN 208 :|..:.:.|......|....|:....:.||:| |||...|.|.|..|||. lysC 150 DRFGRAEPDIAALAELAALQLLPRLNEGLVITQGFIGSENKGRTTTLGRG 199 metL 209 GSDYSATQIGALAGVSRVTIWSDVAGVYSADPRKVKDACLLPLLRLDEAS 258 ||||:|..:......|||.||:||.|:|:.|||.|..|..:..:...||: lysC 200 GSDYTAALLAEALHASRVDIWTDVPGIYTTDPRVVSAAKRIDEIAFAEAA 249 metL 259 ELARLAAPVLHARTLQPVSGSEIDLQLRCSYTPDQGSTRI E 299 |:|...|.|||..||.|...|:|.:.:..|..|..|.|.:. lysC 250 EMATFGAKVLHPATLLPAVRSDIPVFVGSSKDPRAGGTLVCNKTENPPLF 299 metL 300 RVLASGTGARIVTSHDDVCLIEFQVPASQDFKLAHKEIDQILKRAQVRPL 349 |.||......::|.|...:..|:.| || |:..||.| lysC 300 RALALRRNQTLLTLH------SLNMLHSRGF-LA--EVFGILAR metL 350 AVGVHNDRQLLQFCYTSEVA DSAL--KILDEAGLPG 383 ||.. :....||||: |:.|.:|.|..... lysC HNIS--VDLITTSEVSVALTLDTTGSTSTGDTLLTQSLLMELSALC 378 metL 384 ELRLRQGLALVAMVGAGVTR NPLHCHRFWQQLKGQPVE 421.:.:.:||||||::|..:::.|.: :. lysC 379 RVEVEEGLALVALIGNDLSKACGVGKEVFGVLEPFNIRMICYGASSHNLC 428 metL 422 FTWQSDDGISLVAVLRTGPTESLIQGLHQSVF 453 |....:|.|.::|.||.::| lysC 429 FLVPGED AEQVVQKLHSNLF 448 #

Case study Pairwise similarities between opsins

Needleman-Wunsch – pairwise comparisons between opsins 51

Dynamical programming - summary Guarantees to find the optimal score. Is able to return all the alignments which raise the optimal score. Processing time is proportional to product of sequence lengths. Can be adapted for global (Needleman-Wunsch) or local (Smith-Waterman) alignment. Global alignments  are appropriate for aligning sequences conserved over their whole length (recent divergence). Local alignments  Are able to detect domains which cover only a fraction of the sequences  Are also able to return a complete alignment, when the conservation covers the whole sequence 52

References Dynamical programming applied to pairwise sequence alignment  Needleman-Wunsch (pairwise, global) Needleman, S. B. & Wunsch, C. D. (1970). A general method applicable to the search for similarities in the amino acid sequence of two proteins. J Mol Biol 48,  Smith-Waterman (pairwise, local) Smith, T. F. & Waterman, M. S. (1981). Identification of common molecular subsequences. J Mol Biol 147, Software tools  The EMBOSS suite provides efficient implementations of the two “classical” dynamical programming algorithms needleNeedleman-Wunsch waterSmith-Waterman  Pairwise Sequence Alignment tools at the EBI A web interface to EMBOSS tools (needle, water)  They can be installed locally or accessed via the SRS Web server 53

Exercice TACGT Q P M L S C Q 54