Top Banner
. Sequence Alignment
30

. Sequence Alignment. Sequences Much of bioinformatics involves sequences u DNA sequences u RNA sequences u Protein sequences We can think of these sequences.

Jan 13, 2016

Download

Documents

Arabella Melton
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • . Sequence Alignment

  • SequencesMuch of bioinformatics involves sequencesDNA sequencesRNA sequencesProtein sequences

    We can think of these sequences as strings of lettersDNA & RNA: alphabet of 4 lettersProtein: alphabet of 20 letters

  • 20 Amino AcidsGlycine (G, GLY)Alanine (A, ALA)Valine (V, VAL)Leucine (L, LEU)Isoleucine (I, ILE)Phenylalanine (F, PHE)Proline (P, PRO)Serine (S, SER)Threonine (T, THR)Cysteine (C, CYS)Methionine (M, MET)Tryptophan (W, TRP)Tyrosine (T, TYR)Asparagine (N, ASN)Glutamine (Q, GLN)Aspartic acid (D, ASP)Glutamic Acid (E, GLU)Lysine (K, LYS)Arginine (R, ARG)Histidine (H, HIS)START: AUGSTOP: UAA, UAG, UGA

  • Sequence ComparisonFinding similarity between sequences is important for many biological questionsFor example:Find genes/proteins with common originAllows to predict function & structureLocate common subsequences in genes/proteinsIdentify common motifsLocate sequences that might overlapHelp in sequence assembly

  • Sequence AlignmentInput: two sequences over the same alphabetOutput: an alignment of the two sequences

    Example:GCGCATGGATTGAGCGATGCGCCATTGATGACCAA possible alignment:-GCGC-ATGGATTGAGCGATGCGCCATTGAT-GACC-A

  • Alignments-GCGC-ATGGATTGAGCGATGCGCCATTGAT-GACC-A

    Three elements:Perfect matchesMismatchesInsertions & deletions (indel)

  • Choosing AlignmentsThere are many possible alignments

    For example, compare:-GCGC-ATGGATTGAGCGATGCGCCATTGAT-GACC-Ato------GCGCATGGATTGAGCGATGCGCC----ATTGATGACCA--

    Which one is better?

  • Scoring AlignmentsRough intuition:Similar sequences evolved from a common ancestorEvolution changed the sequences from this ancestral sequence by mutations:Replacements: one letter replaced by anotherDeletion: deletion of a letterInsertion: insertion of a letterScoring of sequence similarity should examine how many operations took place

  • Simple Scoring RuleScore each position independently:Match: +1Mismatch: -1Indel -2Score of an alignment is sum of positional scores

  • ExampleExample:-GCGC-ATGGATTGAGCGATGCGCCATTGAT-GACC-AScore: (+1x13) + (-1x2) + (-2x4) = 3

    ------GCGCATGGATTGAGCGATGCGCC----ATTGATGACCA--Score: (+1x5) + (-1x6) + (-2x11) = -23

  • More General ScoresThe choice of +1,-1, and -2 scores was quite arbitraryDepending on the context, some changes are more plausible than othersExchange of an amino-acid by one with similar properties (size, charge, etc.)vs.Exchange of an amino-acid by one with opposite properties

  • For proteins

  • Additive Scoring RulesWe define a scoring function by specifying a function (x,y) is the score of replacing x by y(x,-) is the score of deleting x(-,x) is the score of inserting xThe score of an alignment is the sum of position scores

  • Edit DistanceThe edit distance between two sequences is the cost of the cheapest set of edit operations needed to transform one sequence into the other

    Computing edit distance between two sequences almost equivalent to finding the alignment that minimizes the distance

  • Computing Edit DistanceHow can we compute the edit distance??If |s| = n and |t| = m, there are more than alignments

    The additive form of the score allows to perform dynamic programming to compute edit distance efficiently

  • Recursive ArgumentDefine the notation:

    Using the recursive argument, we get the following recurrence for V:

  • Recursive ArgumentOf course, we also need to handle the base cases in the recursion:

  • Dynamic Programming AlgorithmWe fill the matrix using the recurrence rule

    0

    A

    1

    G

    2

    C

    3

    0

    A 1

    A 2

    A 3

    C 4

  • Dynamic Programming Algorithm

    0

    A

    1

    G

    2

    C

    3

    0

    0

    -2

    -4

    -6

    A 1

    -2

    1

    -1

    -3

    A 2

    -4

    -1

    0

    -2

    A 3

    -6

    -3

    -2

    -1

    C 4

    -8

    -5

    -4

    -1

  • Reconstructing the Best AlignmentTo reconstruct the best alignment, we record which case in the recursive rule maximized the score

    0

    A

    1

    G

    2

    C

    3

    0

    0

    -2

    -4

    -6

    A 1

    -2

    1

    -1

    -3

    A 2

    -4

    -1

    0

    -2

    A 3

    -6

    -3

    -2

    -1

    C 4

    -8

    -5

    -4

    -1

  • Reconstructing the Best AlignmentWe now trace back the path the corresponds to the best alignmentAAACAG-C

    0

    A

    1

    G

    2

    C

    3

    0

    0

    -2

    -4

    -6

    A 1

    -2

    1

    -1

    -3

    A 2

    -4

    -1

    0

    -2

    A 3

    -6

    -3

    -2

    -1

    C 4

    -8

    -5

    -4

    -1

  • Reconstructing the Best AlignmentSometimes, more than one alignment has the best scoreAAACA-GC

    0

    A

    1

    G

    2

    C

    3

    0

    0

    -2

    -4

    -6

    A 1

    -2

    1

    -1

    -3

    A 2

    -4

    -1

    0

    -2

    A 3

    -6

    -3

    -2

    -1

    C 4

    -8

    -5

    -4

    -1

  • Local AlignmentConsider now a different question:Can we find similar substring of s and tFormally, given s[1..n] and t[1..m] find i,j,k, and l such that d(s[i..j],t[k..l]) is maximal

  • Local AlignmentAs before, we use dynamic programmingWe now want to setV[i,j] to record the best alignment of a suffix of s[1..i] and a suffix of t[1..j]

    How should we change the recurrence rule?

  • Local AlignmentNew option:We can start a new match instead of extend previous alignmentAlignment of empty suffixes

  • Local Alignment Examples = TAATAt = ATCTAA

    0

    A

    1

    T

    2

    C

    3

    T

    4

    A

    5

    A

    6

    0

    T 1

    A 2

    A 3

    T 4

    A 5

  • Local Alignment Examples = TAATAt = TACTAA

    0

    T

    1

    A

    2

    C

    3

    T

    4

    A

    5

    A

    6

    0

    0

    0

    0

    0

    0

    0

    0

    T 1

    0

    1

    0

    0

    1

    0

    0

    A 2

    0

    0

    2

    0

    0

    2

    1

    A 3

    0

    0

    1

    1

    0

    1

    3

    T 4

    0

    0

    0

    0

    2

    0

    1

    A 5

    0

    0

    1

    0

    0

    3

    1

  • Local Alignment Examples = TAATAt = TACTAA

    0

    T

    1

    A

    2

    C

    3

    T

    4

    A

    5

    A

    6

    0

    0

    0

    0

    0

    0

    0

    0

    T 1

    0

    1

    0

    0

    1

    0

    0

    A 2

    0

    0

    2

    0

    0

    2

    1

    A 3

    0

    0

    1

    1

    0

    1

    3

    T 4

    0

    0

    0

    0

    2

    0

    1

    A 5

    0

    0

    1

    0

    0

    3

    1

  • Local Alignment Examples = TAATAt = TACTAA

    0

    T

    1

    A

    2

    C

    3

    T

    4

    A

    5

    A

    6

    0

    0

    0

    0

    0

    0

    0

    0

    T 1

    0

    1

    0

    0

    1

    0

    0

    A 2

    0

    0

    2

    0

    0

    2

    1

    A 3

    0

    0

    1

    1

    0

    1

    3

    T 4

    0

    0

    0

    0

    2

    0

    1

    A 5

    0

    0

    1

    0

    0

    3

    1

  • Sequence AlignmentWe seen two variants of sequence alignment:Global alignmentLocal alignment

    Other variants:Finding best overlap (exercise)

    All are based on the same basic idea of dynamic programming