Bioinformatics Pairwise alignment Revised 260210 Introduction Why aligning
Bioinformatics Pairwise alignment Revised 26/02/10
Introduction Why aligning sequences? Functional inference – Clone and sequence gene with unknown function – Aligning sequence with other sequence in databank • detect homologues with known function – Ortholog, paralog – detect conserved motifs characteristic for protein family • infer function from sequence alignment Evolutionary pressure I II III
Introduction • Homologous genes: – Exhibit sequence homology – Have similar ancestor • Orthologous genes • Paralogous genes • Analogous genes: – convergent evolution – Similar function or structural protein fold – No common ancestor • Alignment allows – functional inference – Reconstruction of phylogenetic relatedness
Structural Genomics Comparative Genomics Functional genomics
Introduction • Pairwise alignment: 1. aligning two sequences 2. deciding whether the alignment is biologically relevant (two sequences are related) or whether the alignment occurred by chance • Key issues: 1. sorts of alignment (local versus global) 2. the scoring system to rank the alignments 3. algorithms to find alignments (versus heuristic) 4. PAM and BLOSUM
Overview • Pairwise alignment: 1. aligning two sequences 2. deciding whether the alignment is biologically relevant (two sequences are related) or whether the alignment occurred by chance • Key issues: 1. sorts of alignment (local versus global) 2. the scoring system to rank the alignments 3. algorithms to find alignments (versus heuristic) 4. PAM and BLOSUM
Global alignment Sequences are aligned over their entire region: • High homology • Similar length
Local alignment 33. 3% identity in 51 aa overlap; score: _ _ 230 240 250 260 270 280 PGDTLLNTVADESCDLLVMGAYARSRVREQVLGGMTRYMLEHMTVPVLMSH : : : : . : . . . : : : . : PVDALVNLADEEKADLLVVGNVGLSTIAGRLLGSVPANVSRRAKVDVLIVH 100 110 120 130 140 18. 2% identity in 44 aa overlap; score: _ _ 92 33 90 100 110 120 130 GMAGPLRSPDGQRPALHGRYADVVVVGQADPHRDRDRPIAVPQD : . . : GSDSSMRAVD-RAAQIAGADAKLIIASAYLPQHEDARAADILKD 20 30 40 50 Islands of homology: • low homology • different length
Overview • Pairwise alignment: 1. aligning two sequences 2. deciding whether the alignment is biologically relevant (two sequences are related) or whether the alignment occurred by chance • Key issues: 1. sorts of alignment (local versus global) 2. the scoring system to rank the alignments 3. algorithms to find alignments (versus heuristic) 4. PAM and BLOSUM
Algorithms Pairwise Alignment Dynamic programming Needleman Wunsch Smith Waterman (global) (local) Chapter 1 Heuristic approaches Blast Fast. A Database searches Chapter 1
Scoring Scheme • • Aligning = looking for evidence that sequences have diverged from a common ancestor by a process of natural selection. mutational processes: 1. substitutions: change residues in a sequence, 2. insertions: adding residues and 3. deletions: removing residues. IGAxi LGVyj substitution • IGALx LGy-- IGx-LGVLy insertion deletion total score of an alignment = the sum of terms 1. For each aligned pair 2. Plus terms for gaps
Substitution Score • Ungapped global pairwise alignment: • Assign a score to the alignment: – relative likelihood that sequences are related (MATCH MODEL) – to being unrelated (RANDOM MODEL) Random Match • ratio IGAx LGVy • Log-odds ratio Assumption of additivity! Independence between the aligned positions
Substitution Score Substitution matrix (BLOSUM 50 matrix) Log odds score can be positive (identities, conservative replacements) and negative
Gap Score • Gap penalties assign a negative score to the introduction of gaps (insertions, deletions) • Two types of gap scores have been defined: – linear score – affine score: • Gap penalties should be adapted to the substitution matrix
Overview • Pairwise alignment: 1. aligning two sequences 2. deciding whether the alignment is biologically relevant (two sequences are related) or whether the alignment occurred by chance • Key issues: 1. sorts of alignment (local versus global) 2. the scoring system to rank the alignments 3. algorithms to find alignments 4. PAM and BLOSUM
Algorithms • an algorithm for finding an optimal alignment for a pair of sequences • Suppose there are 2 sequences of length n that need to be aligned ATT and TTC A A - T • Possible alignments between the 2 sequences • Computationally infeasible to enumerate them all
Visual Inspection • construction of a dotplot
Algorithms Pairwise Alignment Dynamic programming Needleman Wunsch Smith Waterman (global) (local) Heuristic approaches Blast Fast. A Database searches
Dynamic Programming Global Alignment: Needleman Wunsh • Finding the optimal alignment = maximizing the score • Construct matrix F, indexed by i and j • F(i, j) is the score of the best alignment between the initial segment x 1…i of x up to xi and the initial segment y 1…j up to yj • Build F(i, j) recursively: start at F(0, 0) = 0 and proceed to fill the matrix from top left to bottom right substitution F(i, j) = max Xi aligned to a gap Yj aligned to a gap • Keep a pointer in each cell back to the cell from which it was derived • Value of the final cell is the best score for the alignment
Dynamic Programming – Alignment: path of choices which leads to the best score: traceback – Build the alignment in reverse: move back to the cell from which F(i, j) was derived: » (i-1, j-1) depending on the pointer » (i-1, j) » (i, j-1) – Add a pair of symbols onto the current alignment • Score is made of sum of independent pieces: score is the best score up to some point plus the incremental score • Adaptations for local alignment, for more complex models (affine gap score)
Dynamic programming • Any given point can only be reached from 3 possible positions • Each new score is found by choosing the maximum of 3 possibilities • For each square keep track of where the best score came from gap substitution F(i, j) = max Xi aligned to a gap Yj aligned to a gap
Dynamic Programming PAM 250
Dynamic Programming
Dynamic Programming Affine gap cost • Gap open : -12 • Gap Extension: -4 Substitution cost: PAM 250 gap substitution MNALSDRT M--GSDRT
Dynamic Programming MNALSDRT--- MNA-LSDRT --MGSDRTTET
Dynamic Programming Local Alignment: Smith Waterman • No negative scores are allowed • Portions of each sequence that are in the high scoring regions are reported SDRT
Overview • Pairwise alignment: 1. aligning two sequences 2. deciding whether the alignment is biologically relevant (two sequences are related) or whether the alignment occurred by chance • Key issues: 1. sorts of alignment (local versus global) 2. the scoring system to rank the alignments 3. algorithms to find alignments (versus heuristic) 4. PAM and BLOSUM
Substitution matrix • a good random sample of confirmed alignments • determine substitutions probabilities by counting the frequencies of the aligned residue pairs in the confirmed alignments and setting the probabilities to the normalized frequencies The performance of the alignment programs depends to a large extent on how well the substitution matrices are adapted to the dataset to be aligned
Substitution matrix
BLOSUM • • BLOSUM: Henikoff and Henikoff Protein families from database Construct block = ungapped alignment WWYIR CASILRKIYIYGPV GVSRLRTAYGGRK WFYVR CASILRHLYHRSPA GVGSITKIYGGRK WYYVR AAAVARHIYLRKTV GVGRLRKVHGSTK WYFIR AASICRHLYIRSPA GIGSFEKIYGGRR WYYTR AASIARKIYLRQGI GVHHFQKIYGGRQ WFYKR AASVARHIYMRKQV GVGKLNKLYGGAK WFYKR AASVARHIYMRKQV GVGKLNKLYGGSK WYYVR TASVARRLYIRSPT GVGALRRVYGGNK WFYTR AASTARHLYLRGGA GVGSMTKIYGGRQ WWYVR AAALLRRVYIDGPV GVNSLRTHYGGKK • counted the number of occurrences – of each amino acid – pair of amino acids aligned in the same column. NRG RNG SRG RRG RNG DRG
BLOSUM One block R A Observed frequency q(A) q(R) q(C) A A A C C A A R C 14/24 6/24 Proportion observed p(A to A) p(A to R) p(A to C) p(R to A) p(R to C) p(R to R) p(C to A) 52/120 8/120 10/120 8/120 6/120 10/120 p(C to R) p(C to C) 6/120 14/120
BLOSUM One block R A A A A C C A A R C Proportion expected e(A to A) e(A to R) e(A to C) e(R to A) e(R to R) e(R to C) e(C to A) e(C to R) e(C to C) 14/24 *4/24 14/24 * 6/24 4/24*14/24*4/24 * 6/24*14/24 6/24*6/24
BLOSUM aligned pair proportion observed proportion expected 2 log 2(proportion observed/proportion expected) A to A 52/120 196/576 0. 70 A to B 8/120 56/576 -1. 09 A to C 10/120 84/576 -1. 61 B to A 8/120 56/576 1. 70 B to B 6/120 16/576 1. 70 B to C 6/120 24/576 1. 70 C to A 10/120 84/576 1. 80 C to B 6/120 24/576 1. 80 C to C 14/120 36/576 1. 80
BLOSUM • pab i. e. the fraction of pairings between a and b out of all observed pairs. • For each pair of amino acids a and b, the estimated eab • s(a, b). This quantity is the ratio of the log likelihood that a and b are actually observed aligned in the same column in the blocks to the probability that they are aligned by chance, given their frequencies of occurrence in the blocks. • The resulting log odds values are scaled and rounded to the nearest integer value. In this way, pairs that are more likely than chance will have positive scores, and those less likely will have negative scores.
BLOSUM • • The first four sequences possibly derive from closely related species and the last three from three more distant species. Since A occurs with high frequency in the first four sequences, the observed number of pairings of A with A will be higher than is appropriate if we are comparing more distantly related sequences. Ultimately, each block should have sequences such that any pair have roughly the same amount of 'evolutionary distance' between them those sequences in each block that are 'sufficiently close' to each are treated as a single sequence: each sequence in any cluster has x% or higher sequence identity to at least one other sequence in the cluster in that block. larger-numbered matrices correspond to recent divergence, smallernumbered matrices correspond to distantly related sequences. • BLOSUM 62 standard for ungapped alignments, BLOSUM 50 alignments with gaps A A A C • A A C C A C T A R G C
BLOSUM Observed frequency 1 block 1 cluster C C A R R R A q(A) q(R) q(C) R R C A 3/9 3/9 C BLOSUM 45: sequences that show a homology of at least 45% are treated as a single sequence Proportion observed p(A to A) p(A to R) p(A to C) 2/ 21 p(R to C) p(R to R) p(R to C) 2/ 21 4/ 21 2/ 21 p(C to A) p(C to R) p(C to C) 2/ 21 3/ 21
BLOSUM 62
PAM • The construction of PAM matrices starts with ungapped multiple alignments of proteins into blocks for which all pairs of sequences in any block are, as in the BLOSUM procedure, 'sufficiently close’ to each other. • This is important because the initial goal is to create a transition matrix for a short enough time period so that multiple mutations are unlikely. • phylogenetic reconstruction (MP) • In a maximum parsimony tree, the number of changes can be counted S 4 S 3 S 2 S 1
PAM: parsimony • maximum parsimony tree, • number of changes can be counted I K L Q T V I 0 0 2 0 1 1 K 0 0 0 1 1 0 L 2 0 0 0 Aij Q 0 1 0 T 1 1 0 0 V 1 0 0 0
PAM: Aij mutation matrix Observed number of times Ala was replaced by Arg in a sequence and its immediate ancestor on the tree Convert the observed empirical observations into probabilities to be determined
PAM: conversion into PAM 1 Derive lamda based on the assumption that in a PAM 1, 1% of the amino acids will be mutated freq of AAi Probability that i mutates to j in PAM
PAM: Mutation probability matrix Values are multiplies by 10000 • One element in this matrix, [Mij], denotes the chance that an amino acid in column j will be replaced by an amino acid in row i, when these sequences have diverged over a 1 PAM distance. • Diagonal:
PAM: conversion to PAM 250 To correct for longer evolutionary distances: multiply PAM 1 eg PAM 250 Values are multiplies by 100
PAM: conversion to PAM 250 => X P(A->A) in 2 dt = dt(1) dt(2) P(A->A) X p(A->A) = x 11 P(A->C) X p(C->A) = x 12 x 21 P(A->G) X p(G->A) = x 13 x 31
PAM: log odds For alignments PAM matrices are converted into log odds matrices The odds score represents the likelihood that the two amino acids will be aligned in alignments of similar proteins divided by the likelihood that they will be aligned by chance in an alignment.
PAM: log odds The odds score represents the likelihood that the two amino acids will be aligned in alignments of similar proteins divided by the likelihood that they will be aligned by chance in an alignment. log odds value between Phe-Tyr (7): 1) Phe-Tyr score in the 250 PAM matrix (0. 15) /frequency of Phe (0. 04) = relative frequency of change. = 3. 75 2) logarithm to the base 10 (log 10 of 3. 75 = 0. 57) and multiplied by 10 to remove fractional values. 3) Similarly, the Tyr to Phe score is 0. 20/0. 03 = 6. 7, and the logarithm of this number is log 10 6. 7 = 0. 83, and multiplied by 10. 4) The average of 5. 7 and 8. 3 is 7 Total frequency
PAM vs BLOSUM • PAM matrix based on an evolution model – All amino acids evolve at the same rate – The rate of evolution remains unaltered over long periods of time PAM should be better than BLOSUM More advanced scoring schemes for evolutionary modeling and phylogeny have been developed • To detect sequence similarity: – The best alignment is obtained when an matrix adapted to the evolutionary distance between the 2 studied sequences is used
Algorithms Pairwise Alignment Dynamic programming Needleman Wunsch Smith Waterman (global) (local) Chapter 1 Heuristic approaches Blast Fast. A Database searches Chapter 1
Heuristic Pairwise: FASTA Rather than comparing individual residues in two sequences, FASTA (Fast Alignment) searches for matching sequence patterns or words, or k-tuples. Hashing: common letters or words in the same order and with the same separation in the two sequences sequence 1: ACNGTSCHQE sequence 2: GCHCLSAGQD sequence 1: ACNGTSCHQE C S Q sequence 2: GCHCLSAGQD << offset = 0 sequence 1: ACNGTSCHQE--G C sequence 2: ---GCHCLSAGQD << offset = -3 sequence 1: ACNGTSCHQE----CH << offset = -5 sequence 2: -----GCHCLSAGQD
Heuristic Pairwise: FASTA • all sets of k consecutive matches are detected (see dot plot). • the 10 best-matching regions between the query sequence and the sequence in the database are identified. • an optimal subset of regions is identified that can be combined into one initial, nonoverlapping alignment. • a full local alignment is performed using the Smith. Waterman dynamic programming algorithm.
Heuristic Pairwise: Blast Phase 1: compile a list of words above threshold T • Query sequence: human RBP (…FSGTWYAMAK) • Words derived from the query sequence: FSG SGT GTW TWY WYA … • List of words matching the query (GTW) GTW (6+5+11=22) GSW (6+1+11)=18 GNW (6+0+11) =17 GAW =17 Words above threshold ATW =16 DTW =15 T GTF =12 GTM =10 DAW =10 … Words below threshold
Heuristic Pairwise: Blast Phase 2: scan the database for entries that match the compiled list Phase 3: extend the hits in either direction. Stop when the score drops.
Heuristic Pairwise: Blast • • • Blast. P Blast. N Blast. X t. Blast. N t. Blast. X
Database searches • Functional annotation • Identify paralogs/ortholgs • Phylogenetic profiles of a protein family • Identify alternative splice sites • Detect novel genes
Heuristic Pairwise: Blast To search for new genes Start with a known (protein) sequence Search your novel DNA or protein against a protein database to confirm you have identified a novel gene tblastn Search a DNA database (d. EST, GSS, HTGS) or genomic sequence for a specific organism Inspect the results (1) DNA encoding known Blastx or Blastp proteins (2) DNA encoding novel proteins (3) Non significant matches
Heuristic Pairwise: Blast • Query: sequence submitted • Sbjct: homolog found • Bit score: derived from log odds score Smith waterman • Expect: Score derived from extreme value distribution: probability to observe such a homology (bitscore) by chance) • Identities: percentage of identical residues on the length the sequence aligned • Positives: percentage of similar residues on the length the sequence aligned
Heuristic Pairwise: Psi. Blast • Proteins that only share a limited sequences identity • Psi Blast is more sensitive (iterative procedure) – Normal Blast. P – Construct multiple alignment – Derive from multiple alignments PSSM – Use PSSM to search database
Heuristic Pairwise: Phi. Blast • Search for a protein in the database – That matches the query – Contains a signature of the protein family (active site of an enzyme, structural fold…)
Absolute alignment scores • Alignment scores – Dependent on sequence length (global alignments) – Increase with the choice of a more appropriate scoring scheme (parameter sensitive) => Not comparable between alignments • To make scores comparable between alignments • To decide when an alignment between two sequences is a spurious one • To decide when a hit with a database is significant => statistical scores, p-values, E values
Statistical significance Biological true alignment Score 189
Statistical significance Spurious alignment Score 46
Statistical significance In real alignments one observes regions of closely matching sequence with a positive alignment score. These are rare in random alignments All tests of statistical significance involve a comparison between 1. observed values 2. that value that one would expect to find on average if only random variability was operating P-value: probability of observing a score value by chance (assuming that the H 0 is valid) H 0: sequences are unrelated
Statistical significance = extreme value distribution
Statistical significance • Make a distribution of the alignment scores • The maximum of a large number of i. i. d. random variables tends to an extreme value distribution • Fit an extreme value distribution on the observed scores • Calculate the cumulative distribution
Statistical significance in blast E-value: The number of hits with a score better than x observed by chance The E value –Database size m –Length query sequence n –Specific scoring scheme used (K and l) –The alignment score (# alignments with score of at least x)
Statistical significance in blast p-value (cumulative extreme value is a poisson process) • Probability of observing a hit with a score better than S by chance
Statistical significance in blast • Bitscores (S’)in Blast are different from alignment raw scores (S) • They have been normalized for alignment specific parameters via the parameters of significance distribution • Bitscores in Blast can be compared between different blast runs
Statistical significance in blast
Overview Pairwise alignment • Dynamic programming • Heuristic searches (Blast & fast. A) Multiple alignment • Dynamic programming • Heuristic: Clustal W
Statistical significance in blast
Algorithms Pairwise Alignment Dynamic programming Needleman Wunsch Smith Waterman (global) (local) Chapter 1 Heuristic approaches Blast Fast. A Database searches Chapter 1
Statistical significance in blast E Value: The number of hits with a score better than S observed by chance The E value –Database size m –Length query sequence n –Specific scoring scheme used (K and l) –The alignment score For high scoring hits the E and p value are similar
Statistical significance in blast P-value (cumulative extreme value is a poisson process) • Probability of observing a hit with a score better than S by chance (modelled by a poisson distribution) • Can be derived from the E value
Statistical significance in blast Given an interval of real numbers, assume counts occur at random throughout the interval. If the interval can be partitioned into subintervals of small enough length such that 1. The probability of more than one count in the interval is 0 2. The probability of one count in a subinterval is the same for all subintervals and proportional to the length of the interval 3. The count in each subinterval is independent of other intervals Then the random experiment is a Poisson process If the mean number of counts in the interval is l>0, the random variable X that equals the number of counts in the interval has a Poisson distribution with parameter l and the probability mass function is
- Slides: 75