940 likes | 1.09k Views
Sequence Alignment and Phylogenetic Analysis. Evolution. Sequence Alignment. AGGCTATCACCTGACCTCCAGGCCGATGCCC TAGCTATCACGACCGCGGTCGATTTGCCCGAC. - AG G CTATCAC CT GACC T C CA GG C CGA -- TGCCC --- T AG - CTATCAC -- GACC G C -- GG T CGA TT TGCCC GAC. Definition
E N D
Sequence Alignment AGGCTATCACCTGACCTCCAGGCCGATGCCC TAGCTATCACGACCGCGGTCGATTTGCCCGAC -AGGCTATCACCTGACCTCCAGGCCGA--TGCCC--- TAG-CTATCAC--GACCGC--GGTCGATTTGCCCGAC Definition Given two strings x = x1x2...xM, y = y1y2…yN, an alignment is an assignment of gaps to positions 0,…, N in x, and 0,…, N in y, so as to line up each letter in one sequence with either a letter, or a gap in the other sequence
What is a good alignment? AGGCTAGTT, AGCGAAGTTT AGGCTAGTT- 6 matches, 3 mismatches, 1 gap AGCGAAGTTT AGGCTA-GTT- 7 matches, 1 mismatch, 3 gaps AG-CGAAGTTT AGGC-TA-GTT- 7 matches, 0 mismatches, 5 gaps AG-CG-AAGTTT
Scoring Function • Sequence edits: AGGCCTC • Mutations AGGACTC • Insertions AGGGCCTC • Deletions AGG . CTC Scoring Function: Match: +m Mismatch: -s Gap: -d Score F = (# matches) m - (# mismatches) s – (#gaps) d
Example x = AGTA m = 1 y = ATA s = -1 d = -1 F(1, 1) = max{F(0,0) + s(A, A), F(0, 1) – d, F(1, 0) – d} = max{0 + 1, -1 – 1, -1 – 1} = 1 F(i,j) i = 0 1 2 3 4 j = 0 1 2 A A G - T T A A 3
The Needleman-Wunsch Matrix x1 ……………………………… xM Every nondecreasing path from (0,0) to (M, N) corresponds to an alignment of the two sequences y1 ……………………………… yN An optimal alignment is composed of optimal subalignments
PAMX • PAMx = PAM1x • PAM250 = PAM1250 • PAM250 is a widely used scoring matrix: Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys ... A R N D C Q E G H I L K ... Ala A 13 6 9 9 5 8 9 12 6 8 6 7 ... Arg R 3 17 4 3 2 5 3 2 6 3 2 9 Asn N 4 4 6 7 2 5 6 4 6 3 2 5 Asp D 5 4 8 11 1 7 10 5 6 3 2 5 Cys C 2 1 1 1 52 1 1 2 2 2 1 1 Gln Q 3 5 5 6 1 10 7 3 7 2 3 5 ... Trp W 0 2 0 0 0 0 0 0 1 0 1 0 Tyr Y 1 1 2 1 3 1 1 1 3 2 2 1 Val V 7 4 4 4 4 4 4 4 5 4 15 10
This is more likely. This is less likely. Affine Gap Penalties • In nature, a series of k indels often come as a single event rather than a series of k single nucleotide events: ATA__GC ATATTGC ATAG_GC AT_GTGC Normal scoring would give the same score for both alignments
Affine gaps (n) e (n) = d + (n – 1)e | | gap gap open extend To compute optimal alignment, F(i, j): score of alignment x1…xi to y1…yj if xi aligns to yj G(i, j): score if xi aligns to a gap after yj H(i, j): score if yj aligns to a gap after xi V(i, j) = best score of alignment x1…xi to y1…yj d
Needleman-Wunsch with affine gaps Initialization: V(i, 0) = d + (i – 1)e V(0, j) = d + (j – 1)e Iteration: V(i, j) = max{ F(i, j), G(i, j), H(i, j) } F(i, j) = V(i – 1, j – 1) + s(xi, yj) V(i, j – 1) – d G(i, j) = max G(i, j – 1) – e V(i – 1, j) – d H(i, j) = max H(i – 1, j) – e Termination: similar
Some Typical Dot-plot Comparisons • Divergent sequences where only a segment is homologous • Long insertions and deletions • Tandem repeats • The square shape of the pattern is characteristic of these repeats
Using Dotlet • Dotlet is one of the handiest tools for making dot plots • Dotlet is a Java applet • Open and download the applet at the following site: http://myhits.isb-sib.ch/cgi-bin/dotlet • Use Firefox or IE
Window size Threshold window for fine tuning Dot plot window Alignment window
Window size Threshold window for fine tuning Dot plot window Alignment window
Window size Threshold window for fine tuning Dot plot window Alignment window
Looking at Repeated Domains with Dotlet • The square shape is typical of tandem repeats • The repeats are not perfect because the sequences have diverged after their duplication
Comparing a Gene and Its Product • Eukaryotic genes are transcribed into RNA • The RNA is then spliced to remove the introns’ sequences • It may be necessary to compare the gene and its product • Dotlet makes this comparative analysis easy
Lalign and BLAST • Lalign is like a very precise BLAST • It works on only two sequences at a time • You must provide both sequences
LaLign http://www.ch.embnet.org/software/LALIGN_form.html
Lalign Output • Lalign produces an output similar to the alignment section of BLAST • The E-value indicates the significance of each alignment • Low E-value good alignment
Generalizing the Notion of Pairwise Alignment • Alignment of 2 sequences is represented as a 2-row matrix • In a similar way, we represent alignment of 3 sequences as a 3-row matrix A T _ G C G _ A _ C G T _ A A T C A C _ A • Score: more conserved columns, better alignment
Aligning Three Sequences source • Same strategy as aligning two sequences • Use a 3-D “”, with each axis representing a sequence to align • For global alignments, go from source to sink sink
Architecture of 3-D Alignment Cell (i-1,j,k-1) (i-1,j-1,k-1) (i-1,j,k) (i-1,j-1,k) (i,j,k-1) (i,j-1,k-1) (i,j,k) (i,j-1,k)
si-1,j-1,k-1 + (vi, wj, uk) si-1,j-1,k + (vi, wj, _ ) si-1,j,k-1 + (vi, _, uk) si,j-1,k-1 + (_, wj, uk) si-1,j,k + (vi, _ , _) si,j-1,k + (_, wj, _) si,j,k-1 + (_, _, uk) Multiple Alignment: Dynamic Programming cube diagonal: no indels • si,j,k = max • (x, y, z) is an entry in the 3-D scoring matrix face diagonal: one indel edge diagonal: two indels
Multiple Alignment: Running Time • For 3 sequences of length n, the run time is 7n3; O(n3) • For ksequences, build a k-dimensional Manhattan, with run time (2k-1)(nk); O(2knk) • Conclusion: dynamic programming approach for alignment between two sequences is easily extended to k sequences but it is impractical due to exponential running time
Sum of Pairs Score(SP-Score) • Consider pairwise alignment of sequences aiand aj imposed by a multiple alignment of k sequences • Denote the score of this suboptimal (not necessarily optimal)pairwise alignment as s*(ai, aj) • Sum up the pairwise scores for a multiple alignment: s(a1,…,ak) = Σi,j s*(ai, aj)
SP-Score: Example a1 . ak ATG-C-AAT A-G-CATAT ATCCCATTT To calculate each column: s s*( Pairs of Sequences A G 1 Score=3 1 1 Score = 1 – 2m -m A A C G 1 -m Column 1 Column 3
Multiple Alignment Induces Pairwise Alignments Every multiple alignment induces pairwise alignments x: AC-GCGG-C y: AC-GC-GAG z: GCCGC-GAG Induces: x: ACGCGG-C; x: AC-GCGG-C; y: AC-GCGAG y: ACGC-GAC; z: GCCGC-GAG; z: GCCGCGAG
Reverse Problem: Constructing Multiple Alignment from Pairwise Alignments Given 3 arbitrary pairwise alignments: x: ACGCTGG-C; x: AC-GCTGG-C; y: AC-GC-GAG y: ACGC--GAC; z: GCCGCA-GAG; z: GCCGCAGAG can we construct a multiple alignment that induces them?
Reverse Problem: Constructing Multiple Alignment from Pairwise Alignments Given 3 arbitrary pairwise alignments: x: ACGCTGG-C; x: AC-GCTGG-C; y: AC-GC-GAG y: ACGC--GAC; z: GCCGCA-GAG; z: GCCGCAGAG can we construct a multiple alignment that induces them? NOT ALWAYS Pairwise alignments may be inconsistent
Profile Representation of Multiple Alignment - A G G C T A T C A C C T G T A G – C T A C C A - - - G C A G – C T A C C A - - - G C A G – C T A T C A C – G G C A G – C T A T C G C – G G A 1 1 .8 C .6 1 .4 1 .6 .2 G 1 .2 .2 .4 1 T .2 1 .6 .2 - .2 .8 .4 .8 .4
Multiple Alignment: Greedy Approach • Choose most similar pair of strings and combine into a profile , thereby reducing alignment of k sequences to an alignment of of k-1 sequences/profiles. Repeat • This is a heuristic greedy method u1= ACg/tTACg/tTACg/cT… u2 = TTAATTAATTAA… … uk = CCGGCCGGCCGG… u1= ACGTACGTACGT… u2 = TTAATTAATTAA… u3 = ACTACTACTACT… … uk = CCGGCCGGCCGG k-1 k
Greedy Approach: Example • Consider these 4 sequences s1 GATTCA s2 GTCTGA s3 GATATT s4 GTCAGC
Greedy Approach: Example(cont’d) • There are = 6 possible alignments s2GTCTGA s4GTCAGC (score = 2) s1 GAT-TCA s2 G-TCTGA (score = 1) s1 GAT-TCA s3 GATAT-T (score = 1) s1 GATTCA-- s4 G—T-CAGC(score = 0) s2G-TCTGA s3GATAT-T (score = -1) s3GAT-ATT s4G-TCAGC (score = -1)
Greedy Approach: Example(cont’d) s2 and s4 are closest; combine: s2GTCTGA s4GTCAGC s2,4GTCt/aGa/cA(profile) new set of 3 sequences: s1 GATTCA s3 GATATT s2,4GTCt/aGa/c
Progressive Alignment • Progressive alignment is a variation of greedy algorithm with a somewhat more intelligent strategy for choosing the order of alignments. • Progressive alignment works well for close sequences, but deteriorates for distant sequences • Gaps in consensus string are permanent • Use profiles to compare sequences
ClustalW • Popular multiple alignment tool today • ‘W’ stands for ‘weighted’ (different parts of alignment are weighted differently). • Three-step process 1.) Construct pairwise alignments 2.) Build Guide Tree 3.) Progressive Alignment guided by the tree
Step 2: Guide Tree • Create Guide Tree using the similarity matrix • ClustalW uses the neighbor-joining method • Guide tree roughly reflects evolutionary relations