SlideShare une entreprise Scribd logo
1  sur  81
Télécharger pour lire hors ligne
Sequence Alignment
Where we left off
• Output from Sequencing:
AACTGACCTA…
CCGTTGGCAT…
TTTGCGGTCA…
…
…
Where we left off
• I have hundreds of millions of short
• Most applications need to figure out where they
came from
• Given a reference genome sequence and millions of
short sequences, how do I figure out where each of
the short sequences came from?
What is an algorithm?
• A process or set of rules to be followed in
calculations or other problem-solving operations,
esp. by a computer
• X = 2 * n
• Make a burrito
• Unwrap burrito
• Place on plate in microwave
• Turn microwave on for 2 minutes
What makes a good algorithmic
solution?
• Speed
• Memory
• Optimality of answer
The alignment problem
• Input
• Two sequences s and t of length n and m
• Output
• An alignment between the two sequences with gaps
inserted appropriately
• Objective Function
• A scoring function that weights particular character to
character alignments
How fast do I have to eat?
• Input
• # of sandwiches
• Output
• Sandwiches / minute
• Objective function
• Minimize the number of sandwiches I have to eat per
minute such that I finish all sandwiches in an hour
Scoring Function
• Which alignment of ACCTG and ACTTG is better?
• AATAC AATA-C
• ATATC -ATATC
• How did you decide?
• Example scoring function:
• +1 for matches
• -1 for gaps and mismatches
Kinds of Alignment
http://3.bp.blogspot.com/_OcdkdnkXwIg/SnRLqde_8PI/AAAAAAAAAZs/_ETauY69JiM/s320/glob
al-local-alignment.png
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
T
T
G
C
Rules
• Fill in top row and left-most column according to
scoring function
• Start in the upper left-most corner of unfilled squares
• Move left to right filling in the result of the scoring
function
• Break ties arbitrarily
• Trace back from bottom right corner to upper left
corner
Needleman-Wunsch Recurrence
𝑆𝑆 𝑖𝑖, 𝑗𝑗 = max �
𝑆𝑆 𝑖𝑖 − 1, 𝑗𝑗 − 1 + 𝛿𝛿 𝑠𝑠𝑖𝑖, 𝑡𝑡𝑗𝑗
𝑆𝑆 𝑖𝑖 − 1, 𝑗𝑗 + 𝛿𝛿 −
𝑆𝑆 𝑖𝑖, 𝑗𝑗 − 1 + 𝛿𝛿 −
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
T
T
G
C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0
T
T
G
C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1
T
T
G
C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2
T
T
G
C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3
T
T
G
C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T
T
G
C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1
T
G
C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1
T -2
G
C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1
T -2
G -3
C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1
T -2
G -3
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1
T -2
G -3
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0
T -2
G -3
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1
T -2
G -3
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2
G -3
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2
G -3
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0
G -3
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1
G -3
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1 0
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1 0 2
C -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1 0 2
C -4 -4
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1 0 2
C -4 -4 -2
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1 0 2
C -4 -4 -2 -1
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1 0 2
C -4 -4 -2 -1 1
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1 0 2
C -4 -4 -2 -1 1
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1 0 2
C -4 -4 -2 -1 1
-
C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1 0 2
C -4 -4 -2 -1 1
G -
G C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1 0 2
C -4 -4 -2 -1 1
T G -
T G C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1 0 2
C -4 -4 -2 -1 1
T T G -
T T G C
Global Alignment:
Needleman-Wunsch Algorithm
A T T G
0 -1 -2 -3 -4
T -1 -1 0 -1 -2
T -2 -2 0 1 0
G -3 -3 -1 0 2
C -4 -4 -2 -1 1
A T T G -
- T T G C
Rules
• Fill in top row and left-most column according to
scoring function
• Start in the upper left-most corner of unfilled squares
• Move left to right filling in the result of the scoring
function
• Break ties arbitrarily
• Trace back from the max element in the matrix to the
first STOP
Rules
• Fill in top row and left-most column according to
scoring function
• Start in the upper left-most corner of unfilled squares
• Move left to right filling in the result of the scoring
function
• Break ties arbitrarily
• Trace back from the max element in the matrix to the
first STOP
Local Alignment:
Smith-Waterman Algorithm
𝑆𝑆 𝑖𝑖, 𝑗𝑗 = max
0
𝑆𝑆 𝑖𝑖 − 1, 𝑗𝑗 − 1 + 𝛿𝛿 𝑠𝑠𝑖𝑖, 𝑡𝑡𝑗𝑗
𝑆𝑆 𝑖𝑖 − 1, 𝑗𝑗 + 𝛿𝛿 −
𝑆𝑆 𝑖𝑖, 𝑗𝑗 − 1 + 𝛿𝛿 −
Local Alignment:
Smith-Waterman Algorithm
𝑆𝑆 𝑖𝑖, 𝑗𝑗 = max
0
𝑆𝑆 𝑖𝑖 − 1, 𝑗𝑗 − 1 + 𝛿𝛿 𝑠𝑠𝑖𝑖, 𝑡𝑡𝑗𝑗
𝑆𝑆 𝑖𝑖 − 1, 𝑗𝑗 + 𝛿𝛿 −
𝑆𝑆 𝑖𝑖, 𝑗𝑗 − 1 + 𝛿𝛿 −
Local Alignment:
Smith-Waterman Algorithm
A T T G
T
T
G
C
Local Alignment:
Smith-Waterman Algorithm
A T T G
0
T
T
G
C
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0
T
T
G
C
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0
T
T
G
C
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0
T
T
G
C
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T
T
G
C
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0
T
G
C
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0
T 0
G
C
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0
T 0
G 0
C
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0
T 0
G 0
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0
T 0
G 0
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1
T 0
G 0
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1
T 0
G 0
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0
G 0
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0
G 0
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1
G 0
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2
G 0
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0 0
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0 0 0
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0 0 0 1
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0 0 0 1 3
C 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0 0 0 1 3
C 0 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0 0 0 1 3
C 0 0 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0 0 0 1 3
C 0 0 0 0
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0 0 0 1 3
C 0 0 0 0 2
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0 0 0 1 3
C 0 0 0 0 2
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0 0 0 1 3
C 0 0 0 0 2
G
G
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0 0 0 1 3
C 0 0 0 0 2
T G
T G
Local Alignment:
Smith-Waterman Algorithm
A T T G
0 0 0 0 0
T 0 0 1 1 0
T 0 0 1 2 1
G 0 0 0 1 3
C 0 0 0 0 2
T T G
T T G
How to evaluate statistical
significance?
• Everyone pick a number between 1 and 10 (keep it
to yourself!)
The problem with databases
• Query is: ACCT
• Is a match significant?
• Database A:
• ACCT
• CAGG
• AAAA
• Database B:
• ACCT
• ACCT
• ACCT
Alignment Projects
• Research BWA
• Research Bowtie
• Research MAQ
• Code a program in the language of your choice that
performs Needleman-Wunsch or Smith Waterman

Contenu connexe

Tendances

Bellman ford algorithm
Bellman ford algorithmBellman ford algorithm
Bellman ford algorithmA. S. M. Shafi
 
block diagram reduction with examples
block diagram reduction with examplesblock diagram reduction with examples
block diagram reduction with examplesWaqas Afzal
 
Bellmanford . montaser hamza.iraq
Bellmanford . montaser hamza.iraqBellmanford . montaser hamza.iraq
Bellmanford . montaser hamza.iraqmontaser185
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABCOMSATS Abbottabad
 
Quartile deviation
Quartile deviationQuartile deviation
Quartile deviationNadeem Uddin
 
Analysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemAnalysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemCOMSATS Abbottabad
 
Prim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmPrim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmAcad
 
[Question Paper] Electronic and Communication Technology (Revised Course) [Ap...
[Question Paper] Electronic and Communication Technology (Revised Course) [Ap...[Question Paper] Electronic and Communication Technology (Revised Course) [Ap...
[Question Paper] Electronic and Communication Technology (Revised Course) [Ap...Mumbai B.Sc.IT Study
 
Kruskal & Prim's Algorithm
Kruskal & Prim's AlgorithmKruskal & Prim's Algorithm
Kruskal & Prim's AlgorithmIfad Rahman
 
Csl14 16 f15
Csl14 16 f15Csl14 16 f15
Csl14 16 f15kodam2512
 
Circular Functions
Circular FunctionsCircular Functions
Circular FunctionsJonalyn Asi
 

Tendances (19)

Bellman ford algorithm
Bellman ford algorithmBellman ford algorithm
Bellman ford algorithm
 
block diagram reduction with examples
block diagram reduction with examplesblock diagram reduction with examples
block diagram reduction with examples
 
Merge sort algorithm power point presentation
Merge sort algorithm power point presentationMerge sort algorithm power point presentation
Merge sort algorithm power point presentation
 
Bellmanford . montaser hamza.iraq
Bellmanford . montaser hamza.iraqBellmanford . montaser hamza.iraq
Bellmanford . montaser hamza.iraq
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
 
Quartile deviation
Quartile deviationQuartile deviation
Quartile deviation
 
Merge sort
Merge sortMerge sort
Merge sort
 
Introduction to MATLAB
Introduction to MATLAB Introduction to MATLAB
Introduction to MATLAB
 
Analysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemAnalysis of Electro-Mechanical System
Analysis of Electro-Mechanical System
 
Prim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmPrim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithm
 
Lo2
Lo2Lo2
Lo2
 
24 Cs146 Jc Merge
24 Cs146 Jc Merge24 Cs146 Jc Merge
24 Cs146 Jc Merge
 
[Question Paper] Electronic and Communication Technology (Revised Course) [Ap...
[Question Paper] Electronic and Communication Technology (Revised Course) [Ap...[Question Paper] Electronic and Communication Technology (Revised Course) [Ap...
[Question Paper] Electronic and Communication Technology (Revised Course) [Ap...
 
Kruskal & Prim's Algorithm
Kruskal & Prim's AlgorithmKruskal & Prim's Algorithm
Kruskal & Prim's Algorithm
 
Csl14 16 f15
Csl14 16 f15Csl14 16 f15
Csl14 16 f15
 
Sketch root locus
Sketch root locusSketch root locus
Sketch root locus
 
Circular Functions
Circular FunctionsCircular Functions
Circular Functions
 
Block Diagram Reduction
Block Diagram ReductionBlock Diagram Reduction
Block Diagram Reduction
 
Group 4 reporting c.s.
Group 4 reporting c.s.Group 4 reporting c.s.
Group 4 reporting c.s.
 

En vedette

B.sc biochem i bobi u 2 database
B.sc biochem i bobi u 2 databaseB.sc biochem i bobi u 2 database
B.sc biochem i bobi u 2 databaseRai University
 
SA_MSA_ICBAI_2016_presentation_v1.0
SA_MSA_ICBAI_2016_presentation_v1.0SA_MSA_ICBAI_2016_presentation_v1.0
SA_MSA_ICBAI_2016_presentation_v1.0Vineetha Vishnu
 
BITS: Basics of sequence analysis
BITS: Basics of sequence analysisBITS: Basics of sequence analysis
BITS: Basics of sequence analysisBITS
 
B.sc biochem i bobi u-1 introduction to bioinformatics
B.sc biochem i bobi u-1 introduction to bioinformaticsB.sc biochem i bobi u-1 introduction to bioinformatics
B.sc biochem i bobi u-1 introduction to bioinformaticsRai University
 
BLAST(Basic Local Alignment Tool)
BLAST(Basic Local Alignment Tool)BLAST(Basic Local Alignment Tool)
BLAST(Basic Local Alignment Tool)Sobia
 

En vedette (10)

Rish seq ana
Rish seq anaRish seq ana
Rish seq ana
 
B.sc biochem i bobi u 2 database
B.sc biochem i bobi u 2 databaseB.sc biochem i bobi u 2 database
B.sc biochem i bobi u 2 database
 
SA_MSA_ICBAI_2016_presentation_v1.0
SA_MSA_ICBAI_2016_presentation_v1.0SA_MSA_ICBAI_2016_presentation_v1.0
SA_MSA_ICBAI_2016_presentation_v1.0
 
Sequence alignment
Sequence alignmentSequence alignment
Sequence alignment
 
Msa
MsaMsa
Msa
 
BITS: Basics of sequence analysis
BITS: Basics of sequence analysisBITS: Basics of sequence analysis
BITS: Basics of sequence analysis
 
Blast
BlastBlast
Blast
 
B.sc biochem i bobi u-1 introduction to bioinformatics
B.sc biochem i bobi u-1 introduction to bioinformaticsB.sc biochem i bobi u-1 introduction to bioinformatics
B.sc biochem i bobi u-1 introduction to bioinformatics
 
BLAST(Basic Local Alignment Tool)
BLAST(Basic Local Alignment Tool)BLAST(Basic Local Alignment Tool)
BLAST(Basic Local Alignment Tool)
 
blast bioinformatics
blast bioinformaticsblast bioinformatics
blast bioinformatics
 

Similaire à Sequence Alignment

Global and local alignment in Bioinformatics
Global and local alignment in BioinformaticsGlobal and local alignment in Bioinformatics
Global and local alignment in BioinformaticsMahmudul Alam
 
Matrices Slide For B.Sc Students As Well For F.Sc Students
Matrices Slide For B.Sc Students As Well For F.Sc StudentsMatrices Slide For B.Sc Students As Well For F.Sc Students
Matrices Slide For B.Sc Students As Well For F.Sc StudentsAbu Bakar Soomro
 
Plugin identities
Plugin identitiesPlugin identities
Plugin identitiesamitjajoo
 
Power Electronics fundamentals for the Engineerng
Power Electronics fundamentals for the EngineerngPower Electronics fundamentals for the Engineerng
Power Electronics fundamentals for the Engineerngbalakrishnakece
 
Introduction to Memory Effects
Introduction to Memory EffectsIntroduction to Memory Effects
Introduction to Memory EffectsSohail Khanifar
 

Similaire à Sequence Alignment (8)

Global and local alignment in Bioinformatics
Global and local alignment in BioinformaticsGlobal and local alignment in Bioinformatics
Global and local alignment in Bioinformatics
 
Matrices Slide For B.Sc Students As Well For F.Sc Students
Matrices Slide For B.Sc Students As Well For F.Sc StudentsMatrices Slide For B.Sc Students As Well For F.Sc Students
Matrices Slide For B.Sc Students As Well For F.Sc Students
 
Identities
IdentitiesIdentities
Identities
 
Plugin identities
Plugin identitiesPlugin identities
Plugin identities
 
Chap5 sec5.2
Chap5 sec5.2Chap5 sec5.2
Chap5 sec5.2
 
4 ibc-1608-wind
4 ibc-1608-wind4 ibc-1608-wind
4 ibc-1608-wind
 
Power Electronics fundamentals for the Engineerng
Power Electronics fundamentals for the EngineerngPower Electronics fundamentals for the Engineerng
Power Electronics fundamentals for the Engineerng
 
Introduction to Memory Effects
Introduction to Memory EffectsIntroduction to Memory Effects
Introduction to Memory Effects
 

Sequence Alignment