100% found this document useful (1 vote)
61 views

Global Alignment

The document discusses the Needleman-Wunsch and Smith-Waterman algorithms for global and local sequence alignment. It provides steps for constructing the scoring matrix in global alignment using the Needleman-Wunsch algorithm, including filling the matrix with scores and tracing back to determine the optimal alignment. It also briefly introduces local alignment and the Smith-Waterman algorithm.

Uploaded by

somiha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
61 views

Global Alignment

The document discusses the Needleman-Wunsch and Smith-Waterman algorithms for global and local sequence alignment. It provides steps for constructing the scoring matrix in global alignment using the Needleman-Wunsch algorithm, including filling the matrix with scores and tracing back to determine the optimal alignment. It also briefly introduces local alignment and the Smith-Waterman algorithm.

Uploaded by

somiha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Needleman-Wunsch and

Smith-Waterman Algorithm
Presented by
Somiha Tasnim (170128)
What is Sequence Alignment
In bioinformatics, a sequence alignment is a way of arranging/aligning the
sequences of DNA, RNA, or protein, amino acid, nucleic acid to identify regions of
similarity that may be a consequence of functional, structural, or evolutionary
relationships between the sequences. In the sequence alignment, we are finding
the similarity regions of two sequences in order to get the suitable alignment.
Global Alignment
Global Alignment: Global alignments, which attempt to align every residue in every
sequence, are most useful when the sequences in the query set are similar and of
roughly equal size.

In global alignment we use Needleman-Wunsch algorithm.

Step 1: Scoring Matrix

Step 2: Trace Back

Step 3: Alignment
Step 1: Scoring Matrix

Rules
C -8
● Put a gap at first
● Box Beside (+gap)
● Box Bottom (+gap) C -6
● Diagonal (match/mismatch)
A -4

A -2
Match +1

Mismatch -1 _ 0 -2 -4 -6

Gap -2 _ A G C
Step 1: Scoring Matrix

C -8

C -6

A -4
-2 -2-2=-4
A -2
0 -2
_ 0 -2 -4 -6

_ A G C
Step 1: Scoring Matrix

C -8

C -6

A -4
-2 -2-2=-4
A -2
0 -2
_ 0 -2 -4 -6

_ A G C
Step 1: Scoring Matrix

C -8

C -6

A -4
A -2 0+1=1
A -2

_ 0 -2 -4 -6 0 -2

_ A
A G C
Step 1: Scoring Matrix

C -8

C -6
Value From Box Beside : -4
A -4
Value From Box Bottom : -4
A -2 1
Diagonal: 1
_ 0 -2 -4 -6 Largest Value: 1
_ A G C
Step 1: Scoring Matrix

C -8 Value From Box Beside : 1-2=-1

C -6 Value From Box Bottom : -4-2=-6

A -4 Diagonal: -2-1=-3 (Mismatch)

A -2 1 -1 Largest Value: -1
_ 0 -2 -4 -6

_ A G C
Step 1: Scoring Matrix

C -8 Value From Box Beside : -1-2=-3

C -6 Value From Box Bottom : -6-2=-8

A -4 Diagonal: -2-1=-3 (Mismatch)

A -2 1 -1 -3 Largest Value: -3 (From Beside and


Diagonal)
_ 0 -2 -4 -6

_ A G C
Step 1: Scoring Matrix

C -8 Value From Box Beside : -4-2=-6

C -6 Value From Box Bottom : 1-2=-1

A -4 -1 Diagonal: -2+1=-1 (Match)

A -2 1 -1 -3 Largest Value: -1 (From Bottom and


Diagonal)
_ 0 -2 -4 -6

_ A G C
Step 1: Scoring Matrix

C -8 Value From Box Beside : -1-2=-3

C -6 Value From Box Bottom : -1-2=-3

A -4 -1 0 Diagonal: 1-1=0 (Mismatch)

A -2 1 -1 -3 Largest Value: 0(From Diagonal)


_ 0 -2 -4 -6

_ A G C
Step 1: Scoring Matrix

C -8 Value From Box Beside : 0-2=-2

C -6 Value From Box Bottom : -3-2=-5

A -4 -1 0 -2 Diagonal: -1-1=-2 (Mismatch)

A -2 1 -1 -3 Largest Value: -2 (From Beside and


Diagonal)
_ 0 -2 -4 -6

_ A G C
Step 1: Scoring Matrix

C -8 Value From Box Beside : -6-2=-8

C -6 -3 Value From Box Bottom : -1-2=-3

A -4 -1 0 -2 Diagonal: -4-1=-5 (Mismatch)

A -2 1 -1 -3 Largest Value: -3 (From Bottom)


_ 0 -2 -4 -6

_ A G C
Step 1: Scoring Matrix

C -8 Value From Box Beside : -3-2=-5

C -6 -3 -2 Value From Box Bottom : 0-2=-2

A -4 -1 0 -2 Diagonal: -1-1=-2 (Mismatch)

A -2 1 -1 -3 Largest Value: -2 (From Bottom and


Diagonal)
_ 0 -2 -4 -6

_ A G C
Step 1: Scoring Matrix

C -8 Value From Box Beside : -2-2=-4

C -6 -3 -2 -1 Value From Box Bottom : -2-2=-2

A -4 -1 0 -2 Diagonal: 0+1=-1 (Match)

A -2 1 -1 -3 Largest Value: -1 (From Diagonal)


_ 0 -2 -4 -6

_ A G C
Step 1: Scoring Matrix

C -8 -5 Value From Box Beside : -8-2=-10

C -6 -3 -2 1 Value From Box Bottom : -3-2=-5

A -4 -1 0 -2 Diagonal: -6-1=-7 (Mismatch)

A -2 1 -1 -3 Largest Value: -5 (From Bottom)


_ 0 -2 -4 -6

_ A G C
Step 1: Scoring Matrix

C -8 -5 -4 Value From Box Beside : -5-2=-7

C -6 -3 -2 1 Value From Box Bottom : -2-2=-4

A -4 -1 0 -2 Diagonal: -3-1=-4 (Mismatch)

A -2 1 -1 -3 Largest Value: -4 (From Bottom and


Diagonal)
_ 0 -2 -4 -6

_ A G C
Step 1: Scoring Matrix

C -8 -5 -4 -1 Value From Box Beside : -4-2=-6

C -6 -3 -2 -1 Value From Box Bottom : 1-2=-1

A -4 -1 0 -2 Diagonal: -2+1=-1 (Match)

A -2 1 -1 -3 Largest Value: -4 (From Bottom and


Diagonal)
_ 0 -2 -4 -6

_ A G C
Step 2: Trace Back

C -8 -5 -4 -1

C -6 -3 -2 -1

A -4 -1 0 -2

A -2 1 -1 -3

_ 0 -2 -4 -6

_ A G C
Step 3: Alignment

C -8 -5 -4 -1 Arrow from higher value to lower


-6 -3 -2 -1
value. So, it’s a match
C
-4 -1 0 -2
C
A
C
A -2 1 -1 -3

_ 0 -2 -4 -6

_ A G C
Step 3: Alignment

C -8 -5 -4 -1 Arrow from lower horizontal value.


-6 -3 -2 -1
So, it’s a gap
C
-4 -1 0 -2
C C
A
_ C
A -2 1 -1 -3

_ 0 -2 -4 -6

_ A G C
Step 3: Alignment

C -8 -5 -4 -1 Arrow from lower value to higher


-6 -3 -2 -1
value. So, it’s a mismatch
C
A -4 -1 0 -2
A C C
A -2 1 -1 -3
G _ C
_ 0 -2 -4 -6

_ A G C
Step 3: Alignment

C -8 -5 -4 -1 Arrow from higher value to lower


-6 -3 -2 -1
value. So, it’s a match
C
-4 -1 0 -2
A A C C
A
A G _ C
A -2 1 -1 -3
1 -1 -2 1
_ 0 -2 -4 -6

_ A G C
Local Alignment
Local Alignment: Matching two sequence from regions which have more similarity
with each other.
In local alignment we use Smith-Waterman algorithm.
Step 1: Scoring Matrix
Step 2: Trace Back
Step 3: Alignment
Local Alignment

0 Rules
C
● Put a gap at first
C 0 ● Box Beside (+gap)
● Box Bottom (+gap)
● Diagonal (match/mismatch)
A 0

G 0
Match +1

_ 0 0 0 0 Mismatch -1

Gap -2
_ A G C
Step 1: Scoring Matrix

C 0 Value From Box Beside : 0-2=-2

0 Value From Box Bottom : 0-2=-2


C
Diagonal: 0-1=-1 (Match)
A 0
Largest Value: 0 (From Beside, Bottom,
G 0 0 Diagonal

_ 0 0 0 0

_ A G C
Step 1: Scoring Matrix

C 0 Value From Box Beside : 0-2=-2 (0)

0 Value From Box Bottom : 0-2=-2 (0)


C
Diagonal: 0-1=-1 (Mismatch) (0)
A 0
Largest Value: 0 (From Beside, Bottom,
G 0 1 0 Diagonal)

_ 0 0 0 0

_ A G C
Step 1: Scoring Matrix

C 0 Value From Box Beside : 0-2=-2 (0)

0 Value From Box Bottom : 0-2=-2 (0)


C
Diagonal: 0-1=-1 (Mismatch) (0)
A 0
Largest Value: 0 (From Beside, Bottom,
G 0 0 0 0 Diagonal)

_ 0 0 0 0

_ A G C
Step 1: Scoring Matrix

C 0 Value From Box Beside : 0-2=-2

C 0 Value From Box Bottom : 0-2=-2

A 0 1 Diagonal: 0+1=1 (Match)

G 0 0 0 0 Largest Value: 1 (From Diagonal)

_ 0 0 0 0

_ A G C
Step 1: Scoring Matrix

C 0 Value From Box Beside : 1-2=-1 (0)

0 Value From Box Bottom : 0-2=-2 (0)


C
Diagonal: 0-1=-1 (Mismatch) (0)
A 0 1 0
Largest Value: 0 (From Beside, Bottom,
G 0 0 0 0 Diagonal)

_ 0 0 0 0

_ A G C
Step 1: Scoring Matrix

C 0 Value From Box Beside : 0-2=-2 (0)

0 Value From Box Bottom : 0-2=-2 (0)


C
Diagonal: 0-1=-1 (Mismatch) (0)
A 0 1 0 0
Largest Value: 0 (From Beside, Bottom,
G 0 0 0 0 Diagonal)

_ 0 0 0 0

_ A G C
Step 1: Scoring Matrix

C 0 Value From Box Beside : 0-2=-2 (0)

0 0 Value From Box Bottom : 1-2=-1 (0)


C
Diagonal: 0-1=-1 (Mismatch) (0)
A 0 1 0 0
Largest Value: 0 (From Beside, Bottom,
G 0 0 0 0 Diagonal)

_ 0 0 0 0

_ A G C
Step 1: Scoring Matrix

C 0 Value From Box Beside : 0-2=-2 (0)

0 0 0 Value From Box Bottom : 0-2=-2 (0)


C
Diagonal: 1-1=0 (Mismatch) (0)
A 0 1 0 0
Largest Value: 0 (From Beside, Bottom,
G 0 0 0 0 Diagonal)

_ 0 0 0 0

_ A G C
Step 1: Scoring Matrix

C 0 Value From Box Beside : 0-2=-2 (0)

C 0 0 0 1 Value From Box Bottom : 0-2=-2 (0)

A 0 1 0 0 Diagonal: 0+1=1 (Match)

G 0 0 0 0 Largest Value: 1 (From Diagonal)

_ 0 0 0 0

_ A G C
Step 1: Scoring Matrix

C 0 0 Value From Box Beside : 0-2=-2 (0)

0 0 0 1 Value From Box Bottom : 0-2=-2 (0)


C
Diagonal: 0-1=-1 (Mismatch) (0)
A 0 1 0 0
Largest Value: 0 (From Diagonal,
G 0 0 0 0 beside, bottom)

_ 0 0 0 0

_ A G C
Step 1: Scoring Matrix

C 0 0 0 Value From Box Beside : 0-2=-2 (0)

0 0 0 1 Value From Box Bottom : 0-2=-2 (0)


C
Diagonal: 0-1=-1 (Mismatch) (0)
A 0 1 0 0
Largest Value: 0 (From Diagonal,
G 0 0 0 0 beside, bottom)

_ 0 0 0 0

_ A G C
Step 1: Scoring Matrix

C 0 0 0 1 Value From Box Beside : 0-2=-2 (0)

C 0 0 0 1 Value From Box Bottom : 1-2=-1 (0)

A 0 1 0 0 Diagonal: 0+1=1 (Match)

G 0 0 0 0 Largest Value: 1 (From Diagonal)

_ 0 0 0 0

_ A G C
Step 2: Tracing Back

C 0 0 0 1

C 0 0 0 1

A 0 1 0 0

G 0 0 0 0

_ 0 0 0 0

_ A G C
Step 3: Tracing Back

C 0 0 0 1

C 0 0 0 1 GAC|C

A 0 1 0 0 AGC

G 0 0 0 0

_ 0 0 0 0

_ A G C

You might also like