Needleman-Wunch, Waterman-Smith-Beyer, and Gotoh's Algorithms for Alignment and Repeats, Study notes of Bioinformatics

Sequence alignment algorithms, including the needleman-wunch, waterman-smith-beyer, and gotoh's algorithms. The concepts behind these methods, their efficiency, and how they can be extended to align sequences with tandem repeats. The document also introduces the concept of tandem repeats and their significance in dna.

Typology: Study notes

Pre 2010

Uploaded on 02/12/2009

koofers-user-aje
koofers-user-aje 🇺🇸

9 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
BINF 730 – Lecture 4
Finish Sequence Alignment and
Multiple Sequence Alignment
Sequence Alignment
Needleman-Wunch Algorithm – global
alignment, fixed gap penalty
Waterman-Smith-Beyer Algorithm– local
alignment, affine gap penalty function
Gotoh’s algorithm – local alignment, affine
gap penalty function
Efficiency of Algorithms
Needleman-Wunch Algorithm – O(nm) =
O(n2) for n >= m
Waterman-Smith-Beyer Algorithm–
O(nm(n+m) = O(n3) for n >= m
Gotoh’s algorithm – O(nm) = O(n2) for n
>= m
Needleman-Wunch Algorithm
(Global Alignment)
gapaofweighttheiswwhere
awD
bawD
bwD
Dji
awD
bwD
D
iji
jiji
jji
ji
i
kki
j
kkj
+
+
+
=>
=
=
=
=
=
),(
),(
),(
min0,
),(
),(
0
,1
1,1
1,
,
1
0,
1
,0
0,0
Waterman-Smith-Beyer Algorithm
(Local Alignment)
functionscoresimilaritytheisw
andfunctionpenaltygaptheiskgwhere
kgD
bawD
kgD
Dji
igD
jgD
D
jki
jk
jiji
kji
jk
ji
i
j
)(
))((min
),(
))((min
min0,
)(
)(
0
,
1
1,1
,
1
,
0,
,0
0,0
+
+
+
=>
=
=
=
Gotoh’s Algorithm – (Local Alignment)
+
+
=
=
+
+
=
=
+=
=
=
=
β
β
1,
1,
,
0,
,1
,1
,
,0
,
1,1
,
,
0,
,0
0,0
)1(
min
)1(
min
||1,||1
),(min
)(
)(
0
ji
ji
ji
i
ji
ji
ji
j
ji
jiji
ji
ji
i
j
Q
gD
Q
Q
and
P
gD
P
P
bjai
Q
bawD
P
D
igD
jgD
D
Consider the gapless sequences
a and b. Let g(k) = α + kβbe an
affine gap penalty function and
let w(ai,bj) be a cost function.
D is the distance matrix.
P is the matrix with the minimal
distances for all alignments with
boending in a gap.
Q is the matrix with the minimal
distances for all alignments with
aoending in a gap.
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Needleman-Wunch, Waterman-Smith-Beyer, and Gotoh's Algorithms for Alignment and Repeats and more Study notes Bioinformatics in PDF only on Docsity!

BINF 730 – Lecture 4

Finish Sequence Alignment and

Multiple Sequence Alignment

Sequence Alignment

• Needleman-Wunch Algorithm – global

alignment, fixed gap penalty

• Waterman-Smith-Beyer Algorithm– local

alignment, affine gap penalty function

• Gotoh’s algorithm – local alignment, affine

gap penalty function

Efficiency of Algorithms

• Needleman-Wunch Algorithm – O(nm) =

O(n

) for n >= m

• Waterman-Smith-Beyer Algorithm–

O(nm(n+m) = O(n

) for n >= m

• Gotoh’s algorithm – O(nm) = O(n

) for n

>= m

Needleman-Wunch Algorithm

(Global Alignment)

wherewistheweightofa gap

D wa

D wab

D w b

ij D

D wa

D w b

D

i j i

i j i j

ij j

ij

i

k

i k

j

k

j k

−−

=

=

, 0 min

1 ,

1 , 1

, 1

,

1

, 0

1

0 ,

0 , 0

Waterman-Smith-Beyer Algorithm

(Local Alignment)

wisthesimilarityscore function

wheregkisthegappenaltyfunctionand

D gk

D wab

D gk

ij D

D gi

D gj

D

kj ikj

i j i j

kj ijk

ij

i

j

min( ())

min( ())

, 0 min

1 ,

1 , 1

1 ,

,

, 0

0 ,

0 , 0

≤≤ −

−−

≤≤ −

Gotoh’s Algorithm – (Local Alignment)

−−

β

β

, 1

, 1 ,

, 0

1 ,

1 , ,

0 ,

,

1 , 1

,

,

, 0

0 ,

0 , 0

min

min

min ( , )

i j

ij ij

i

i j

i j ij

j

ij

i j i j

ij

ij

i

j

Q

D g Q

Q

and P

D g P

P

i a j b

Q

D wab

P

D

D gi

D gj

Consider the gapless sequences D

a and b. Let g(k) = α + kβ be an

affine gap penalty function and

let w(ai ,b j ) be a cost function.

D is the distance matrix.

P is the matrix with the minimal

distances for all alignments with

b

o

ending in a gap.

Q is the matrix with the minimal

distances for all alignments with

a

o

ending in a gap.

Gotoh’s Algorithm

• Uses dynamic programming with three

matrices (instead of 1) to store information

so they do not have to be recaculated.

• Traceback – need to track movement

through all three matrices.

Tandem Repeats

• A tandem repeat or tandem duplication is a

subsequence of characters that repeats itself

multiple times in a sequence with the copies

adjacent to each other.

Example

ACGAG CCGTAGAA TACCG

ACGAG CCGTAGAA CCGTAGAA CCGTAGAA TACCG

Tandem Repeats

• Tandem repeats are found throughout prokaryote

and eukaryote DNA.

• In humans, they are known to cause at least 10

inherited neurogical diseases, Huntington’s

disease, and myotonic dystrophy.

• They are also implicated in diabetes, epilepsy, and

ovarian and other cancers.

• They are used in DNA fingerprinting and can

differentiate between bacterial strains (including

anthrax).

Tandem Repeats

If we assume that

1. There is no removal of copies of the duplicated

tandem repeat region.

2. Tandem duplication occurs before the other types

of operations

Benson showed that Gotoh’s algorithm can be

extended to align sequences with tandem repeats.

The duplication cost is d(l)=γ+δl

Tandem Repeats

and D dk Da b

D dk Da b

Duplij

i a j b

Duplij

Q

D wab

P

D

D gi

D gj

D

js j

k ir i k

irjs

k ir i js j k

irjs

ij

i j i j

ij

ij

i

j

−+ −+ ∈

− −

−+ −+ ∈

− −

−−

[,] min

[,]

min

1 ... 1 ... { 01 ,, 2 ...}

,

1 ... 1 ... { 0 , 1 , 2 ...}

,

,

1 , 1

,

,

, 0

0 ,

0 , 0

min

min

K copies of the word b j-s+1…j

Wraparound Method

• When aligning a sequence with tandem repeats,

use the ‘wrap around’ method to minimize

calculations.

• When implementing the wrap around method,

look at the section with tandem repeats

separately.

• Write the repeated sequence only once in the

similarity matrix.

• Align as usual except when reaching the end of

the repeated sequence, use that value as the

first value in the next row and repeat this

procedure.

Wraparound Method Wraparound Method

3 4 5

Similarity Methods

a) Maximize the similarity between two

sequences rather than minimizing the

distance.

b) Use similarity score function s(x,y) to

compare characters x and y with s(x,y) > 0 for

x = y and s(x,y) < 0 for x ><y. The score for

a gap can be different than the score for a

mismatch.

c) transition = a substitution of a purine for a

purine or a pyrmidine for a pyrimidine if the

alignment for a random sequence is negative

(which is guaranteed by the PAM matrices).

Similarity Methods

d) tranversion = a substitution of a pyr for a

pur or a pur for a pyr

e) Once again use dynamic programming

algorithm.

f) This can be used for local or global

alignments

Multiple Sequence Alignment

• Up until now we have aligned two sequence

at a time.

• There are times when we would want to

align more than two sequences

simultaneously – i.e. looking for consensus

sequences, or looking for homology in a

family of proteins

Multiple Sequence Alignment

The text presents five methods

• Dynamic Programming

• Gibbs Sampler

• Maximum-Weight Trace

• Hidden Markov Models

• Steiner Sequences.

Multiple Sequence Alignment –

Dynamic Programming

• This is an extension of the pairwise

sequence alignment we have discussed.

• Assume we want to align k sequences of

length at most k

• Develop a cost function w(a

,…a

k

) that will

align multiple letters at a time.

• Same as before except the distance matrix is

(k dimensional) and the weight function

compares k letters.

Dynamic Programming for

Multiple Sequence Alignment

•Assume that we are trying to align three

sequence a,b, and c.

•Also assume that we have a cost function

w(x,y,z) that computes the cost of comparing

x, y, and z in sequences a, b, and c

respectively.

x y z

of symbolsarethesame

x y z

wxyz

Dynamic Programming for

Multiple Sequence Alignment

−−

− −

− −

− −−

,, 0 min

,, 1

, 1 ,

1 ,,

1 , 1 ,

1 ,, 1

, 1 , 1

1 , 1 , 1

,,

ijk k

ij k j

i jk i

i j k i j

i jk i k

ij k j k

i j k i j k

ijk

D w c

D w b

D wa

D wab

D wa c

D w bc

D wab c

ijk D

• Alternatvively we can define our

distance matrix D by

Multiple Sequence Alignment –

Dynamic Programming

• This would take n

k

time with can be long if

for large n and k.

• NP-complete problem – this means that is it

the length of the sequence or number of

sequences get large if is extremely

computationally expensive to solve.

• Need more efficient methods.

Gibbs Sampler

• The Gibbs Sampler is based on the Gibbs

Distribution (pages 47-52).

• Basically, perform local alignments on

windows (subsequences) of fixed size.

• The optimal alignment is found after

varying the window size and repeating.

• Original Gibbs Sampler looks for motifs in

a protein.

Gibbs Sampler Algorithm

1. Identify random size w segments, or

windows, from m amino acid sequences.

2. Choose one of the m proteins at random

and temporarily call it P, where r

,…,r

n

is

its amino acid sequence.

3. Define a 20 x m frequency matrix Q where

Q

r,j

= N

r,j

/(m-1) and N

r,j

is the number of

occurrences of residue r at position j in the

m-1 remaining proteins.

Complete Maximum Weight

Trace

Example – Here is a possible set trace that is

not allows since two edges cross.

A A C G

A G G

Hidden Markov Models

• View the sequences to be aligned as a training

set of observations that differ from an

ancestor sequence as the result of a stochastic

processes.

• The stochastic model that can best account for

the sequences in the training set is

determined.

• This method uses maximum likelihood and

expectation minimization.

Hidden Markov Models

• This alignment is determined by how the

sequences would match up with the

ancestor sequence.

• We will discuss Hidden Markov Models in

Detail later.

Steiner Sequences

• This is related to multiple sequence

alignment.

• In a method of DNA sequencing called

single-molecule DNA sequencing, a single

stranded DNA molecule is cut a single base

pair at a time.

• The freed base flows down a glass tube by

an optical sensor that determines the base.

Steiner Sequences

• This technique has errors especially near the

ends of the DNA.

• If this method is repeated many times, many

copies of erroneous DNA are generated.

• This method computes an alignment of

these sequences to find the actual sequence.

Steiner Sequences

1. Given N erroneous copies of an original DNA

sequence to be determined, let M=N.

2. Partition the M sequences into M/3 groups of

three sequences.

3. Apply dynamic programming with cost function

w(x,y,z) given earlier to determine an optimal

alignment of the three sequences U, V,W in each

group. From this alignment define the consensus

sequence S obtained by taking the majority

symbol in each column and then removing all

occurrences of -.

Steiner Sequences

4. This consensus sequence S is a Steiner sequence

for U,V,W meaning that S satisfies

D(S,U)+D(S,V)+D(S,W)=

min{D(T,U)+D(T,V)+D(T,W).

5. The previous step yields M/3 Steiner sequences.

If M=3 the stop and output the resulting

sequence. Otherwise, let M=M/3 and return to

step 2.

Genomic Rearrangements

• The genes are located in the chromosomes.

• Chromosomes can trade material intra- or

inter-chromosomally.

• These events are rarer that point mutations.

• Hence they can be used to determine

similarity between very distant organisms

Intra-chromosomal Events

• Inversion of a continuous segment of genes

(from 5’3’ to 3’5’ or vice versa)

• Duplication of pieces of the chromosome

possible caused by transposons

• Transposition of a segment of a gene from

one place to another place in the same

chromosome.

Inter-chromosomal Events

• Reciprocal translocation – end segments of

two chromosomes are exchanges with each

other

• Chromosomal duplication – the number of

chormosomes is doubled

• Fission – one chromosome is broken into

pieces

• Fusion – two chromosomes are combined

into one

Synteny

• Consider the genome as a distinct unordered

set of genes.

• Two genes are said to syntenic if they both

lie on the same chromosome.

• Chromosomes can then be considered to be

syntenic sets.

• Then these sets can be transformed by

fission, fusion, and reciprocal translocation.

Synteny

Consider the synteny sets of current organisms.

• Is it possible to create a synteny set of an

ancestral organism?

• How many chromosomes did an ancestral

species have?

• Which genes were on which chromosomes?

• How do the phylogenetic trees compare to

those generated by sequence alignment?