SlideShare una empresa de Scribd logo
1 de 137
Descargar para leer sin conexión
Combinatorial
Pattern Matching
Section 1:
Repeat Finding and
Hash Tables
Genomic Repeats
• Repeat: A sequence of DNA that occurs more than once in a
genome.
• Example: ATGGTCTAGGTCCTAGTGGTC
Genomic Repeats
• Repeat: A sequence of DNA that occurs more than once in a
genome.
• Example: ATGGTCTAGGTCCTAGTGGTC
Genomic Repeats
• Repeat: A sequence of DNA that occurs more than once in a
genome.
• Example: ATGGTCTAGGTCCTAGTGGTC
Genomic Repeats
• Repeat: A sequence of DNA that occurs more than once in a
genome.
• Example: ATGGTCTAGGTCCTAGTGGTC
Genomic Repeats
• Repeat: A sequence of DNA that occurs more than once in a
genome.
• Example: ATGGTCTAGGTCCTAGTGGTC
• Why do we want to find repeats?
1. Understand more about evolution.
2. Many tumors are characterized by an explosion of repeats.
3. Genomic rearrangements are often associated with repeats.
Genomic Repeats
• Note: Often, a repeat will refer to a segment of DNA that
occurs very often with slight modifications.
• As we might imagine, this is a more difficult computational
problem.
Genomic Repeats
• Note: Often, a repeat will refer to a segment of DNA that
occurs very often with slight modifications.
• As we might imagine, this is a more difficult computational
problem.
• Example: Say our target segment is GGTC and we allow one
substitution:
• ATGGTCTAGGACCTAGTGTTC
Genomic Repeats
• Note: Often, a repeat will refer to a segment of DNA that
occurs very often with slight modifications.
• As we might imagine, this is a more difficult computational
problem.
• Example: Say our target segment is GGTC and we allow one
substitution:
• ATGGTCTAGGACCTAGTGTTC
Genomic Repeats
• Note: Often, a repeat will refer to a segment of DNA that
occurs very often with slight modifications.
• As we might imagine, this is a more difficult computational
problem.
• Example: Say our target segment is GGTC and we allow one
substitution:
• ATGGTCTAGGACCTAGTGTTC
Genomic Repeats
• Note: Often, a repeat will refer to a segment of DNA that
occurs very often with slight modifications.
• As we might imagine, this is a more difficult computational
problem.
• Example: Say our target segment is GGTC and we allow one
substitution:
• ATGGTCTAGGACCTAGTGTTC
Extending l-mer Repeats
• Long repeats are difficult to find, but short repeats are easy.
• Simple approach to finding long repeats:
1. Find exact repeats of short l-mers (l is usually 10 to 13).
2. Use l-mer repeats to potentially extend into longer,
maximal repeats.
Extending l-mer Repeats
• Example: We start with a repeat of length 4.
• GCTTACAGATTCAGTCTTACAGATGGT
Extending l-mer Repeats
• Example: We start with a repeat of length 4.
• GCTTACAGATTCAGTCTTACAGATGGT
Extending l-mer Repeats
• Example: We start with a repeat of length 4.
• GCTTACAGATTCAGTCTTACAGATGGT
• Extend both these 4-mers:
• GCTTACAGATTCAGTCTTACAGATGGT
Extending l-mer Repeats
• Example: We start with a repeat of length 4.
• GCTTACAGATTCAGTCTTACAGATGGT
• Extend both these 4-mers:
• GCTTACAGATTCAGTCTTACAGATGGT
Extending l-mer Repeats
• Example: We start with a repeat of length 4.
• GCTTACAGATTCAGTCTTACAGATGGT
• Extend both these 4-mers:
• GCTTACAGATTCAGTCTTACAGATGGT
Extending l-mer Repeats
• Example: We start with a repeat of length 4.
• GCTTACAGATTCAGTCTTACAGATGGT
• Extend both these 4-mers:
• GCTTACAGATTCAGTCTTACAGATGGT
Extending l-mer Repeats
• Example: We start with a repeat of length 4.
• GCTTACAGATTCAGTCTTACAGATGGT
• Extend both these 4-mers:
• GCTTACAGATTCAGTCTTACAGATGGT
Extending l-mer Repeats
• Example: We start with a repeat of length 4.
• GCTTACAGATTCAGTCTTACAGATGGT
• Extend both these 4-mers:
• GCTTACAGATTCAGTCTTACAGATGGT
Extending l-mer Repeats
• Example: We start with a repeat of length 4.
• GCTTACAGATTCAGTCTTACAGATGGT
• Extend both these 4-mers:
• GCTTACAGATTCAGTCTTACAGATGGT
Extending l-mer Repeats
• Example: We start with a repeat of length 4.
• GCTTACAGATTCAGTCTTACAGATGGT
• Extend both these 4-mers:
• GCTTACAGATTCAGTCTTACAGATGGT
• Maximal repeat: CTTACAGAT
Maximal Repeats: Issue
• In order to find maximal repeats in this way, we need ALL
start locations of ALL l-mers in the genome.
• Hashing lets us find repeats quickly in this manner.
Hashing
• Hashing is a very efficient way to store and retrieve data.
• What does hashing do?
• Say we are given a collection of data.
• For different entry, generate a unique integer and store the
entry in an array at this integer location.
Hashing: Definitions
• Records: data stored in a hash table.
• Keys: Integers identifying set of records.
• Hash Table: The array of keys used in hashing.
• Hash Function: Assigns each record to a key.
• Collision: Occurs when more than one record is mapped to the
same index in the hash table.
Hashing: Example
• Records: Animals
• Keys: Where each
animal eats.
Hashing DNA sequences
• Each l-mer can be translated into a binary string:
• A can be represented as 00
• T can be represented as 01
• G can be represented as 10
• C can be represented as 11
• Example: ATGCTA = 000110110100
• After assigning a unique integer to each l-mer, it is easy to
obtain all start locations of each l-mer in a genome.
Hashing: Maximal Repeats
• To find repeats in a genome:
1. For all l-mers in the genome, note the start position and the
sequence.
2. Generate a hash table index for each unique l-mer
sequence.
3. At each index of the hash table, store all genome start
locations of the l-mer that generated the index.
4. Anywhere there are collisions in the table, extend
corresponding l-mers to maximal repeats.
• How do we deal with collisions?
Hashing: Collisions
• In order to deal with
collisions:
• ―Chain‖ all start locations of
l-mers.
• This can be done via a data
structure called a linked list.
Section 2:
Exact Pattern Matching
Pattern Matching
• What if, instead of finding repeats in a genome, we want to
find all sequences in a database that contain a given pattern?
• This leads us to a different problem, the Pattern Matching
Problem.
Pattern Matching Problem
• Goal: Find all occurrences of a pattern in a text.
• Input:
• Pattern p = p1…pn of length n
• Text t = t1…tm of length m
• Output: All positions 1< i < (m – n + 1) such that the n-letter
substring of text t starting at i matches the pattern p.
• Motivation: Searching database for a known pattern.
Exact Pattern Matching: A Brute Force Algorithm
PatternMatching(p,t)
1 n  length of pattern p
2 m  length of text t
3 for i  1 to (m – n + 1)
4 if ti…ti+n-1 = p
5 output i
• PatternMatching algorithm for:
• Pattern GCAT
• Text AGCCGCATCT
Exact Pattern Matching: An Example
• PatternMatching algorithm for:
• Pattern GCAT
• Text AGCCGCATCT
• AGCCGCATCT
• GCAT
Exact Pattern Matching: An Example
• PatternMatching algorithm for:
• Pattern GCAT
• Text AGCCGCATCT
• AGCCGCATCT
• GCAT
Exact Pattern Matching: An Example
• PatternMatching algorithm for:
• Pattern GCAT
• Text AGCCGCATCT
• AGCCGCATCT
• GCAT
Exact Pattern Matching: An Example
• PatternMatching algorithm for:
• Pattern GCAT
• Text AGCCGCATCT
• AGCCGCATCT
• GCAT
Exact Pattern Matching: An Example
• PatternMatching algorithm for:
• Pattern GCAT
• Text AGCCGCATCT
• AGCCGCATCT
• GCAT
Exact Pattern Matching: An Example
• PatternMatching algorithm for:
• Pattern GCAT
• Text AGCCGCATCT
• AGCCGCATCT
• GCAT
Exact Pattern Matching: An Example
• PatternMatching algorithm for:
• Pattern GCAT
• Text AGCCGCATCT
• AGCCGCATCT
• GCAT
Exact Pattern Matching: An Example
• PatternMatching runtime: O(nm)
• In the worst case, we have to check n characters at each of
the m letters of the text.
• Example: Text = AAAAAAAAAAAAAAAA, Pattern = AAAC
• This is rare; on average, the run time is more like O(m).
• Rarely will there be close to n comparisons at each step.
• Better solution: suffix trees…solve in O(m) time.
• First we need keyword trees.
Exact Pattern Matching: Running Time
Section 3:
Keyword Trees
Keyword Trees: Example
• Keyword tree:
• Apple
Keyword Trees: Example
• Keyword tree:
• Apple
• Apropos
Keyword Trees: Example
• Keyword tree:
• Apple
• Apropos
• Banana
Keyword Trees: Example
• Keyword tree:
• Apple
• Apropos
• Banana
• Bandana
Keyword Trees: Example
• Keyword tree:
• Apple
• Apropos
• Banana
• Bandana
• Orange
Keyword Trees: Properties
• Stores a set of keywords in a
rooted labeled tree.
• Each edge is labeled with a
letter from an alphabet.
• Any two edges coming out of
the same vertex have distinct
labels.
• Every keyword stored can be
spelled on a path from root to
some leaf.
• Furthermore, every path from
root to leaf gives a keyword.
Keyword Trees: Threading
• Thread ―appeal‖
• appeal
Keyword Trees: Threading
• Thread ―appeal‖
• appeal
Keyword Trees: Threading
• Thread ―appeal‖
• appeal
Keyword Trees: Threading
• Thread ―appeal‖
• appeal
Keyword Trees: Threading
• Thread ―apple‖
• apple
Keyword Trees: Threading
• Thread ―apple‖
• apple
Keyword Trees: Threading
• Thread ―apple‖
• apple
Keyword Trees: Threading
• Thread ―apple‖
• apple
Keyword Trees: Threading
• Thread ―apple‖
• apple
Multiple Pattern Matching (MPM) Problem
• Goal: Given a set of patterns and a text, find all occurrences of
any of patterns in text.
• Input: k patterns p1,…,pk, and text of m characters t = t1…tm
• Output: Positions 1 < i < m where the substring of text t
starting at i matches one of the patterns pj for 1 < j < k.
• Motivation: Searching database for known multiple patterns.
MPM: Naïve Approach
• We could always solve MPM as k ―Pattern Matching
Problems.‖
• Runtime: Using the PatternMatching algorithm k times gives
O(kmn):
• m = length of the text.
• n = average pattern length.
MPM: Keyword Tree Approach
• Alternatively we could use a keyword approach.
• Let N = total length of all patterns.
• We can build the keyword tree in O(N) time.
• Total Runtime:
• With naive threading: O(N + nm)
• Aho-Corasick algorithm: Improvement to O(N + m)
Keyword Trees: Threading
• To match patterns in a text using a
keyword tree:
• Build keyword tree of patterns
• ―Thread‖ the text through the
keyword tree.
Keyword Trees: Threading
• To match patterns in a text using a
keyword tree:
• Build keyword tree of patterns
• ―Thread‖ the text through the
keyword tree.
• Threading is ―complete‖ when we
reach a leaf in the keyword tree.
• When threading is ―complete,‖
we‘ve found a pattern in the text.
Section 4:
Suffix Trees
Suffix Trees = Collapsed Keyword Trees
• Suffix Tree: Similar to
keyword tree, except edges
that form paths are
collapsed.
• Each edge is labeled with
a substring of the text.
• All internal edges have at
least two outgoing edges.
• Leaves are labeled by the
index of the pattern.
Keyword Tree Suffix Tree
Suffix Trees = Collapsed Keyword Trees
ATCATG
TCATG
CATG
ATG
TG
G
Keyword Tree Suffix Tree
Suffix Tree of a Text
Keyword
Tree
Suffix
Tree
• The suffix trees of a text is constructed for all its suffixes.
• Example: Suffix tree of ATCATG:
ATCATG
TCATG
CATG
ATG
TG
G
Suffix Trees: Example
• Example: Suffix tree of TCATACATGGCATACATGG
Suffix Trees: Runtime
ATCATG
TCATG
CATG
ATG
TG
G
Keyword
Tree
Suffix
Tree
• Say the length of the text is m.
• Construction of the keyword tree takes O(m2) time.
• Constructing the suffix tree takes O(m) time.
• So our method takes O(m2 + m) = O(m2) time.
• However, there exists a method of calculating the suffix tree in
O(m) time without needing the keyword tree for the suffixes.
Suffix Trees: Runtime
ATCATG
TCATG
CATG
ATG
TG
G
Keyword
Tree
Suffix
Tree
• Say the length of the text is m.
• Construction of the keyword tree takes O(m2) time.
• Constructing the suffix tree takes O(m) time.
• So our method takes O(m2 + m) = O(m2) time.
• However, there exists a method of calculating the suffix tree in
O(m) time without needing the keyword tree for the suffixes.
Pattern Matching with Suffix Trees
• To find any pattern in a text:
1. Build suffix tree for text of length m—O(m) time
2. Thread the pattern of length n through the suffix tree of the
text—O(n) time.
• Therefore the runtime of the Pattern Matching Problem is only
O(m + n)!
Pattern Matching with Suffix Trees
SuffixTreePatternMatching(p,t)
1. Build suffix tree for text t
2. Thread pattern p through suffix tree
3. if threading is complete
4. output positions of all p-matching leaves in the tree
5. else
6. output “Pattern does not appear in text”
Threading ATG through a Suffix Tree
Multiple Pattern Matching: Summary
• Keyword and suffix trees are used to find patterns in a text.
• Keyword trees:
• Build the keyword tree of patterns, and thread the text
through it.
• Suffix trees:
• Build the suffix tree of the text, and thread the patterns
through it.
Section 5:
Heuristic Similarity Search
Algorithms
Approximate vs. Exact Pattern Matching
• So far all we‘ve seen exact pattern matching algorithms.
• Usually, because of mutations, it makes sense to find
approximate pattern matches.
• Biologists often use fast heuristic approaches (rather than local
alignment) to find approximate matches.
Heuristic Similarity Searches
• Genomes are huge: Smith-Waterman quadratic alignment
algorithms are too slow.
• Alignment of two sequences usually has short identical or
highly similar fragments.
• Many heuristic methods (e.g. BLAST) are based on the same
idea of filtration:
• Find short exact matches, and use them as seeds for
potential match extension.
• ―Filter‖ out positions with no extendable matches.
Dot Matrices
• Dot matrices show
similarities between two
sequences.
• FASTA makes an implicit
dot matrix from short exact
matches, and tries to find
long approximate diagonals
(allowing for some
mismatches).
Dot Matrices: Example
• Identify diagonals above a
threshold length.
• Diagonals in the dot matrix
indicate exact substring
matching.
Diagonals in Dot Matrices
• Extend diagonals and try to
link them together, allowing
for minimal
mismatches/indels.
• Linking exact diagonals
reveals approximate
matches over longer
substrings.
Section 6:
Approximate String
Matching
Approximate Pattern Matching Problem
• Goal: Find all approximate occurrences of a pattern in a text.
• Input: A pattern p = p1…pn, text t = t1…tm, and k, the
maximum allowable number of mismatches.
• Output: All positions 1 < i < (m – n + 1) such that ti…ti+n-1 and
p1…pn have at most k mismatches. i.e.,
HammingDistance(ti…ti+n-1, p) ≤ k.
Approximate Pattern Matching: Brute Force
ApproximatePatternMatching(p, t, k)
1. n  length of pattern p
2. m  length of text t
3. for i  1 to m – n + 1
4. dist  0
5. for j  1 to n
6. if ti+j-1 ≠ pj
7. dist  dist + 1
8. if dist < k
9. output i
Approximate Pattern Matching: Running Time
• The brute force algorithm runs in O(mn) time.
• Landau-Vishkin algorithm: Gives improvement to O(km).
• We will next generalize the ―Approximate Pattern Matching
Problem‖ into a ―Query Matching Problem.‖
• Rather than patterns, we want to match substrings in a
query to substrings in a text with at most k mismatches.
• Motivation: We want to see similarities to some gene, but we
may not know which parts of the gene to look for.
Section 7:
Query Matching and
Filtration
Query Matching Problem
• Goal: Find all substrings of a query that approximately match
the text.
• Input: Query q = q1…qw
Text t = t1…tm,
n = length of matching substrings
k = maximum number of mismatches
• Output: All pairs of positions (i, j) such that the n-letter
substring of query q starting at i approximately matches the n-
letter substring of text t starting at j, with at most k mismatches.
Approximate Pattern Matching vs Query Matching
Filtration in Query Matching: Main Idea
• Approximately matching strings share some perfectly
matching substrings.
• Instead of searching for approximately matching strings
(difficult) search for perfectly matching substrings (easy).
Filtration in Query Matching
• We want all n-matches between a query and a text with up to k
mismatches.
• ―Filter‖ out positions we know do not match between text and
query.
• Filtration involves two processes:
1. Potential match detection: Find all exact matches of l-
tuples in query and text for some small l.
2. Potential match verification: Verify each potential match
by extending it to the left and right, until (k + 1)
mismatches are found or we have n – k matches.
Step 1: Match Detection
• If x1…xn and y1…yn match with at most k mismatches, they
must share an l-tuple that is perfectly matched, where we have
l = n/(k + 1).
• Here  j  denotes the largest integer q with q ≤ j
• Where does this formula come from?
• Break string of length n into k+1 parts, each each of length
n/(k + 1)
• k mismatches can affect at most k of these k+1 parts.
• At least one of these k+1 parts is perfectly matched.
Step 1: Match Detection
1…l l +1…2l 2l +1…3l 3l +1…n
1 2 k k + 1
• Suppose k = 3. We would then have l = n / (k+1) =n/4:
• There are at most k mismatches in n, so at the very least there
must be one out of the k + 1 l-tuples without a mismatch.
Step 2: Match Verification
Query
Extend perfect
match of length l
until we find an
approximate
match of length n
with k
mismatches
Text
• For each l-match we find, try to extend the match further to see
if it is substantial.
Filtration: Changing l Changes Performance
l -tuple
length
Shorter perfect matches required
Performance decreases

n
2

n

n
3

n
4

n
5

n
6

k  5

k  4

k  3

k  2

k  1

k  0
Section 8:
Comparing a Sequence
Against a Database
Local alignment is too slow…














),(
),(
),(
0
max
1,1
1,
,1
,
jiji
jji
iji
ji
wvs
ws
vs
s



• Quadratic local alignment is
too slow while looking for
similarities between long
strings (e.g. the entire
GenBank database).
• Guaranteed to find the
optimal local alignment.
• Sets the standard for
sensitivity.
Local alignment is too slow…














),(
),(
),(
0
max
1,1
1,
,1
,
jiji
jji
iji
ji
wvs
ws
vs
s



• BLAST: Basic Local
Alignment Search Tool
• Created in 1990 by
Altschul, Gish, Miller,
Myers, & Lipman.
• Idea: Search sequence
databases for local
alignments to a query.
Features of BLAST
• Great improvement in speed, with a modest decrease in
sensitivity.
• Minimizes search space instead of exploring entire search
space between two sequences.
• Finds short exact matches (―seeds‖), and only explores locally
around these ―hits.‖
Section 9:
BLAST
Algorithm/Statistics
BLAST Algorithm
• Keyword search of all words of length w from a query of
length n in database of length m with score above threshold.
• w = 11 for DNA queries
• w =3 for proteins
• Perform local alignment extension for each keyword.
• Extend results until longest match above a given threshold is
achieved.
• Runtime: O(nm)
BLAST Algorithm
Query: 22 VLRDNIQGITKPAIRRLARRGGVKRISGLIYEETRGVLK 60
+++DN +G + IR L G+K I+ L+ E+ RG++K
Sbjct: 226 IIKDNGRGFSGKQIRNLNYGIGLKVIADLV-EKHRGIIK 263
Query: KRHRKVLRDNIQGITKPAIRRLARRGGVKRISGLIYEETRGVLKIFLENVIRD
keyword
GVK 18
GAK 16
GIK 16
GGK 14
GLK 13
GNK 12
GRK 11
GEK 11
GDK 11
neighborhood
score threshold
(T = 13)
Neighborhood
words
High-scoring Pair (HSP)
extension
Original BLAST
• Dictionary
• All words of length w
• Alignment
• Ungapped extensions until score falls below some
statistical threshold.
• Output
• All local alignments with score > threshold
Original BLAST: Example
From lectures by Serafim Batzoglou (Stanford)
• w = 4
• Exact keyword
match of GGTC
A C G A A G T A A G G T C C A G T
GATCCTGGATTGCGA
Original BLAST: Example
• w = 4
• Exact keyword
match of GGTC
A C G A A G T A A G G T C C A G T
GATCCTGGATTGCGA
From lectures by Serafim Batzoglou (Stanford)
Original BLAST: Example
• w = 4
• Exact keyword
match of GGTC
A C G A A G T A A G G T C C A G T
GATCCTGGATTGCGA
From lectures by Serafim Batzoglou (Stanford)
Original BLAST: Example
• w = 4
• Exact keyword
match of GGTC
• Extend diagonals
with mismatches
until score is under
50%.
A C G A A G T A A G G T C C A G T
GATCCTGGATTGCGA
From lectures by Serafim Batzoglou (Stanford)
Original BLAST: Example
• w = 4
• Exact keyword
match of GGTC
• Extend diagonals
with mismatches
until score is under
50%.
A C G A A G T A A G G T C C A G T
GATCCTGGATTGCGA
From lectures by Serafim Batzoglou (Stanford)
Original BLAST: Example
• w = 4
• Exact keyword
match of GGTC
• Extend diagonals
with mismatches
until score is under
50%.
A C G A A G T A A G G T C C A G T
GATCCTGGATTGCGA
From lectures by Serafim Batzoglou (Stanford)
Original BLAST: Example
• w = 4
• Exact keyword
match of GGTC
• Extend diagonals
with mismatches
until score is under
50%.
A C G A A G T A A G G T C C A G T
GATCCTGGATTGCGA
From lectures by Serafim Batzoglou (Stanford)
Original BLAST: Example
• w = 4
• Exact keyword
match of GGTC
• Extend diagonals
with mismatches
until score is under
50%.
A C G A A G T A A G G T C C A G T
GATCCTGGATTGCGA
From lectures by Serafim Batzoglou (Stanford)
A C G A A G T A A G G T C C A G T
Original BLAST: Example
GATCCTGGATTGCGA
• w = 4
• Exact keyword
match of GGTC
• Extend diagonals
with mismatches
until score is under
50%.
• Output result:
• GTAAGGTCC
• GTTAGGTCC
From lectures by Serafim Batzoglou (Stanford)
Gapped BLAST: Example
• Original BLAST exact
keyword search, THEN:
• Extend with gaps
around ends of exact
match until score <
threshold
• Output result
GTAAGGTCCAGT
GTTAGGTC-AGT
A C G A A G T A A G G T C C A G T
GATCCTGGATTGCGA
From lectures by Serafim Batzoglou (Stanford)
Incarnations of BLAST
• BLASTN: Nucleotide-nucleotide
• BLASTP: Protein-protein
• BLASTX: Translated query vs. protein database
• TBLASTN: Protein query vs. translated database
• TBLASTX: Translated query vs. translated database (6 frames
each)
Incarnations of BLAST
• PSI-BLAST: Find members of a protein family or build a
custom position-specific score matrix.
• MegaBLAST: Search longer sequences with fewer
differences.
• WU-BLAST (Wash U BLAST): Optimized, added features.
Assessing Sequence Similarity
• We need to know how strong an alignment can be expected to
be from chance alone.
• ―Chance‖ relates to comparison of sequences that are
generated randomly based upon a certain sequence model.
• Sequence models may take into account:
• G+C content
• Poly-A tails
• ―Junk‖ DNA
• Codon bias
• Etc.
BLAST: Segment Score
• BLAST uses scoring matrices (d) to improve on efficiency of
match detection.
• Some proteins may have very different amino acid sequences,
but are still similar.
• For any two l-mers x1…xl and y1…yl :
• Segment pair: Pair of l-mers, one from each sequence.
• Segment score:

d xi, yi i1
l

BLAST: Locally Maximal Segment Pairs
• A segment pair is locally maximal if its score can‘t be
improved by extending or shortening.
• Statistically significant locally maximal segment pairs are of
biological interest.
• BLAST finds all locally maximal segment pairs with scores
above some threshold.
• A significantly high threshold will filter out some statistically
insignificant matches.
BLAST: Statistics
• Threshold: Altschul-Dembo-Karlin statistics.
• Identifies smallest segment score that is unlikely to happen by
chance.
• # matches above q has mean E(q) = Kmne-lq; K is a constant, m
and n are the lengths of the two compared sequences.
• Parameter l is positive root of S x,y in A(pxpyed(x,y)) = 1, where px
and py are frequencies of amino acids x and y, and A is the
twenty letter amino acid alphabet
P-values
• The probability of finding b HSPs with a score ≥S is given by:
• For b = 0, that chance is:
• Thus the probability of finding at least one HSP with a score ≥
S is:

(e
 E
E
b
)
b!

e
 E
P  1  e
 E
Sample BLAST output
Score E
Sequences producing significant alignments: (bits) Value
gi|18858329|ref|NP_571095.1| ba1 globin [Danio rerio] >gi|147757... 171 3e-44
gi|18858331|ref|NP_571096.1| ba2 globin; SI:dZ118J2.3 [Danio rer... 170 7e-44
gi|37606100|emb|CAE48992.1| SI:bY187G17.6 (novel beta globin) [D... 170 7e-44
gi|31419195|gb|AAH53176.1| Ba1 protein [Danio rerio] 168 3e-43
ALIGNMENTS
>gi|18858329|ref|NP_571095.1| ba1 globin [Danio rerio]
Length = 148
Score = 171 bits (434), Expect = 3e-44
Identities = 76/148 (51%), Positives = 106/148 (71%), Gaps = 1/148 (0%)
Query: 1 MVHLTPEEKSAVTALWGKVNVDEVGGEALGRLLVVYPWTQRFFESFGDLSTPDAVMGNPK 60
MV T E++A+ LWGK+N+DE+G +AL R L+VYPWTQR+F +FG+LS+P A+MGNPK
Sbjct: 1 MVEWTDAERTAILGLWGKLNIDEIGPQALSRCLIVYPWTQRYFATFGNLSSPAAIMGNPK 60
Query: 61 VKAHGKKVLGAFSDGLAHLDNLKGTFATLSELHCDKLHVDPENFRLLGNVLVCVLAHHFG 120
V AHG+ V+G + ++DN+K T+A LS +H +KLHVDP+NFRLL + + A FG
Sbjct: 61 VAAHGRTVMGGLERAIKNMDNVKNTYAALSVMHSEKLHVDPDNFRLLADCITVCAAMKFG 120
• BLAST of human betaglobin protein against zebra fish:
Sample BLAST оutput
Score E
Sequences producing significant alignments: (bits) Value
gi|19849266|gb|AF487523.1| Homo sapiens gamma A hemoglobin (HBG1... 289 1e-75
gi|183868|gb|M11427.1|HUMHBG3E Human gamma-globin mRNA, 3' end 289 1e-75
gi|44887617|gb|AY534688.1| Homo sapiens A-gamma globin (HBG1) ge... 280 1e-72
gi|31726|emb|V00512.1|HSGGL1 Human messenger RNA for gamma-globin 260 1e-66
gi|38683401|ref|NR_001589.1| Homo sapiens hemoglobin, beta pseud... 151 7e-34
gi|18462073|gb|AF339400.1| Homo sapiens haplotype PB26 beta-glob... 149 3e-33
ALIGNMENTS
>gi|28380636|ref|NG_000007.3| Homo sapiens beta globin region (HBB@) on chromosome 11
Length = 81706
Score = 149 bits (75), Expect = 3e-33
Identities = 183/219 (83%)
Strand = Plus / Plus
Query: 267 ttgggagatgccacaaagcacctggatgatctcaagggcacctttgcccagctgagtgaa 326
|| ||| | || | || | |||||| ||||| ||||||||||| ||||||||
Sbjct: 54409 ttcggaaaagctgttatgctcacggatgacctcaaaggcacctttgctacactgagtgac 54468
• BLAST of human betaglobin protein against zebra fish:
Section 10:
PatternHunter and BLAT
Timeline
• 1970: Needleman-Wunsch global alignment algorithm
• 1981: Smith-Waterman local alignment algorithm
• 1985: FASTA
• 1990: BLAST (basic local alignment search tool)
• 2000s: Faster algorithms evolve for genome/genome:
• Pattern Hunter
• BLAT
BLAT vs. BLAST
• BLAT (BLAST-Like Alignment Tool): Same idea as
BLAST—locate short sequence hits and extend.
• Differences between BLAT and BLAST:
• BLAST builds an index of the query sequence and then
scans linearly through the database.
• BLAT builds an index of the database and scans linearly
through the query sequence.
• Index is stored in RAM, resulting in faster searches.
BLAT: Indexing
• An index is built that contains the positions of each k-mer in
the genome.
• Each k-mer in the query sequence is compared to each k-mer
in the index.
• A list of ‗hits‘ is generated – matching k-mer positions in
cDNA and in genome.
• Steps:
1. Break cDNA into 500 base chunks.
2. Use an index to find regions in genome similar to each
chunk of cDNA.
3. Construct alignment between genomic regions and cDNA
chunks.
4. Use dynamic programming to stitch together alignments
of chunks into the alignment of the whole.
BLAT: Fast cDNA Alignments
Indexing: An Example
Position of 3-mer in query, genome
• Here is an example with k = 3:
Genome: cacaattatcacgaccgc
3-mers (non-overlapping): cac aat tat cac gac cgc
Index: aat 3 gac 12
cac 0,9 tat 6
cgc 15
cDNA (query sequence): aattctcac
3-mers (overlapping): aat att ttc tct ctc tca cac
0 1 2 3 4 5 6
Hits: aat 0,3
cac 6,0
cac 6,9
clump: cacAATtatCACgaccgc
However…
• BLAT was designed to find sequences of 95% and greater
similarity of length > 40.
• Therefore we may miss more divergent or shorter sequence
alignments.
PatternHunter: faster and even more sensitive
• BLAST: matches short
consecutive sequences
(consecutive seed)
• Length = k
• Example (k = 11):
11111111111
• Each 1 represents a
―match.‖
• PatternHunter: matches
short non-consecutive
sequences (spaced seed).
• Increases sensitivity by
locating homologies that
would otherwise be missed.
• Example (a spaced seed of
length 18 with 11 matches):
111010010100110111
• Each 0 represents a ―don‘t
care‖, so there can be a
match or a mismatch.
Spaced Seeds
• Example of a hit using a spaced seed:
• How does this result in better sensitivity?
Why is PH Better?
• BLAST: redundant hits
• This results in > 1 hit
and creates clusters of
redundant hits.
• Example:
• PatternHunter: very few
redundant hits.
• Example:
Why is PH Better?
GAGTACTCAACACCAACATTAGTGGGCAATGGAAAAT
|||||||||||||||||||||||||||||||||||||
GAATACTCAACAGCAACATCAATGGGCAGCAGAAAAT
• In this example, despite a clear similarity, there is no sequence
of continuous matches longer than length 9.
• BLAST uses a length 11 and because of this, BLAST does
not recognize this as a hit!
• Resolving this would require reducing the seed length to 9,
which would have a damaging effect on speed.
• Example:
9 matches
Advantage of Gapped Seeds
11 positions
11 positions
10 positions
Why is PH Better?
1. Higher hit probability.
2. Lower expected number of random hits.
Use of Multiple Seeds
• Basic Search Algorithm:
1. Select a group of spaced seed models.
2. For each hit of each model, conduct extension to find a
homology.
PatternHunter and BLAT vs. BLAST
• PatternHunter is 5-100 times faster than BLASTN, depending
on data size, at the same sensitivity.
• BLAT is several times faster than BLAST, but best results are
limited to closely related sequences.
Resources
• http://tandem.bu.edu/classes/2004/papers/pathunter_grp
_prsnt.ppt
• http://www.jax.org/courses/archives/2004/gsa04_king_pr
esentation.pdf
• http://www.genomeblat.com/genomeblat/blatRapShow.p
ps

Más contenido relacionado

La actualidad más candente

oncogene as a transcription activator
oncogene as a transcription activatoroncogene as a transcription activator
oncogene as a transcription activatorDeepak Rohilla
 
Phylogenetic analysis
Phylogenetic analysis Phylogenetic analysis
Phylogenetic analysis Nitin Naik
 
Proteomics and protein-protein interaction
Proteomics  and protein-protein interactionProteomics  and protein-protein interaction
Proteomics and protein-protein interactionSenthilkumarV25
 
Transcriptomics and metabolomics
Transcriptomics and metabolomicsTranscriptomics and metabolomics
Transcriptomics and metabolomicsSukhjinder Singh
 
Transgenics - a biotech approach for improvement of tomato (tomato breeding)
Transgenics - a biotech approach for improvement of tomato  (tomato breeding)Transgenics - a biotech approach for improvement of tomato  (tomato breeding)
Transgenics - a biotech approach for improvement of tomato (tomato breeding)Mohammed Sami
 
Cloning and Expression of recombinant Protein
Cloning and Expression of recombinant ProteinCloning and Expression of recombinant Protein
Cloning and Expression of recombinant ProteinGaurav Dwivedi
 
Softwares For Phylogentic Analysis
Softwares For Phylogentic AnalysisSoftwares For Phylogentic Analysis
Softwares For Phylogentic AnalysisPrasanthperceptron
 
Functional genomics
Functional genomicsFunctional genomics
Functional genomicsAjit Shinde
 
Codon optimization-Creative Biogene
Codon optimization-Creative BiogeneCodon optimization-Creative Biogene
Codon optimization-Creative BiogeneDonglin Bao
 
Proteomics and its applications in phytopathology
Proteomics and its applications in phytopathologyProteomics and its applications in phytopathology
Proteomics and its applications in phytopathologyAbhijeet Kashyap
 
Agrobacterium mediated gene transfer in plants
Agrobacterium mediated gene transfer in plantsAgrobacterium mediated gene transfer in plants
Agrobacterium mediated gene transfer in plantsNamrata singh
 
Genomics, Transcriptomics, Proteomics, Metabolomics - Basic concepts for clin...
Genomics, Transcriptomics, Proteomics, Metabolomics - Basic concepts for clin...Genomics, Transcriptomics, Proteomics, Metabolomics - Basic concepts for clin...
Genomics, Transcriptomics, Proteomics, Metabolomics - Basic concepts for clin...Prasenjit Mitra
 

La actualidad más candente (20)

DNA Sequencing
DNA SequencingDNA Sequencing
DNA Sequencing
 
Phylogenetic data analysis
Phylogenetic data analysisPhylogenetic data analysis
Phylogenetic data analysis
 
Proteomics
ProteomicsProteomics
Proteomics
 
oncogene as a transcription activator
oncogene as a transcription activatoroncogene as a transcription activator
oncogene as a transcription activator
 
Dna extraction
Dna extractionDna extraction
Dna extraction
 
Phylogenetic analysis
Phylogenetic analysis Phylogenetic analysis
Phylogenetic analysis
 
Protein separation
Protein separationProtein separation
Protein separation
 
Proteomics and protein-protein interaction
Proteomics  and protein-protein interactionProteomics  and protein-protein interaction
Proteomics and protein-protein interaction
 
Transcriptomics and metabolomics
Transcriptomics and metabolomicsTranscriptomics and metabolomics
Transcriptomics and metabolomics
 
Transgenics - a biotech approach for improvement of tomato (tomato breeding)
Transgenics - a biotech approach for improvement of tomato  (tomato breeding)Transgenics - a biotech approach for improvement of tomato  (tomato breeding)
Transgenics - a biotech approach for improvement of tomato (tomato breeding)
 
Cloning and Expression of recombinant Protein
Cloning and Expression of recombinant ProteinCloning and Expression of recombinant Protein
Cloning and Expression of recombinant Protein
 
Softwares For Phylogentic Analysis
Softwares For Phylogentic AnalysisSoftwares For Phylogentic Analysis
Softwares For Phylogentic Analysis
 
Functional genomics
Functional genomicsFunctional genomics
Functional genomics
 
Codon optimization-Creative Biogene
Codon optimization-Creative BiogeneCodon optimization-Creative Biogene
Codon optimization-Creative Biogene
 
Genome Database Systems
Genome Database Systems Genome Database Systems
Genome Database Systems
 
Proteomics and its applications in phytopathology
Proteomics and its applications in phytopathologyProteomics and its applications in phytopathology
Proteomics and its applications in phytopathology
 
Agrobacterium mediated gene transfer in plants
Agrobacterium mediated gene transfer in plantsAgrobacterium mediated gene transfer in plants
Agrobacterium mediated gene transfer in plants
 
Bioinformatics Software
Bioinformatics SoftwareBioinformatics Software
Bioinformatics Software
 
Dot matrix seminar
Dot matrix seminarDot matrix seminar
Dot matrix seminar
 
Genomics, Transcriptomics, Proteomics, Metabolomics - Basic concepts for clin...
Genomics, Transcriptomics, Proteomics, Metabolomics - Basic concepts for clin...Genomics, Transcriptomics, Proteomics, Metabolomics - Basic concepts for clin...
Genomics, Transcriptomics, Proteomics, Metabolomics - Basic concepts for clin...
 

Destacado

An Application of Pattern matching for Motif Identification
An Application of Pattern matching for Motif IdentificationAn Application of Pattern matching for Motif Identification
An Application of Pattern matching for Motif IdentificationCSCJournals
 
PRML 13.2.2: The Forward-Backward Algorithm
PRML 13.2.2: The Forward-Backward AlgorithmPRML 13.2.2: The Forward-Backward Algorithm
PRML 13.2.2: The Forward-Backward AlgorithmShinichi Tamura
 
Use of Rasmol and study of proteins
Use of Rasmol and study of proteins Use of Rasmol and study of proteins
Use of Rasmol and study of proteins kamalmodi481
 
Gene expression introduction
Gene expression introductionGene expression introduction
Gene expression introductionSetia Pramana
 
Artificial neural network model & hidden layers in multilayer artificial neur...
Artificial neural network model & hidden layers in multilayer artificial neur...Artificial neural network model & hidden layers in multilayer artificial neur...
Artificial neural network model & hidden layers in multilayer artificial neur...Muhammad Ishaq
 
Immune response to hiv infection
Immune response to hiv infectionImmune response to hiv infection
Immune response to hiv infectionNarenkumar M
 
ISOLATION OF RNA
ISOLATION OF RNA ISOLATION OF RNA
ISOLATION OF RNA Suresh San
 
5 immune defense against bacterial pathogens
5 immune defense against bacterial  pathogens5 immune defense against bacterial  pathogens
5 immune defense against bacterial pathogensPrabesh Raj Jamkatel
 
Principles of DNA isolation, PCR and LAMP
Principles of DNA isolation, PCR and LAMPPrinciples of DNA isolation, PCR and LAMP
Principles of DNA isolation, PCR and LAMPPerez Eric
 
Concepts in molecular biology
Concepts in molecular biologyConcepts in molecular biology
Concepts in molecular biologyOla Elgaddar
 
SAGE (Serial analysis of Gene Expression)
SAGE (Serial analysis of Gene Expression)SAGE (Serial analysis of Gene Expression)
SAGE (Serial analysis of Gene Expression)talhakhat
 
Dna library lecture-Gene libraries and screening
Dna library lecture-Gene libraries and screening  Dna library lecture-Gene libraries and screening
Dna library lecture-Gene libraries and screening Abdullah Abobakr
 
Molecular cloning vectors
Molecular cloning vectorsMolecular cloning vectors
Molecular cloning vectorsSonia John
 
BACTERIAL INFECTION AND IMMUNE SYSTEM RESPONSE
BACTERIAL INFECTION AND IMMUNE SYSTEM RESPONSEBACTERIAL INFECTION AND IMMUNE SYSTEM RESPONSE
BACTERIAL INFECTION AND IMMUNE SYSTEM RESPONSEDiana Agudelo
 
Immunity types and compliment system ppt
Immunity types and compliment system pptImmunity types and compliment system ppt
Immunity types and compliment system pptali7070
 
Molecular Cloning - Vectors: Types & Characteristics
Molecular Cloning -  Vectors: Types & CharacteristicsMolecular Cloning -  Vectors: Types & Characteristics
Molecular Cloning - Vectors: Types & CharacteristicsSruthy Chandran
 

Destacado (20)

An Application of Pattern matching for Motif Identification
An Application of Pattern matching for Motif IdentificationAn Application of Pattern matching for Motif Identification
An Application of Pattern matching for Motif Identification
 
PRML 13.2.2: The Forward-Backward Algorithm
PRML 13.2.2: The Forward-Backward AlgorithmPRML 13.2.2: The Forward-Backward Algorithm
PRML 13.2.2: The Forward-Backward Algorithm
 
Use of Rasmol and study of proteins
Use of Rasmol and study of proteins Use of Rasmol and study of proteins
Use of Rasmol and study of proteins
 
Gene expression introduction
Gene expression introductionGene expression introduction
Gene expression introduction
 
1. vectors
1. vectors1. vectors
1. vectors
 
Artificial neural network model & hidden layers in multilayer artificial neur...
Artificial neural network model & hidden layers in multilayer artificial neur...Artificial neural network model & hidden layers in multilayer artificial neur...
Artificial neural network model & hidden layers in multilayer artificial neur...
 
Immune response to viruses
Immune response to virusesImmune response to viruses
Immune response to viruses
 
Immune response to hiv infection
Immune response to hiv infectionImmune response to hiv infection
Immune response to hiv infection
 
ISOLATION OF RNA
ISOLATION OF RNA ISOLATION OF RNA
ISOLATION OF RNA
 
HIV/AIDS (IMMUNOLOGY)
HIV/AIDS (IMMUNOLOGY)HIV/AIDS (IMMUNOLOGY)
HIV/AIDS (IMMUNOLOGY)
 
5 immune defense against bacterial pathogens
5 immune defense against bacterial  pathogens5 immune defense against bacterial  pathogens
5 immune defense against bacterial pathogens
 
Principles of DNA isolation, PCR and LAMP
Principles of DNA isolation, PCR and LAMPPrinciples of DNA isolation, PCR and LAMP
Principles of DNA isolation, PCR and LAMP
 
Immune Response to HIV
Immune Response to HIVImmune Response to HIV
Immune Response to HIV
 
Concepts in molecular biology
Concepts in molecular biologyConcepts in molecular biology
Concepts in molecular biology
 
SAGE (Serial analysis of Gene Expression)
SAGE (Serial analysis of Gene Expression)SAGE (Serial analysis of Gene Expression)
SAGE (Serial analysis of Gene Expression)
 
Dna library lecture-Gene libraries and screening
Dna library lecture-Gene libraries and screening  Dna library lecture-Gene libraries and screening
Dna library lecture-Gene libraries and screening
 
Molecular cloning vectors
Molecular cloning vectorsMolecular cloning vectors
Molecular cloning vectors
 
BACTERIAL INFECTION AND IMMUNE SYSTEM RESPONSE
BACTERIAL INFECTION AND IMMUNE SYSTEM RESPONSEBACTERIAL INFECTION AND IMMUNE SYSTEM RESPONSE
BACTERIAL INFECTION AND IMMUNE SYSTEM RESPONSE
 
Immunity types and compliment system ppt
Immunity types and compliment system pptImmunity types and compliment system ppt
Immunity types and compliment system ppt
 
Molecular Cloning - Vectors: Types & Characteristics
Molecular Cloning -  Vectors: Types & CharacteristicsMolecular Cloning -  Vectors: Types & Characteristics
Molecular Cloning - Vectors: Types & Characteristics
 

Similar a DNA Pattern Matching Techniques

Lecture on the annotation of transposable elements
Lecture on the annotation of transposable elementsLecture on the annotation of transposable elements
Lecture on the annotation of transposable elementsfmaumus
 
Lecture10.pdf
Lecture10.pdfLecture10.pdf
Lecture10.pdftmmwj1
 
The Human Genome Project - Part I
The Human Genome Project - Part IThe Human Genome Project - Part I
The Human Genome Project - Part Ihhalhaddad
 
De novo genome assembly - IMB Winter School - 7 July 2015
De novo genome assembly - IMB Winter School - 7 July 2015De novo genome assembly - IMB Winter School - 7 July 2015
De novo genome assembly - IMB Winter School - 7 July 2015Torsten Seemann
 
Assembling NGS Data - IMB Winter School - 3 July 2012
Assembling NGS Data - IMB Winter School - 3 July 2012Assembling NGS Data - IMB Winter School - 3 July 2012
Assembling NGS Data - IMB Winter School - 3 July 2012Torsten Seemann
 
De novo genome assembly - T.Seemann - IMB winter school 2016 - brisbane, au ...
De novo genome assembly  - T.Seemann - IMB winter school 2016 - brisbane, au ...De novo genome assembly  - T.Seemann - IMB winter school 2016 - brisbane, au ...
De novo genome assembly - T.Seemann - IMB winter school 2016 - brisbane, au ...Torsten Seemann
 
Generating Natural-Language Text with Neural Networks
Generating Natural-Language Text with Neural NetworksGenerating Natural-Language Text with Neural Networks
Generating Natural-Language Text with Neural NetworksJonathan Mugan
 
CS176: Genome Assembly
CS176: Genome AssemblyCS176: Genome Assembly
CS176: Genome Assemblyfnothaft
 
Python: The Iterator Pattern (Comprehensions)
Python: The Iterator Pattern (Comprehensions)Python: The Iterator Pattern (Comprehensions)
Python: The Iterator Pattern (Comprehensions)Damian T. Gordon
 
pcr BY ME.docx
pcr BY ME.docxpcr BY ME.docx
pcr BY ME.docxPandey141
 
Elementary cryptography
Elementary cryptographyElementary cryptography
Elementary cryptographyG Prachi
 
Genotyping a deletion mutation in C. elegans via PCR
Genotyping a deletion mutation in C. elegans via PCRGenotyping a deletion mutation in C. elegans via PCR
Genotyping a deletion mutation in C. elegans via PCRTiffany Timbers
 
281 lec31 mol_tech3
281 lec31 mol_tech3281 lec31 mol_tech3
281 lec31 mol_tech3hhalhaddad
 
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...JAINAM KAPADIYA
 
High Throughput Sequencing Technologies: What We Can Know
High Throughput Sequencing Technologies: What We Can KnowHigh Throughput Sequencing Technologies: What We Can Know
High Throughput Sequencing Technologies: What We Can KnowBrian Krueger
 

Similar a DNA Pattern Matching Techniques (20)

Lecture on the annotation of transposable elements
Lecture on the annotation of transposable elementsLecture on the annotation of transposable elements
Lecture on the annotation of transposable elements
 
Lecture10.pdf
Lecture10.pdfLecture10.pdf
Lecture10.pdf
 
The Human Genome Project - Part I
The Human Genome Project - Part IThe Human Genome Project - Part I
The Human Genome Project - Part I
 
De novo genome assembly - IMB Winter School - 7 July 2015
De novo genome assembly - IMB Winter School - 7 July 2015De novo genome assembly - IMB Winter School - 7 July 2015
De novo genome assembly - IMB Winter School - 7 July 2015
 
Assembling NGS Data - IMB Winter School - 3 July 2012
Assembling NGS Data - IMB Winter School - 3 July 2012Assembling NGS Data - IMB Winter School - 3 July 2012
Assembling NGS Data - IMB Winter School - 3 July 2012
 
De novo genome assembly - T.Seemann - IMB winter school 2016 - brisbane, au ...
De novo genome assembly  - T.Seemann - IMB winter school 2016 - brisbane, au ...De novo genome assembly  - T.Seemann - IMB winter school 2016 - brisbane, au ...
De novo genome assembly - T.Seemann - IMB winter school 2016 - brisbane, au ...
 
Generating Natural-Language Text with Neural Networks
Generating Natural-Language Text with Neural NetworksGenerating Natural-Language Text with Neural Networks
Generating Natural-Language Text with Neural Networks
 
CS176: Genome Assembly
CS176: Genome AssemblyCS176: Genome Assembly
CS176: Genome Assembly
 
Python: The Iterator Pattern (Comprehensions)
Python: The Iterator Pattern (Comprehensions)Python: The Iterator Pattern (Comprehensions)
Python: The Iterator Pattern (Comprehensions)
 
Primer design task
Primer design taskPrimer design task
Primer design task
 
PCR.ppt
PCR.pptPCR.ppt
PCR.ppt
 
pcr BY ME.docx
pcr BY ME.docxpcr BY ME.docx
pcr BY ME.docx
 
Elementary cryptography
Elementary cryptographyElementary cryptography
Elementary cryptography
 
PCR
PCRPCR
PCR
 
Genotyping a deletion mutation in C. elegans via PCR
Genotyping a deletion mutation in C. elegans via PCRGenotyping a deletion mutation in C. elegans via PCR
Genotyping a deletion mutation in C. elegans via PCR
 
281 lec31 mol_tech3
281 lec31 mol_tech3281 lec31 mol_tech3
281 lec31 mol_tech3
 
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
 
High Throughput Sequencing Technologies: What We Can Know
High Throughput Sequencing Technologies: What We Can KnowHigh Throughput Sequencing Technologies: What We Can Know
High Throughput Sequencing Technologies: What We Can Know
 
Gemoda
GemodaGemoda
Gemoda
 
Bioinformatica p2-p3-introduction
Bioinformatica p2-p3-introductionBioinformatica p2-p3-introduction
Bioinformatica p2-p3-introduction
 

Más de BioinformaticsInstitute

Comparative Genomics and de Bruijn graphs
Comparative Genomics and de Bruijn graphsComparative Genomics and de Bruijn graphs
Comparative Genomics and de Bruijn graphsBioinformaticsInstitute
 
Биоинформатический анализ данных полноэкзомного секвенирования: анализ качес...
 Биоинформатический анализ данных полноэкзомного секвенирования: анализ качес... Биоинформатический анализ данных полноэкзомного секвенирования: анализ качес...
Биоинформатический анализ данных полноэкзомного секвенирования: анализ качес...BioinformaticsInstitute
 
Вперед в прошлое. Методы генетической диагностики древней днк
Вперед в прошлое. Методы генетической диагностики древней днкВперед в прошлое. Методы генетической диагностики древней днк
Вперед в прошлое. Методы генетической диагностики древней днкBioinformaticsInstitute
 
"Зачем биологам суперкомпьютеры", Александр Предеус
"Зачем биологам суперкомпьютеры", Александр Предеус"Зачем биологам суперкомпьютеры", Александр Предеус
"Зачем биологам суперкомпьютеры", Александр ПредеусBioinformaticsInstitute
 
Иммунотерапия раковых опухолей: взгляд со стороны системной биологии. Максим ...
Иммунотерапия раковых опухолей: взгляд со стороны системной биологии. Максим ...Иммунотерапия раковых опухолей: взгляд со стороны системной биологии. Максим ...
Иммунотерапия раковых опухолей: взгляд со стороны системной биологии. Максим ...BioinformaticsInstitute
 
Рак 101 (Мария Шутова, ИоГЕН РАН)
Рак 101 (Мария Шутова, ИоГЕН РАН)Рак 101 (Мария Шутова, ИоГЕН РАН)
Рак 101 (Мария Шутова, ИоГЕН РАН)BioinformaticsInstitute
 
Секвенирование как инструмент исследования сложных фенотипов человека: от ген...
Секвенирование как инструмент исследования сложных фенотипов человека: от ген...Секвенирование как инструмент исследования сложных фенотипов человека: от ген...
Секвенирование как инструмент исследования сложных фенотипов человека: от ген...BioinformaticsInstitute
 
Инвестиции в биоинформатику и биотех (Андрей Афанасьев)
Инвестиции в биоинформатику и биотех (Андрей Афанасьев)Инвестиции в биоинформатику и биотех (Андрей Афанасьев)
Инвестиции в биоинформатику и биотех (Андрей Афанасьев)BioinformaticsInstitute
 

Más de BioinformaticsInstitute (20)

Graph genome
Graph genome Graph genome
Graph genome
 
Nanopores sequencing
Nanopores sequencingNanopores sequencing
Nanopores sequencing
 
A superglue for string comparison
A superglue for string comparisonA superglue for string comparison
A superglue for string comparison
 
Comparative Genomics and de Bruijn graphs
Comparative Genomics and de Bruijn graphsComparative Genomics and de Bruijn graphs
Comparative Genomics and de Bruijn graphs
 
Биоинформатический анализ данных полноэкзомного секвенирования: анализ качес...
 Биоинформатический анализ данных полноэкзомного секвенирования: анализ качес... Биоинформатический анализ данных полноэкзомного секвенирования: анализ качес...
Биоинформатический анализ данных полноэкзомного секвенирования: анализ качес...
 
Вперед в прошлое. Методы генетической диагностики древней днк
Вперед в прошлое. Методы генетической диагностики древней днкВперед в прошлое. Методы генетической диагностики древней днк
Вперед в прошлое. Методы генетической диагностики древней днк
 
Knime &amp; bioinformatics
Knime &amp; bioinformaticsKnime &amp; bioinformatics
Knime &amp; bioinformatics
 
"Зачем биологам суперкомпьютеры", Александр Предеус
"Зачем биологам суперкомпьютеры", Александр Предеус"Зачем биологам суперкомпьютеры", Александр Предеус
"Зачем биологам суперкомпьютеры", Александр Предеус
 
Иммунотерапия раковых опухолей: взгляд со стороны системной биологии. Максим ...
Иммунотерапия раковых опухолей: взгляд со стороны системной биологии. Максим ...Иммунотерапия раковых опухолей: взгляд со стороны системной биологии. Максим ...
Иммунотерапия раковых опухолей: взгляд со стороны системной биологии. Максим ...
 
Рак 101 (Мария Шутова, ИоГЕН РАН)
Рак 101 (Мария Шутова, ИоГЕН РАН)Рак 101 (Мария Шутова, ИоГЕН РАН)
Рак 101 (Мария Шутова, ИоГЕН РАН)
 
Плюрипотентность 101
Плюрипотентность 101Плюрипотентность 101
Плюрипотентность 101
 
Секвенирование как инструмент исследования сложных фенотипов человека: от ген...
Секвенирование как инструмент исследования сложных фенотипов человека: от ген...Секвенирование как инструмент исследования сложных фенотипов человека: от ген...
Секвенирование как инструмент исследования сложных фенотипов человека: от ген...
 
Инвестиции в биоинформатику и биотех (Андрей Афанасьев)
Инвестиции в биоинформатику и биотех (Андрей Афанасьев)Инвестиции в биоинформатику и биотех (Андрей Афанасьев)
Инвестиции в биоинформатику и биотех (Андрей Афанасьев)
 
Biodb 2011-everything
Biodb 2011-everythingBiodb 2011-everything
Biodb 2011-everything
 
Biodb 2011-05
Biodb 2011-05Biodb 2011-05
Biodb 2011-05
 
Biodb 2011-04
Biodb 2011-04Biodb 2011-04
Biodb 2011-04
 
Biodb 2011-03
Biodb 2011-03Biodb 2011-03
Biodb 2011-03
 
Biodb 2011-01
Biodb 2011-01Biodb 2011-01
Biodb 2011-01
 
Biodb 2011-02
Biodb 2011-02Biodb 2011-02
Biodb 2011-02
 
Ngs 3 1
Ngs 3 1Ngs 3 1
Ngs 3 1
 

Último

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Último (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

DNA Pattern Matching Techniques

  • 2. Section 1: Repeat Finding and Hash Tables
  • 3. Genomic Repeats • Repeat: A sequence of DNA that occurs more than once in a genome. • Example: ATGGTCTAGGTCCTAGTGGTC
  • 4. Genomic Repeats • Repeat: A sequence of DNA that occurs more than once in a genome. • Example: ATGGTCTAGGTCCTAGTGGTC
  • 5. Genomic Repeats • Repeat: A sequence of DNA that occurs more than once in a genome. • Example: ATGGTCTAGGTCCTAGTGGTC
  • 6. Genomic Repeats • Repeat: A sequence of DNA that occurs more than once in a genome. • Example: ATGGTCTAGGTCCTAGTGGTC
  • 7. Genomic Repeats • Repeat: A sequence of DNA that occurs more than once in a genome. • Example: ATGGTCTAGGTCCTAGTGGTC • Why do we want to find repeats? 1. Understand more about evolution. 2. Many tumors are characterized by an explosion of repeats. 3. Genomic rearrangements are often associated with repeats.
  • 8. Genomic Repeats • Note: Often, a repeat will refer to a segment of DNA that occurs very often with slight modifications. • As we might imagine, this is a more difficult computational problem.
  • 9. Genomic Repeats • Note: Often, a repeat will refer to a segment of DNA that occurs very often with slight modifications. • As we might imagine, this is a more difficult computational problem. • Example: Say our target segment is GGTC and we allow one substitution: • ATGGTCTAGGACCTAGTGTTC
  • 10. Genomic Repeats • Note: Often, a repeat will refer to a segment of DNA that occurs very often with slight modifications. • As we might imagine, this is a more difficult computational problem. • Example: Say our target segment is GGTC and we allow one substitution: • ATGGTCTAGGACCTAGTGTTC
  • 11. Genomic Repeats • Note: Often, a repeat will refer to a segment of DNA that occurs very often with slight modifications. • As we might imagine, this is a more difficult computational problem. • Example: Say our target segment is GGTC and we allow one substitution: • ATGGTCTAGGACCTAGTGTTC
  • 12. Genomic Repeats • Note: Often, a repeat will refer to a segment of DNA that occurs very often with slight modifications. • As we might imagine, this is a more difficult computational problem. • Example: Say our target segment is GGTC and we allow one substitution: • ATGGTCTAGGACCTAGTGTTC
  • 13. Extending l-mer Repeats • Long repeats are difficult to find, but short repeats are easy. • Simple approach to finding long repeats: 1. Find exact repeats of short l-mers (l is usually 10 to 13). 2. Use l-mer repeats to potentially extend into longer, maximal repeats.
  • 14. Extending l-mer Repeats • Example: We start with a repeat of length 4. • GCTTACAGATTCAGTCTTACAGATGGT
  • 15. Extending l-mer Repeats • Example: We start with a repeat of length 4. • GCTTACAGATTCAGTCTTACAGATGGT
  • 16. Extending l-mer Repeats • Example: We start with a repeat of length 4. • GCTTACAGATTCAGTCTTACAGATGGT • Extend both these 4-mers: • GCTTACAGATTCAGTCTTACAGATGGT
  • 17. Extending l-mer Repeats • Example: We start with a repeat of length 4. • GCTTACAGATTCAGTCTTACAGATGGT • Extend both these 4-mers: • GCTTACAGATTCAGTCTTACAGATGGT
  • 18. Extending l-mer Repeats • Example: We start with a repeat of length 4. • GCTTACAGATTCAGTCTTACAGATGGT • Extend both these 4-mers: • GCTTACAGATTCAGTCTTACAGATGGT
  • 19. Extending l-mer Repeats • Example: We start with a repeat of length 4. • GCTTACAGATTCAGTCTTACAGATGGT • Extend both these 4-mers: • GCTTACAGATTCAGTCTTACAGATGGT
  • 20. Extending l-mer Repeats • Example: We start with a repeat of length 4. • GCTTACAGATTCAGTCTTACAGATGGT • Extend both these 4-mers: • GCTTACAGATTCAGTCTTACAGATGGT
  • 21. Extending l-mer Repeats • Example: We start with a repeat of length 4. • GCTTACAGATTCAGTCTTACAGATGGT • Extend both these 4-mers: • GCTTACAGATTCAGTCTTACAGATGGT
  • 22. Extending l-mer Repeats • Example: We start with a repeat of length 4. • GCTTACAGATTCAGTCTTACAGATGGT • Extend both these 4-mers: • GCTTACAGATTCAGTCTTACAGATGGT
  • 23. Extending l-mer Repeats • Example: We start with a repeat of length 4. • GCTTACAGATTCAGTCTTACAGATGGT • Extend both these 4-mers: • GCTTACAGATTCAGTCTTACAGATGGT • Maximal repeat: CTTACAGAT
  • 24. Maximal Repeats: Issue • In order to find maximal repeats in this way, we need ALL start locations of ALL l-mers in the genome. • Hashing lets us find repeats quickly in this manner.
  • 25. Hashing • Hashing is a very efficient way to store and retrieve data. • What does hashing do? • Say we are given a collection of data. • For different entry, generate a unique integer and store the entry in an array at this integer location.
  • 26. Hashing: Definitions • Records: data stored in a hash table. • Keys: Integers identifying set of records. • Hash Table: The array of keys used in hashing. • Hash Function: Assigns each record to a key. • Collision: Occurs when more than one record is mapped to the same index in the hash table.
  • 27. Hashing: Example • Records: Animals • Keys: Where each animal eats.
  • 28. Hashing DNA sequences • Each l-mer can be translated into a binary string: • A can be represented as 00 • T can be represented as 01 • G can be represented as 10 • C can be represented as 11 • Example: ATGCTA = 000110110100 • After assigning a unique integer to each l-mer, it is easy to obtain all start locations of each l-mer in a genome.
  • 29. Hashing: Maximal Repeats • To find repeats in a genome: 1. For all l-mers in the genome, note the start position and the sequence. 2. Generate a hash table index for each unique l-mer sequence. 3. At each index of the hash table, store all genome start locations of the l-mer that generated the index. 4. Anywhere there are collisions in the table, extend corresponding l-mers to maximal repeats. • How do we deal with collisions?
  • 30. Hashing: Collisions • In order to deal with collisions: • ―Chain‖ all start locations of l-mers. • This can be done via a data structure called a linked list.
  • 32. Pattern Matching • What if, instead of finding repeats in a genome, we want to find all sequences in a database that contain a given pattern? • This leads us to a different problem, the Pattern Matching Problem.
  • 33. Pattern Matching Problem • Goal: Find all occurrences of a pattern in a text. • Input: • Pattern p = p1…pn of length n • Text t = t1…tm of length m • Output: All positions 1< i < (m – n + 1) such that the n-letter substring of text t starting at i matches the pattern p. • Motivation: Searching database for a known pattern.
  • 34. Exact Pattern Matching: A Brute Force Algorithm PatternMatching(p,t) 1 n  length of pattern p 2 m  length of text t 3 for i  1 to (m – n + 1) 4 if ti…ti+n-1 = p 5 output i
  • 35. • PatternMatching algorithm for: • Pattern GCAT • Text AGCCGCATCT Exact Pattern Matching: An Example
  • 36. • PatternMatching algorithm for: • Pattern GCAT • Text AGCCGCATCT • AGCCGCATCT • GCAT Exact Pattern Matching: An Example
  • 37. • PatternMatching algorithm for: • Pattern GCAT • Text AGCCGCATCT • AGCCGCATCT • GCAT Exact Pattern Matching: An Example
  • 38. • PatternMatching algorithm for: • Pattern GCAT • Text AGCCGCATCT • AGCCGCATCT • GCAT Exact Pattern Matching: An Example
  • 39. • PatternMatching algorithm for: • Pattern GCAT • Text AGCCGCATCT • AGCCGCATCT • GCAT Exact Pattern Matching: An Example
  • 40. • PatternMatching algorithm for: • Pattern GCAT • Text AGCCGCATCT • AGCCGCATCT • GCAT Exact Pattern Matching: An Example
  • 41. • PatternMatching algorithm for: • Pattern GCAT • Text AGCCGCATCT • AGCCGCATCT • GCAT Exact Pattern Matching: An Example
  • 42. • PatternMatching algorithm for: • Pattern GCAT • Text AGCCGCATCT • AGCCGCATCT • GCAT Exact Pattern Matching: An Example
  • 43. • PatternMatching runtime: O(nm) • In the worst case, we have to check n characters at each of the m letters of the text. • Example: Text = AAAAAAAAAAAAAAAA, Pattern = AAAC • This is rare; on average, the run time is more like O(m). • Rarely will there be close to n comparisons at each step. • Better solution: suffix trees…solve in O(m) time. • First we need keyword trees. Exact Pattern Matching: Running Time
  • 45. Keyword Trees: Example • Keyword tree: • Apple
  • 46. Keyword Trees: Example • Keyword tree: • Apple • Apropos
  • 47. Keyword Trees: Example • Keyword tree: • Apple • Apropos • Banana
  • 48. Keyword Trees: Example • Keyword tree: • Apple • Apropos • Banana • Bandana
  • 49. Keyword Trees: Example • Keyword tree: • Apple • Apropos • Banana • Bandana • Orange
  • 50. Keyword Trees: Properties • Stores a set of keywords in a rooted labeled tree. • Each edge is labeled with a letter from an alphabet. • Any two edges coming out of the same vertex have distinct labels. • Every keyword stored can be spelled on a path from root to some leaf. • Furthermore, every path from root to leaf gives a keyword.
  • 51. Keyword Trees: Threading • Thread ―appeal‖ • appeal
  • 52. Keyword Trees: Threading • Thread ―appeal‖ • appeal
  • 53. Keyword Trees: Threading • Thread ―appeal‖ • appeal
  • 54. Keyword Trees: Threading • Thread ―appeal‖ • appeal
  • 55. Keyword Trees: Threading • Thread ―apple‖ • apple
  • 56. Keyword Trees: Threading • Thread ―apple‖ • apple
  • 57. Keyword Trees: Threading • Thread ―apple‖ • apple
  • 58. Keyword Trees: Threading • Thread ―apple‖ • apple
  • 59. Keyword Trees: Threading • Thread ―apple‖ • apple
  • 60. Multiple Pattern Matching (MPM) Problem • Goal: Given a set of patterns and a text, find all occurrences of any of patterns in text. • Input: k patterns p1,…,pk, and text of m characters t = t1…tm • Output: Positions 1 < i < m where the substring of text t starting at i matches one of the patterns pj for 1 < j < k. • Motivation: Searching database for known multiple patterns.
  • 61. MPM: Naïve Approach • We could always solve MPM as k ―Pattern Matching Problems.‖ • Runtime: Using the PatternMatching algorithm k times gives O(kmn): • m = length of the text. • n = average pattern length.
  • 62. MPM: Keyword Tree Approach • Alternatively we could use a keyword approach. • Let N = total length of all patterns. • We can build the keyword tree in O(N) time. • Total Runtime: • With naive threading: O(N + nm) • Aho-Corasick algorithm: Improvement to O(N + m)
  • 63. Keyword Trees: Threading • To match patterns in a text using a keyword tree: • Build keyword tree of patterns • ―Thread‖ the text through the keyword tree.
  • 64. Keyword Trees: Threading • To match patterns in a text using a keyword tree: • Build keyword tree of patterns • ―Thread‖ the text through the keyword tree. • Threading is ―complete‖ when we reach a leaf in the keyword tree. • When threading is ―complete,‖ we‘ve found a pattern in the text.
  • 66. Suffix Trees = Collapsed Keyword Trees • Suffix Tree: Similar to keyword tree, except edges that form paths are collapsed. • Each edge is labeled with a substring of the text. • All internal edges have at least two outgoing edges. • Leaves are labeled by the index of the pattern. Keyword Tree Suffix Tree
  • 67. Suffix Trees = Collapsed Keyword Trees ATCATG TCATG CATG ATG TG G Keyword Tree Suffix Tree
  • 68. Suffix Tree of a Text Keyword Tree Suffix Tree • The suffix trees of a text is constructed for all its suffixes. • Example: Suffix tree of ATCATG: ATCATG TCATG CATG ATG TG G
  • 69. Suffix Trees: Example • Example: Suffix tree of TCATACATGGCATACATGG
  • 70. Suffix Trees: Runtime ATCATG TCATG CATG ATG TG G Keyword Tree Suffix Tree • Say the length of the text is m. • Construction of the keyword tree takes O(m2) time. • Constructing the suffix tree takes O(m) time. • So our method takes O(m2 + m) = O(m2) time. • However, there exists a method of calculating the suffix tree in O(m) time without needing the keyword tree for the suffixes.
  • 71. Suffix Trees: Runtime ATCATG TCATG CATG ATG TG G Keyword Tree Suffix Tree • Say the length of the text is m. • Construction of the keyword tree takes O(m2) time. • Constructing the suffix tree takes O(m) time. • So our method takes O(m2 + m) = O(m2) time. • However, there exists a method of calculating the suffix tree in O(m) time without needing the keyword tree for the suffixes.
  • 72. Pattern Matching with Suffix Trees • To find any pattern in a text: 1. Build suffix tree for text of length m—O(m) time 2. Thread the pattern of length n through the suffix tree of the text—O(n) time. • Therefore the runtime of the Pattern Matching Problem is only O(m + n)!
  • 73. Pattern Matching with Suffix Trees SuffixTreePatternMatching(p,t) 1. Build suffix tree for text t 2. Thread pattern p through suffix tree 3. if threading is complete 4. output positions of all p-matching leaves in the tree 5. else 6. output “Pattern does not appear in text”
  • 74. Threading ATG through a Suffix Tree
  • 75. Multiple Pattern Matching: Summary • Keyword and suffix trees are used to find patterns in a text. • Keyword trees: • Build the keyword tree of patterns, and thread the text through it. • Suffix trees: • Build the suffix tree of the text, and thread the patterns through it.
  • 76. Section 5: Heuristic Similarity Search Algorithms
  • 77. Approximate vs. Exact Pattern Matching • So far all we‘ve seen exact pattern matching algorithms. • Usually, because of mutations, it makes sense to find approximate pattern matches. • Biologists often use fast heuristic approaches (rather than local alignment) to find approximate matches.
  • 78. Heuristic Similarity Searches • Genomes are huge: Smith-Waterman quadratic alignment algorithms are too slow. • Alignment of two sequences usually has short identical or highly similar fragments. • Many heuristic methods (e.g. BLAST) are based on the same idea of filtration: • Find short exact matches, and use them as seeds for potential match extension. • ―Filter‖ out positions with no extendable matches.
  • 79. Dot Matrices • Dot matrices show similarities between two sequences. • FASTA makes an implicit dot matrix from short exact matches, and tries to find long approximate diagonals (allowing for some mismatches).
  • 80. Dot Matrices: Example • Identify diagonals above a threshold length. • Diagonals in the dot matrix indicate exact substring matching.
  • 81. Diagonals in Dot Matrices • Extend diagonals and try to link them together, allowing for minimal mismatches/indels. • Linking exact diagonals reveals approximate matches over longer substrings.
  • 83. Approximate Pattern Matching Problem • Goal: Find all approximate occurrences of a pattern in a text. • Input: A pattern p = p1…pn, text t = t1…tm, and k, the maximum allowable number of mismatches. • Output: All positions 1 < i < (m – n + 1) such that ti…ti+n-1 and p1…pn have at most k mismatches. i.e., HammingDistance(ti…ti+n-1, p) ≤ k.
  • 84. Approximate Pattern Matching: Brute Force ApproximatePatternMatching(p, t, k) 1. n  length of pattern p 2. m  length of text t 3. for i  1 to m – n + 1 4. dist  0 5. for j  1 to n 6. if ti+j-1 ≠ pj 7. dist  dist + 1 8. if dist < k 9. output i
  • 85. Approximate Pattern Matching: Running Time • The brute force algorithm runs in O(mn) time. • Landau-Vishkin algorithm: Gives improvement to O(km). • We will next generalize the ―Approximate Pattern Matching Problem‖ into a ―Query Matching Problem.‖ • Rather than patterns, we want to match substrings in a query to substrings in a text with at most k mismatches. • Motivation: We want to see similarities to some gene, but we may not know which parts of the gene to look for.
  • 86. Section 7: Query Matching and Filtration
  • 87. Query Matching Problem • Goal: Find all substrings of a query that approximately match the text. • Input: Query q = q1…qw Text t = t1…tm, n = length of matching substrings k = maximum number of mismatches • Output: All pairs of positions (i, j) such that the n-letter substring of query q starting at i approximately matches the n- letter substring of text t starting at j, with at most k mismatches.
  • 88. Approximate Pattern Matching vs Query Matching
  • 89. Filtration in Query Matching: Main Idea • Approximately matching strings share some perfectly matching substrings. • Instead of searching for approximately matching strings (difficult) search for perfectly matching substrings (easy).
  • 90. Filtration in Query Matching • We want all n-matches between a query and a text with up to k mismatches. • ―Filter‖ out positions we know do not match between text and query. • Filtration involves two processes: 1. Potential match detection: Find all exact matches of l- tuples in query and text for some small l. 2. Potential match verification: Verify each potential match by extending it to the left and right, until (k + 1) mismatches are found or we have n – k matches.
  • 91. Step 1: Match Detection • If x1…xn and y1…yn match with at most k mismatches, they must share an l-tuple that is perfectly matched, where we have l = n/(k + 1). • Here  j  denotes the largest integer q with q ≤ j • Where does this formula come from? • Break string of length n into k+1 parts, each each of length n/(k + 1) • k mismatches can affect at most k of these k+1 parts. • At least one of these k+1 parts is perfectly matched.
  • 92. Step 1: Match Detection 1…l l +1…2l 2l +1…3l 3l +1…n 1 2 k k + 1 • Suppose k = 3. We would then have l = n / (k+1) =n/4: • There are at most k mismatches in n, so at the very least there must be one out of the k + 1 l-tuples without a mismatch.
  • 93. Step 2: Match Verification Query Extend perfect match of length l until we find an approximate match of length n with k mismatches Text • For each l-match we find, try to extend the match further to see if it is substantial.
  • 94. Filtration: Changing l Changes Performance l -tuple length Shorter perfect matches required Performance decreases  n 2  n  n 3  n 4  n 5  n 6  k  5  k  4  k  3  k  2  k  1  k  0
  • 95. Section 8: Comparing a Sequence Against a Database
  • 96. Local alignment is too slow…               ),( ),( ),( 0 max 1,1 1, ,1 , jiji jji iji ji wvs ws vs s    • Quadratic local alignment is too slow while looking for similarities between long strings (e.g. the entire GenBank database). • Guaranteed to find the optimal local alignment. • Sets the standard for sensitivity.
  • 97. Local alignment is too slow…               ),( ),( ),( 0 max 1,1 1, ,1 , jiji jji iji ji wvs ws vs s    • BLAST: Basic Local Alignment Search Tool • Created in 1990 by Altschul, Gish, Miller, Myers, & Lipman. • Idea: Search sequence databases for local alignments to a query.
  • 98. Features of BLAST • Great improvement in speed, with a modest decrease in sensitivity. • Minimizes search space instead of exploring entire search space between two sequences. • Finds short exact matches (―seeds‖), and only explores locally around these ―hits.‖
  • 100. BLAST Algorithm • Keyword search of all words of length w from a query of length n in database of length m with score above threshold. • w = 11 for DNA queries • w =3 for proteins • Perform local alignment extension for each keyword. • Extend results until longest match above a given threshold is achieved. • Runtime: O(nm)
  • 101. BLAST Algorithm Query: 22 VLRDNIQGITKPAIRRLARRGGVKRISGLIYEETRGVLK 60 +++DN +G + IR L G+K I+ L+ E+ RG++K Sbjct: 226 IIKDNGRGFSGKQIRNLNYGIGLKVIADLV-EKHRGIIK 263 Query: KRHRKVLRDNIQGITKPAIRRLARRGGVKRISGLIYEETRGVLKIFLENVIRD keyword GVK 18 GAK 16 GIK 16 GGK 14 GLK 13 GNK 12 GRK 11 GEK 11 GDK 11 neighborhood score threshold (T = 13) Neighborhood words High-scoring Pair (HSP) extension
  • 102. Original BLAST • Dictionary • All words of length w • Alignment • Ungapped extensions until score falls below some statistical threshold. • Output • All local alignments with score > threshold
  • 103. Original BLAST: Example From lectures by Serafim Batzoglou (Stanford) • w = 4 • Exact keyword match of GGTC A C G A A G T A A G G T C C A G T GATCCTGGATTGCGA
  • 104. Original BLAST: Example • w = 4 • Exact keyword match of GGTC A C G A A G T A A G G T C C A G T GATCCTGGATTGCGA From lectures by Serafim Batzoglou (Stanford)
  • 105. Original BLAST: Example • w = 4 • Exact keyword match of GGTC A C G A A G T A A G G T C C A G T GATCCTGGATTGCGA From lectures by Serafim Batzoglou (Stanford)
  • 106. Original BLAST: Example • w = 4 • Exact keyword match of GGTC • Extend diagonals with mismatches until score is under 50%. A C G A A G T A A G G T C C A G T GATCCTGGATTGCGA From lectures by Serafim Batzoglou (Stanford)
  • 107. Original BLAST: Example • w = 4 • Exact keyword match of GGTC • Extend diagonals with mismatches until score is under 50%. A C G A A G T A A G G T C C A G T GATCCTGGATTGCGA From lectures by Serafim Batzoglou (Stanford)
  • 108. Original BLAST: Example • w = 4 • Exact keyword match of GGTC • Extend diagonals with mismatches until score is under 50%. A C G A A G T A A G G T C C A G T GATCCTGGATTGCGA From lectures by Serafim Batzoglou (Stanford)
  • 109. Original BLAST: Example • w = 4 • Exact keyword match of GGTC • Extend diagonals with mismatches until score is under 50%. A C G A A G T A A G G T C C A G T GATCCTGGATTGCGA From lectures by Serafim Batzoglou (Stanford)
  • 110. Original BLAST: Example • w = 4 • Exact keyword match of GGTC • Extend diagonals with mismatches until score is under 50%. A C G A A G T A A G G T C C A G T GATCCTGGATTGCGA From lectures by Serafim Batzoglou (Stanford)
  • 111. A C G A A G T A A G G T C C A G T Original BLAST: Example GATCCTGGATTGCGA • w = 4 • Exact keyword match of GGTC • Extend diagonals with mismatches until score is under 50%. • Output result: • GTAAGGTCC • GTTAGGTCC From lectures by Serafim Batzoglou (Stanford)
  • 112. Gapped BLAST: Example • Original BLAST exact keyword search, THEN: • Extend with gaps around ends of exact match until score < threshold • Output result GTAAGGTCCAGT GTTAGGTC-AGT A C G A A G T A A G G T C C A G T GATCCTGGATTGCGA From lectures by Serafim Batzoglou (Stanford)
  • 113. Incarnations of BLAST • BLASTN: Nucleotide-nucleotide • BLASTP: Protein-protein • BLASTX: Translated query vs. protein database • TBLASTN: Protein query vs. translated database • TBLASTX: Translated query vs. translated database (6 frames each)
  • 114. Incarnations of BLAST • PSI-BLAST: Find members of a protein family or build a custom position-specific score matrix. • MegaBLAST: Search longer sequences with fewer differences. • WU-BLAST (Wash U BLAST): Optimized, added features.
  • 115. Assessing Sequence Similarity • We need to know how strong an alignment can be expected to be from chance alone. • ―Chance‖ relates to comparison of sequences that are generated randomly based upon a certain sequence model. • Sequence models may take into account: • G+C content • Poly-A tails • ―Junk‖ DNA • Codon bias • Etc.
  • 116. BLAST: Segment Score • BLAST uses scoring matrices (d) to improve on efficiency of match detection. • Some proteins may have very different amino acid sequences, but are still similar. • For any two l-mers x1…xl and y1…yl : • Segment pair: Pair of l-mers, one from each sequence. • Segment score:  d xi, yi i1 l 
  • 117. BLAST: Locally Maximal Segment Pairs • A segment pair is locally maximal if its score can‘t be improved by extending or shortening. • Statistically significant locally maximal segment pairs are of biological interest. • BLAST finds all locally maximal segment pairs with scores above some threshold. • A significantly high threshold will filter out some statistically insignificant matches.
  • 118. BLAST: Statistics • Threshold: Altschul-Dembo-Karlin statistics. • Identifies smallest segment score that is unlikely to happen by chance. • # matches above q has mean E(q) = Kmne-lq; K is a constant, m and n are the lengths of the two compared sequences. • Parameter l is positive root of S x,y in A(pxpyed(x,y)) = 1, where px and py are frequencies of amino acids x and y, and A is the twenty letter amino acid alphabet
  • 119. P-values • The probability of finding b HSPs with a score ≥S is given by: • For b = 0, that chance is: • Thus the probability of finding at least one HSP with a score ≥ S is:  (e  E E b ) b!  e  E P  1  e  E
  • 120. Sample BLAST output Score E Sequences producing significant alignments: (bits) Value gi|18858329|ref|NP_571095.1| ba1 globin [Danio rerio] >gi|147757... 171 3e-44 gi|18858331|ref|NP_571096.1| ba2 globin; SI:dZ118J2.3 [Danio rer... 170 7e-44 gi|37606100|emb|CAE48992.1| SI:bY187G17.6 (novel beta globin) [D... 170 7e-44 gi|31419195|gb|AAH53176.1| Ba1 protein [Danio rerio] 168 3e-43 ALIGNMENTS >gi|18858329|ref|NP_571095.1| ba1 globin [Danio rerio] Length = 148 Score = 171 bits (434), Expect = 3e-44 Identities = 76/148 (51%), Positives = 106/148 (71%), Gaps = 1/148 (0%) Query: 1 MVHLTPEEKSAVTALWGKVNVDEVGGEALGRLLVVYPWTQRFFESFGDLSTPDAVMGNPK 60 MV T E++A+ LWGK+N+DE+G +AL R L+VYPWTQR+F +FG+LS+P A+MGNPK Sbjct: 1 MVEWTDAERTAILGLWGKLNIDEIGPQALSRCLIVYPWTQRYFATFGNLSSPAAIMGNPK 60 Query: 61 VKAHGKKVLGAFSDGLAHLDNLKGTFATLSELHCDKLHVDPENFRLLGNVLVCVLAHHFG 120 V AHG+ V+G + ++DN+K T+A LS +H +KLHVDP+NFRLL + + A FG Sbjct: 61 VAAHGRTVMGGLERAIKNMDNVKNTYAALSVMHSEKLHVDPDNFRLLADCITVCAAMKFG 120 • BLAST of human betaglobin protein against zebra fish:
  • 121. Sample BLAST оutput Score E Sequences producing significant alignments: (bits) Value gi|19849266|gb|AF487523.1| Homo sapiens gamma A hemoglobin (HBG1... 289 1e-75 gi|183868|gb|M11427.1|HUMHBG3E Human gamma-globin mRNA, 3' end 289 1e-75 gi|44887617|gb|AY534688.1| Homo sapiens A-gamma globin (HBG1) ge... 280 1e-72 gi|31726|emb|V00512.1|HSGGL1 Human messenger RNA for gamma-globin 260 1e-66 gi|38683401|ref|NR_001589.1| Homo sapiens hemoglobin, beta pseud... 151 7e-34 gi|18462073|gb|AF339400.1| Homo sapiens haplotype PB26 beta-glob... 149 3e-33 ALIGNMENTS >gi|28380636|ref|NG_000007.3| Homo sapiens beta globin region (HBB@) on chromosome 11 Length = 81706 Score = 149 bits (75), Expect = 3e-33 Identities = 183/219 (83%) Strand = Plus / Plus Query: 267 ttgggagatgccacaaagcacctggatgatctcaagggcacctttgcccagctgagtgaa 326 || ||| | || | || | |||||| ||||| ||||||||||| |||||||| Sbjct: 54409 ttcggaaaagctgttatgctcacggatgacctcaaaggcacctttgctacactgagtgac 54468 • BLAST of human betaglobin protein against zebra fish:
  • 123. Timeline • 1970: Needleman-Wunsch global alignment algorithm • 1981: Smith-Waterman local alignment algorithm • 1985: FASTA • 1990: BLAST (basic local alignment search tool) • 2000s: Faster algorithms evolve for genome/genome: • Pattern Hunter • BLAT
  • 124. BLAT vs. BLAST • BLAT (BLAST-Like Alignment Tool): Same idea as BLAST—locate short sequence hits and extend. • Differences between BLAT and BLAST: • BLAST builds an index of the query sequence and then scans linearly through the database. • BLAT builds an index of the database and scans linearly through the query sequence. • Index is stored in RAM, resulting in faster searches.
  • 125. BLAT: Indexing • An index is built that contains the positions of each k-mer in the genome. • Each k-mer in the query sequence is compared to each k-mer in the index. • A list of ‗hits‘ is generated – matching k-mer positions in cDNA and in genome.
  • 126. • Steps: 1. Break cDNA into 500 base chunks. 2. Use an index to find regions in genome similar to each chunk of cDNA. 3. Construct alignment between genomic regions and cDNA chunks. 4. Use dynamic programming to stitch together alignments of chunks into the alignment of the whole. BLAT: Fast cDNA Alignments
  • 127. Indexing: An Example Position of 3-mer in query, genome • Here is an example with k = 3: Genome: cacaattatcacgaccgc 3-mers (non-overlapping): cac aat tat cac gac cgc Index: aat 3 gac 12 cac 0,9 tat 6 cgc 15 cDNA (query sequence): aattctcac 3-mers (overlapping): aat att ttc tct ctc tca cac 0 1 2 3 4 5 6 Hits: aat 0,3 cac 6,0 cac 6,9 clump: cacAATtatCACgaccgc
  • 128. However… • BLAT was designed to find sequences of 95% and greater similarity of length > 40. • Therefore we may miss more divergent or shorter sequence alignments.
  • 129. PatternHunter: faster and even more sensitive • BLAST: matches short consecutive sequences (consecutive seed) • Length = k • Example (k = 11): 11111111111 • Each 1 represents a ―match.‖ • PatternHunter: matches short non-consecutive sequences (spaced seed). • Increases sensitivity by locating homologies that would otherwise be missed. • Example (a spaced seed of length 18 with 11 matches): 111010010100110111 • Each 0 represents a ―don‘t care‖, so there can be a match or a mismatch.
  • 130. Spaced Seeds • Example of a hit using a spaced seed: • How does this result in better sensitivity?
  • 131. Why is PH Better? • BLAST: redundant hits • This results in > 1 hit and creates clusters of redundant hits. • Example: • PatternHunter: very few redundant hits. • Example:
  • 132. Why is PH Better? GAGTACTCAACACCAACATTAGTGGGCAATGGAAAAT ||||||||||||||||||||||||||||||||||||| GAATACTCAACAGCAACATCAATGGGCAGCAGAAAAT • In this example, despite a clear similarity, there is no sequence of continuous matches longer than length 9. • BLAST uses a length 11 and because of this, BLAST does not recognize this as a hit! • Resolving this would require reducing the seed length to 9, which would have a damaging effect on speed. • Example: 9 matches
  • 133. Advantage of Gapped Seeds 11 positions 11 positions 10 positions
  • 134. Why is PH Better? 1. Higher hit probability. 2. Lower expected number of random hits.
  • 135. Use of Multiple Seeds • Basic Search Algorithm: 1. Select a group of spaced seed models. 2. For each hit of each model, conduct extension to find a homology.
  • 136. PatternHunter and BLAT vs. BLAST • PatternHunter is 5-100 times faster than BLASTN, depending on data size, at the same sensitivity. • BLAT is several times faster than BLAST, but best results are limited to closely related sequences.