《动态规划法——双序列比对.ppt》由会员分享,可在线阅读,更多相关《动态规划法——双序列比对.ppt(55页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式1/55回顾Dynamic ProgrammingEdit Distance(编辑距离)Alignment(比对)Directed Acyclic GraphEdit GraphBacktracking-T G C A T -A -CA T -C -T G A T C单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式2/55习题4,求两条序列的最长共同子序列。【作业】v=TACGGGTATw=GGACGTACG单单击击此此处处编编辑辑母母版版标标题题样样
2、式式单单击击此此处处编编辑辑母母版版标标题题样样式式3/550123456789000000000001020304050607080905GGACGTACGTACGGGTAT4Sequence AlignmentSequence Alignment单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式5/55OutlineGlobal Alignment Scoring MatricesLocal AlignmentAlignment with Affine Gap Penalties单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编
3、编辑辑母母版版标标题题样样式式6/55From LCS to Alignment:Change up the ScoringThe Longest Common Subsequence(LCS)problemthe simplest form of sequence alignment allows only insertions and deletions(no mismatches).In the LCS Problem,we scored 1 for matches and 0 for indelsConsider penalizing indels and mismatches wit
4、h negative scoresSimplest scoring schema:+1:match premium -:mismatch penalty -:indel penalty-T G C A T -A -CA T -C -T G A T C单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式7/55Simple ScoringWhen mismatches are penalized by,indels are penalized by,and matches are rewarded with+1,the resulting score
5、is:#matches (#mismatches)(#indels)单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式8/55The Global Alignment ProblemFind the best alignment between two strings under a given scoring schemaInput:Strings v and w and a scoring schemaOutput:Alignment of maximum scorem:mismatch penalty:indel penalty单单击击此此处
6、处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式9/55Scoring MatricesTo generalize scoring,consider a(4+1)x(4+1)scoring matrix.In the case of an amino acid sequence alignment,the scoring matrix would be a(20+1)x(20+1)size.The addition of 1 is to include the score for comparison of a gap character“-”.This wi
7、ll simplify the algorithm as follows:单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式10/55The Blosum62 Scoring Matrix单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式11/55Measuring SimilarityMeasuring the extent of similarity between two sequencesBased on percent sequence identityBased on conservatio
8、n单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式12/55Percent Sequence IdentityThe extent to which two nucleotide or amino acid sequences are invariantA C C T G A G A G A C C T G A G A G A C G T G G C A GA C G T G G C A G70%identicalmismatchindel单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式13/55M
9、aking a Scoring MatrixScoring matrices are created based on biological evidence.Alignments can be thought of as two sequences that differ due to mutations.Some of these mutations have little effect on the proteins function,therefore some penalties,(vi,wj),will be less harsh than others.单单击击此此处处编编辑辑母
10、母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式14/55Scoring Matrix:ExampleARNKA5-2-1-1R-7-13N-70K-6 Notice that although R and K are different amino acids,they have a positive score.Why?They are both positively charged amino acids will not greatly change function of protein.单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母
11、母版版标标题题样样式式15/55ConservationAmino acid changes that tend to preserve the physico-chemical properties of the original residuePolar to polaraspartate glutamateNonpolar to nonpolaralanine valineSimilarly behaving residuesleucine to isoleucine单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式16/55Scoring
12、matricesAmino acid substitution matricesPAMBLOSUMDNA substitution matricesDNA is less conserved than protein sequencesLess effective to compare coding regions at nucleotide level单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式17/55PAMPoint Accepted Mutation(Dayhoff et al.)1 PAM=PAM1=1%average change
13、 of all amino acid positionsAfter 100 PAMs of evolution,not every residue will have changedsome residues may have mutated several timessome residues may have returned to their original statesome residues may not changed at all单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式18/55PAMXPAMx=PAM1xPAM250=
14、PAM1250PAM250 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 9Asn N 4 4 6 7 2 5 6 4 6 3 2 5Asp D 5 4 8 11 1 7 10 5 6 3 2 5Cys C 2 1 1 1 52 1 1 2 2 2 1 1Gln Q 3 5 5 6 1 10 7 3 7 2 3
15、 5.Trp W 0 2 0 0 0 0 0 0 1 0 1 0Tyr Y 1 1 2 1 3 1 1 1 3 2 2 1Val V 7 4 4 4 4 4 4 4 5 4 15 10单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式19/55BLOSUMBlocks Substitution Matrix Scores derived from observations of the frequencies of substitutions in blocks of local alignments in related proteinsMatr
16、ix name indicates evolutionary distanceBLOSUM62 was created using sequences sharing no more than 62%identity单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式20/55The Blosum62 Scoring MatrixBLOSUM 62单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式21/55BLOSUM90PAM30低趋异度小鼠和大鼠RBPBLOSUM45PAM240高趋异度小鼠和细菌的l
17、ipocalinBLOSUM80PAM120BLOSUM62PAM180相似度越低的序列,在比对的时候,采用PAM矩阵时,后面的数字越大,采用BLOSUM矩阵时,后面的数字越小。单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式22/55Local vs.Global AlignmentThe Global Alignment Problem tries to find the longest path between vertices(0,0)and(n,m)in the edit graph.The Local Alignment Proble
18、m tries to find the longest path among paths between arbitrary vertices(i,j)and(i,j)in the edit graph.单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式23/55Local vs.Global AlignmentThe Global Alignment Problem tries to find the longest path between vertices(0,0)and(n,m)in the edit graph.The Local Ali
19、gnment Problem tries to find the longest path among paths between arbitrary vertices(i,j)and(i,j)in the edit graph.In the edit graph with negatively-scored edges,Local Alignmet may score higher than Global Alignment单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式24/55Local vs.Global Alignment(contd)
20、Global AlignmentLocal Alignmentbetter alignment to find conserved segment -T-CC-C-AGT-TATGT-CAGGGGACACGA-GCATGCAGA-GAC|AATTGCCGCC-GTCGT-T-TTCAG-CA-GTTATGT-CAGAT-C tccCAGTTATGTCAGgggacacgagcatgcagagac|aattgccgccgtcgttttcagCAGTTATGTCAGatc单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式25/55Local Align
21、ment:ExampleGlobal alignmentLocal alignmentCompute a“mini”Global Alignment to get Local单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式26/55Local Alignments:Why?Two genes in different species may be similar over short conserved regions and dissimilar over remaining regions.Example:Homeobox genes hav
22、e a short region called the homeodomain that is highly conserved between species.A global alignment would not find the homeodomain because it would try to align the ENTIRE sequence单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式27/55The Local Alignment ProblemGoal:Find the best local alignment betwe
23、en two stringsInput:Strings v,w and scoring matrix Output:Alignment of substrings of v and w whose alignment score is maximum among all possible alignment of all possible substrings单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式28/55The Problem with this ProblemLong run time O(n4):-In the grid of s
24、ize n x n there are n2 vertices(i,j)that may serve as a source.-For each such vertex computing alignments from(i,j)to(i,j)takes O(n2)time.This can be remedied by giving free rides单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式29/55Local Alignment:ExampleGlobal alignmentLocal alignmentCompute a“mini
25、”Global Alignment to get Local单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式30/55Local Alignment:Example单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式31/55Local Alignment:Example单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式32/55Local Alignment:Example单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标
26、题题样样式式33/55Local Alignment:Example单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式34/55Local Alignment:Example单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式35/55Local Alignment:Running TimeLong run time O(n4):-In the grid of size n x n there are n2 vertices(i,j)that may serve as a source.-For each
27、 such vertex computing alignments from(i,j)to(i,j)takes O(n2)time.This can be remedied by giving free rides单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式36/55Local Alignment:Free RidesVertex(0,0)The dashed edges represent the free rides from(0,0)to every other node.Yeah,a free ride!单单击击此此处处编编辑辑母母版
28、版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式37/55The Local Alignment RecurrenceThe largest value of si,j over the whole edit graph is the score of the best local alignment.The recurrence:0 si,j =max si-1,j-1+(vi,wj)s i-1,j +(vi,-)s i,j-1+(-,wj)Notice there is only this change from the original recurrence of a
29、Global Alignment单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式38/55The Local Alignment RecurrenceThe largest value of si,j over the whole edit graph is the score of the best local alignment.The recurrence:0 si,j =max si-1,j-1+(vi,wj)s i-1,j +(vi,-)s i,j-1+(-,wj)Power of ZERO:there is only this cha
30、nge from the original recurrence of a Global Alignment-since there is only one“free ride”edge entering into every vertex单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式39/55http:/blast.ncbi.nlm.nih.gov/Blast.cgi NP_006735NP_000945单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式40/55单单击击此此处处编编辑辑母母版版标
31、标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式41/55习题考虑序列v=TACGGGTAT和w=GGACGTACG。假设匹配奖励+1,错配和插缺罚分均为-1.【作业】填写序列v和w之间的全局联配的动态规划表(编辑图或相似度矩阵)。在各单元画出箭头以存储返回信息。全局最优联配的得分是多少?这个得分对应的联配又是什么?填写序列v和w之间的局部联配的动态规划表。在各单元画出箭头以存储返回信息。在这种情形下,局部最优联配的得分是多少?这个得分对应的联配又是什么?单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式42/55-012345678
32、900-1-2-3-4-5-6-7-8-91-12-23-34-45-56-67-78-899GGACGTACGTACGGGTAT全局比对单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式43/55局部比对-012345678900000000000102030405060708090GGACGTACGTACGGGTAT单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式44/55Scoring Indels:Naive ApproachA fixed penalty is given to every
33、indel:-for 1 indel,-2 for 2 consecutive indels-3 for 3 consecutive indels,etc.Can be too severe penalty for a series of 100 consecutive indels单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式45/55Affine Gap PenaltiesIn nature,a series of k indels often come as a single event rather than a series of k
34、 single nucleotide events:Normal scoring would give the same score for both alignmentsThis is more likely.This is less likely.单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式46/55Accounting for GapsGaps-contiguous sequence of spaces in one of the rowsScore for a gap of length x is:-(+x)where 0 is th
35、e penalty for introducing a gap:gap opening penalty will be large relative to:gap extension penalty because you do not want to add too much of a penalty for extending the gap.单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式47/55Affine Gap PenaltiesGap penalties:-when there is 1 indel-2 when there ar
36、e 2 indels-3 when there are 3 indels,etc.-x(-gap opening-x gap extensions)Somehow reduced penalties(as compared to nave scoring)are given to runs of horizontal and vertical edges单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式48/55Affine Gap Penalties and Edit GraphTo reflect affine gap penalties we
37、 have to add“long”horizontal and vertical edges to the edit graph.Each such edge of length x should have weight -x*单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式49/55Adding“Affine Penalty”Edges to the Edit GraphThere are many such edges!Adding them to the graph increases the running time of the al
38、ignment algorithm by a factor of n(where n is the number of vertices)So the complexity increases from O(n2)to O(n3)单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式50/55Manhattan in 3 Layers单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式51/55Affine Gap Penalties and 3 Layer Manhattan GridThe three r
39、ecurrences for the scoring algorithm creates a 3-layered graph.The top level creates/extends gaps in the sequence w.The bottom level creates/extends gaps in sequence v.The middle level extends matches and mismatches.单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式52/55Switching between 3 LayersLevel
40、s:The main level is for diagonal edges The lower level is for horizontal edges The upper level is for vertical edgesA jumping penalty is assigned to moving from the main level to either the upper level or the lower level(-)There is a gap extension penalty for each continuation on a level other than
41、the main level(-)单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式53/55The 3-leveled Manhattan Grid单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式54/55Affine Gap Penalty RecurrencesContinue Gap in w(deletion)Start Gap in w(deletion):from middleContinue Gap in v(insertion)Start Gap in v(insertion):fr
42、om middleMatch or MismatchEnd deletion:from topEnd insertion:from bottom单单击击此此处处编编辑辑母母版版标标题题样样式式单单击击此此处处编编辑辑母母版版标标题题样样式式55/55习题考虑序列v=TACGGGTAT和w=GGACGTACG。假设匹配奖励+1,错配和插缺罚分均为-1.填写序列v和w之间的全局联配的动态规划表(编辑图或相似度矩阵)。在各单元画出箭头以存储返回信息。全局最优联配的得分是多少?这个得分对应的联配又是什么?填写序列v和w之间的局部联配的动态规划表。在各单元画出箭头以存储返回信息。在这种情形下,局部最优联配的得分是多少?这个得分对应的联配又是什么?假设使用仿射缺口惩罚,其中引入缺口开放的罚分为-10,缺口扩展的罚分为-1。匹配和错配的得分不改变。在这种情形下,全局最优联配是什么?他的得分是多少?