Space/Time Tradeoff and Heuristic Approaches in Pairwise Alignment.
-
date post
20-Jan-2016 -
Category
Documents
-
view
221 -
download
6
Transcript of Space/Time Tradeoff and Heuristic Approaches in Pairwise Alignment.
Space/Time Tradeoffand
Heuristic Approachesin
Pairwise Alignment
Given two sequences of length ~1,000 requires a table of size ~1,000,000 cells
Can we use less space if only wanted the alignment score
Hint: The construction was carried out one row at a time
Alignment and Resources
- G A T T A C A
- 0 -2 -4 -6 -8 -10 -12 14
C -2 -1 -3 -5 -7 -9 -8 -10
A -4 -3 1 -1 -3 -5 -7 -6
C -6 -5 -1 0 -2 -4 -3 -5
T -8 -7 -3 1 2 0 -2 -4
A -10 -9 -5 -1 0 4 2 0
G -12 -8 -7 -3 -2 2 3 1
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
- 0 -2 -4 -6 -8 -10 -12 14
C -2 -1 -3 -5 -7 -9 -8 -10
A -4 -3 1 -1 -3 -5 -7 -6
C -6 -5 -1 0 -2 -4 -3 -5
T -8 -7 -3 1 2 0 -2 -4
A -10 -9 -5 -1 0 4 2 0
G -12 -8 -7 -3 -2 2 3 1
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
- 0 -2 -4 -6 -8 -10 -12 14
C
A
C
T
A
G
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
- 0 -2 -4 -6 -8 -10 -12 14
C -2 -1 -3 -5 -7 -9 -8 -10
A
C
T
A
G
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
-
C -2 -1 -3 -5 -7 -9 -8 -10
A
C
T
A
G
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
-
C -2 -1 -3 -5 -7 -9 -8 -10
A -4 -3 1 -1 -3 -5 -7 -6
C
T
A
G
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
-
C
A -4 -3 1 -1 -3 -5 -7 -6
C
T
A
G
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
-
C
A -4 -3 1 -1 -3 -5 -7 -6
C -6 -5 -1 0 -2 -4 -3 -5
T
A
G
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
-
C
A
C -6 -5 -1 0 -2 -4 -3 -5
T
A
G
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
-
C
A
C -6 -5 -1 0 -2 -4 -3 -5
T -8 -7 -3 1 2 0 -2 -4
A
G
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
-
C
A
C
T -8 -7 -3 1 2 0 -2 -4
A
G
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
-
C
A
C
T -8 -7 -3 1 2 0 -2 -4
A -10 -9 -5 -1 0 4 2 0
G
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
-
C
A
C
T
A -10 -9 -5 -1 0 4 2 0
G
If only alignment score is needed the alignment can be computed by using a matrix of only two rows
Alignment and Resources
- G A T T A C A
-
C
A
C
T
A -10 -9 -5 -1 0 4 2 0
G -12 -8 -7 -3 -2 2 3 1
If the sequences have size m and n need 2*min(m, n) cells to compute alignment score (could have slid “window” vertically)
Alignment and Resources
- G A T T A C A
-
C
A
C
T
A -10 -9 -5 -1 0 4 2 0
G -12 -8 -7 -3 -2 2 3 1
If the sequences have size m and n need 2*min(m, n) cells to compute alignment score (could have slid “window” vertically)
Cannot recover the alignment -- trace-back arrows not stored
Possible to design an algorithm that uses m+n cells but still allows to recover the alignment
D. S. Hirschberg. Algorithms for the longest common subsequence problem. J.ACM, 24:664-675, 1977.
Alignment and Resources
Given two sequences each of length ~1,000 original algorithm required to store ~1,000,000 = 1,000*1,000 cells modified version requires 2,000 = 2*min(1000, 1000)
If the value of a cell could be computed in 1μs how much time is required by each algorithm
The algorithms are impractical if you need to search through
a database of hundreds of thousands of sequences
Heuristic approaches (BLAST, FASTA) have been developed to cope with this problem
May not find overall best alignment, but do well in practice
Alignment and Resources
Basic Local Alignment Search Tool – computes local alignments and performs very well in practice
Altschul, Gish, Miller, Myers, Lipman, Basic Local Alignment Search Tool. Journal of Molecular Biology, 215(3), 403-410.
BLAST
QUERY sequence(s)
BLAST database
BLAST program
BLAST results
Main Idea: Identify short stretches of high scoring local alignments between query and target sequence and extend
“The central idea of the BLAST algorithm is to confine attention to segment pairs that contain a word pair of length w with a score of at least T.”
Altschul et al. (1990)
The procedure: use sliding window to extract all words of size w from query sequence for each word build a “hit list” of words with pairwise score at least T scan database for sequences that have words from “hit list” extend each hit until score drops below some cutoff
BLAST
Example with w=3, T=11, query= …FSGTWYA… use sliding window to extract all words of size w from query sequence
… FSG, SGT, GTW, WAY, …
for each word build a “hit list” of words with pairwise score at least T
GTW GTW 6,5,11 = 22ASW 0,1,11 = 12
QTW -2,5,11 = 14
scan database for sequences that have words from “hit list” extend each hit until score drops below some cutoff
ENFDKARFSGTWYAMAKKD
QNFDKTRYAGTWYAVAKKD
BLAST
Adapted from JHMI 140.638.01
BLAST Serverhttp://blast.ncbi.nlm.nih.gov/Blast.cgi
Runs dynamic programming on a restricted part of the table
Lipman, Pearson. Rapid and sensitive protein similarity searches. Science. 227 (4693): 1435-41.
Procedure identify all matches of size k between the sequences (dot plot like) --
these matches will form diagonals in the matrix
keep only the top scoring matches (using PAMn, BLOSUMn) – the score for these matches is called init1
attempt to join any of the top scoring regions if they could form longer alignment – the score for these alignments is called initn
apply full dynamic programming on a narrow band around the high scoring diagonal – the score for the final alignment is called opt
FASTA
“Protein Structure prediction – a practical approach”
FASTA Server http://fasta.bioch.virginia.edu
Python Programming be able to write python functions be able to predict the output of a function
Chapter 4 4.1: principles of sequence alignment 4.2: scoring alignments, dot plots 4.3: substitution matrices (high-level difference PAM vs BLOSUM) 4.4: handling gaps 4.5: types of alignment (pairwise only) 4.6: searching databases (BLAST, FASTA)
Chapter 5 5.1: substitution matrices (know how BLOSUM works, up to p.124) 5.2: dynamic programming algorithms (skip pp.134, 135) 8.1: Jukes-Cantor, Kimura models (pp.271-273)
Exam Topics