0% found this document useful (0 votes)
50 views16 pages

Lecture 6

The document describes the Needleman-Wunsch algorithm for sequence alignment using a DNA sequence example. It shows the step-by-step process of constructing an scoring matrix to align the sequences and determine the optimal alignment based on matching/mismatching nucleotides and gap penalties. The final matrix shows the optimal alignment score of -14.

Uploaded by

SUNDAS FATIMA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views16 pages

Lecture 6

The document describes the Needleman-Wunsch algorithm for sequence alignment using a DNA sequence example. It shows the step-by-step process of constructing an scoring matrix to align the sequences and determine the optimal alignment based on matching/mismatching nucleotides and gap penalties. The final matrix shows the optimal alignment score of -14.

Uploaded by

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

Bio Informatics

Lecture 6
Needleman–Wunsch Algorithm – Example 2

• This algorithm can be used for any two strings.


• This guide will use two small DNA sequences
as examples as shown below:
• Sequence (1): ACTGATTCA
• Sequence (2): ACGCATCA

• The length is different. The first step is to


construct a grid.
Needleman–Wunsch – Example 2
A C T G A T T C A

A
C
G
C
A
T
C
A
Needleman–Wunsch Algorithm -
Scores & Functions
 Match: +2
 Mismatch: -3
 Gap: -2
  𝑓 ( 𝑖 − 1 , 𝑗 − 1 ) + 𝑆 ( 𝑥𝑖 , 𝑦𝑖 )
𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥
{ 𝑓 ( 𝑖 − 1 , 𝑗 ) + 𝑆 (𝐺𝑎𝑝)
𝑓 ( 𝑖 , 𝑗 − 1 ) + 𝑆 (𝐺𝑎𝑝)

  𝑓 (  ) +𝑆 (𝑚𝑎𝑡𝑐h 𝑂𝑅 𝑚𝑖𝑠𝑚𝑎𝑡𝑐h )
𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥
{ 𝑓 (  ) + 𝑆 (𝐺𝑎𝑝 )
𝑓 (  ) + 𝑆 (𝐺𝑎𝑝 )
Needleman–Wunsch – Example 2
A C T G A T T C A Match: +2; Mismatch: -3; Gap: -2;
0 ?
  𝑓 (  ) +𝑆 (𝑚𝑎𝑡𝑐h 𝑂𝑅 𝑚𝑖𝑠𝑚𝑎𝑡𝑐h)
A
C
G
{
𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥 𝑓 (  ) +𝑆(𝐺𝑎𝑝)
𝑓 (  ) +𝑆(𝐺𝑎𝑝)

C
A  
?
T
C
A
Needleman–Wunsch – Example 2
A C T G A T T C A Match: +2; Mismatch: -3; Gap: -2;
0  -2 ?
   𝑓 (  ) +𝑆 (𝑚𝑎𝑡𝑐h 𝑂𝑅 𝑚𝑖𝑠𝑚𝑎𝑡𝑐h)
A
C
G
{
𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥 𝑓 (  ) +𝑆(𝐺𝑎𝑝)
𝑓 (  ) +𝑆(𝐺𝑎𝑝)

C
A  
?
T
C
A
Needleman–Wunsch – Example 2
A C T G A T T C A Match: +2; Mismatch: -3; Gap: -2;
0 -2 -4

  
 
  𝑓 (  ) +𝑆 (𝑚𝑎𝑡𝑐h 𝑂𝑅 𝑚𝑖𝑠𝑚𝑎𝑡𝑐h)
A
C
G
{
𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥 𝑓 (  ) +𝑆(𝐺𝑎𝑝)
𝑓 (  ) +𝑆(𝐺𝑎𝑝)

C
A  
?
T
C
A
Needleman–Wunsch – Example 2
A C T G A T T C A Match: +2; Mismatch: -3; Gap: -2;
0 -2 -4 -6 -8 -10 -12 -14 -16 -18

  
  
  
  
  
  
  
  
 
𝑓 (  ) +𝑆 (𝑚𝑎𝑡𝑐h 𝑂𝑅 𝑚𝑖𝑠𝑚𝑎𝑡𝑐h)
A ?  

C
G
{
𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥 𝑓 (  ) +𝑆(𝐺𝑎𝑝)
𝑓 (  ) +𝑆(𝐺𝑎𝑝)

C
A  
?
T
C
A
Needleman–Wunsch – Example 2
A C T G A T T C A Match: +2; Mismatch: -3; Gap: -2;
0 -2 -4 -6 -8 -10 -12 -14 -16 -18

  
  
  
  
  
  
  
  
 
𝑓 (  ) +𝑆 (𝑚𝑎𝑡𝑐h 𝑂𝑅 𝑚𝑖𝑠𝑚𝑎𝑡𝑐h)
A   

{
-2
 
𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥 𝑓 (  ) +𝑆(𝐺𝑎𝑝)
C ?
𝑓 (  ) +𝑆(𝐺𝑎𝑝)
G
C
A  
?
T
C
A
Needleman–Wunsch – Example 2
A C T G A T T C A Match: +2; Mismatch: -3; Gap: -2;
0 -2 -4 -6 -8 -10 -12 -14 -16 -18

  
  
  
  
  
  
  
  
 
𝑓 (  ) +𝑆 (𝑚𝑎𝑡𝑐h 𝑂𝑅 𝑚𝑖𝑠𝑚𝑎𝑡𝑐h)
A   

{
-2
 
𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥 𝑓 (  ) +𝑆(𝐺𝑎𝑝)
C 
-4
  𝑓 (  ) +𝑆(𝐺𝑎𝑝)
G
C
A  
?
T
C
A
Needleman–Wunsch – Example 2
A C T G A T T C A Match: +2; Mismatch: -3; Gap: -2;
0 -2 -4 -6 -8 -10 -12 -14 -16 -18

  
  
  
  
  
  
  
  
 
𝑓 (  ) +𝑆 (𝑚𝑎𝑡𝑐h 𝑂𝑅 𝑚𝑖𝑠𝑚𝑎𝑡𝑐h)
A   

{
-2
  ?
𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥 𝑓 (  ) +𝑆(𝐺𝑎𝑝)
C 
-4
  𝑓 (  ) +𝑆(𝐺𝑎𝑝)
G -6

 
C -8

 
A -10
 
  ?
T -12

C  
-14

A 
-16
 


 
Needleman–Wunsch – Example 2
A C T G A T T C A Match: +2; Mismatch: -3; Gap: -2;
0 -2 -4 -6 -8 -10 -12 -14 -16 -18

  
  
  
  
  
  
  
  
 

  
A -2   𝑓 (  ) +𝑆 (𝑚𝑎𝑡𝑐h 𝑂𝑅 𝑚𝑖𝑠𝑚𝑎𝑡𝑐h)
  2

{
?
𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥 𝑓 (  ) +𝑆(𝐺𝑎𝑝)
C 
-4
  𝑓 (  ) +𝑆(𝐺𝑎𝑝)
G -6

 
C -8

 
A -10
 
  ?
T -12

C  
-14

A 
-16
 


 
Needleman–Wunsch – Example 2
A C T G A T T C A Match: +2; Mismatch: -3; Gap: -2;
0 -2 -4 -6 -8 -10 -12 -14 -16 -18

  
  
  
  
  
  
  
  
 

  
A -2   𝑓 (  ) +𝑆 (𝑚𝑎𝑡𝑐h 𝑂𝑅 𝑚𝑖𝑠𝑚𝑎𝑡𝑐h)
  2

{
0 ?
C 
-4 
  𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥 𝑓 (  ) +𝑆(𝐺𝑎𝑝)
  𝑓 (  ) +𝑆(𝐺𝑎𝑝)
G -6

 
C -8

 
A -10
 
  ?
T -12

C  
-14

A 
-16
 


 
Needleman–Wunsch – Example 2
A C T G A T T C A Match: +2; Mismatch: -3; Gap: -2;
0 -2 -4 -6 -8 -10 -12 -14 -16 -18

  
  
  
  
  
  
  
  
 

  
A -2   𝑓 (  ) +𝑆 (𝑚𝑎𝑡𝑐h 𝑂𝑅 𝑚𝑖𝑠𝑚𝑎𝑡𝑐h)
  2

{
0 -2 ? ? ? ? ? ?
C 
-4 ? 
 
? 
 
? ? ? ? ? ? ?
𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥 𝑓 (  ) +𝑆(𝐺𝑎𝑝)
  𝑓 (  ) +𝑆(𝐺𝑎𝑝)
G -6 ? ? ? ? ? ? ? ? ?

 
C -8 ? ? ? ? ? ? ? ? ?

 
A -10 ? ? ? ? ? ? ? ? ?
 
  ?
T -12 ? ? ? ? ? ? ? ? ?
C  
-14 ? ? ? ? ? ? ? ? ?
A 
-16
  ? ? ? ? ? ? ? ? ?


 
Needleman–Wunsch – Example 2
A C T G A T T C A Match: +2; Mismatch: -3; Gap: -2;
0 -2 -4 -6 -8 -10 -12 -14 -16 -18

  
  
  
  
  
      
 

  
A -2 -14   𝑓 (  ) +𝑆 (𝑚𝑎𝑡𝑐h 𝑂𝑅 𝑚𝑖𝑠𝑚𝑎𝑡𝑐h)

{
  2 0 -2 -4 -6 -8 -10 -12

C 
-4 0

 
4

 
2 0 -2 -4 -6 -8 -10
𝑓 ( 𝑖 , 𝑗 ) =𝑚𝑎𝑥 𝑓 (  ) +𝑆(𝐺𝑎𝑝)
  𝑓 (  ) +𝑆(𝐺𝑎𝑝)
G -6 -2 2 1 4 2 0 -2 -4 -6

 
C -8 -4 0 -1 2 1 -1 -3 0 -2

 
A -10 -6 -2 -3 0 4 2 0 -2 2
 
  ?
T -12 -8 -4 0 -2 2 6 4 2 0

C  
-14 -10 -6 -2 -4 0 4 2 6 4

A 
-16
  -12 -8 -4 -5 -2 2 1 4 8


 
Needleman–Wunsch Algorithm - Scores &
Functions

You might also like