CSE 5290: Algorithms for Bioinformatics Fall 2011

Slides:



Advertisements
Similar presentations
Combinatorial Pattern Matching CS 466 Saurabh Sinha.
Advertisements

Fa07CSE 182 CSE182-L4: Database filtering. Fa07CSE 182 Summary (through lecture 3) A2 is online We considered the basics of sequence alignment –Opt score.
Gapped BLAST and PSI-BLAST Altschul et al Presenter: 張耿豪 莊凱翔.
BLAST Sequence alignment, E-value & Extreme value distribution.
1 CAP5510 – Bioinformatics Database Searches for Biological Sequences or Imperfect Alignments Tamer Kahveci CISE Department University of Florida.
Sequence Alignment Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National Taiwan University, Taiwan
Combinatorial Pattern Matching CS 466 Saurabh Sinha.
Combinational Pattern Matching Shashank Kadaveru.
. Class 4: Fast Sequence Alignment. Alignment in Real Life u One of the major uses of alignments is to find sequences in a “database” u Such collections.
Sequence Alignment Storing, retrieving and comparing DNA sequences in Databases. Comparing two or more sequences for similarities. Searching databases.
Heuristic alignment algorithms and cost matrices
Fa05CSE 182 L3: Blast: Keyword match basics. Fa05CSE 182 Silly Quiz TRUE or FALSE: In New York City at any moment, there are 2 people (not bald) with.
Sequence Alignment Variations Computing alignments using only O(m) space rather than O(mn) space. Computing alignments with bounded difference Exclusion.
Combinatorial Pattern Matching
Heuristic Approaches for Sequence Alignments
Bioinformatics Unit 1: Data Bases and Alignments Lecture 3: “Homology” Searches and Sequence Alignments (cont.) The Mechanics of Alignments.
Fa05CSE 182 CSE182-L5: Scoring matrices Dictionary Matching.
Sequence similarity. Motivation Same gene, or similar gene Suffix of A similar to prefix of B? Suffix of A similar to prefix of B..Z? Longest similar.
15-853:Algorithms in the Real World
Sequence alignment, E-value & Extreme value distribution
Heuristic methods for sequence alignment in practice Sushmita Roy BMI/CS 576 Sushmita Roy Sep 27 th,
Space-Efficient Sequence Alignment Space-Efficient Sequence Alignment Bioinformatics 202 University of California, San Diego Lecture Notes No. 7 Dr. Pavel.
BLAST What it does and what it means Steven Slater Adapted from pt.
Gapped BLAST and PSI- BLAST: a new generation of protein database search programs By Stephen F. Altschul, Thomas L. Madden, Alejandro A. Schäffer, Jinghui.
Classifier Evaluation Vasileios Hatzivassiloglou University of Texas at Dallas.
Sequence Alignment Goal: line up two or more sequences An alignment of two amino acid sequences: …. Seq1: HKIYHLQSKVPTFVRMLAPEGALNIHEKAWNAYPYCRTVITN-EYMKEDFLIKIETWHKP.
Computational Biology, Part 9 Efficient database searching methods Robert F. Murphy Copyright  1996, 1999, All rights reserved.
Introduction to Bioinformatics Algorithms BLAST: Basic Local Alignment Search Tool Excerpts by Winfried Just.
COMP3456 – adapted from textbook slides Combinatorial Pattern Matching.
Database Searches BLAST. Basic Local Alignment Search Tool –Altschul, Gish, Miller, Myers, Lipman, J. Mol. Biol. 215 (1990) –Altschul, Madden, Schaffer,
BLAST: Basic Local Alignment Search Tool Altschul et al. J. Mol Bio CS 466 Saurabh Sinha.
Sequence Comparison Algorithms Ellen Walker Bioinformatics Hiram College.
BLAST, which stands for basic local alignment search tool, is a heuristic algorithm that is used to find similar sequences of amino acids or nucleotides.
Pairwise Local Alignment and Database Search Csc 487/687 Computing for Bioinformatics.
Biocomputation: Comparative Genomics Tanya Talkar Lolly Kruse Colleen O’Rourke.
BLAST, which stands for basic local alignment search tool, is a heuristic algorithm that is used to find similar sequences of amino acids or nucleotides.
Heuristic Methods for Sequence Database Searching BMI/CS 576 Colin Dewey Fall 2015.
Sequence Alignment.
Combinatorial Pattern Matching An Introduction to Bioinformatics Algorithms (Jones and Pevzner)
Step 3: Tools Database Searching
Heuristic Methods for Sequence Database Searching BMI/CS 576 Colin Dewey Fall 2010.
Heuristic Alignment Algorithms Hongchao Li Jan
10/30/2012COMP 555 Bioalgorithms (Fall 2012)1 Lecture 16: Combinatorial Pattern Matching Study Chapter 9.1 – 9.5.
Heuristic Methods for Sequence Database Searching BMI/CS 776 Mark Craven February 2002.
9/6/07BCB 444/544 F07 ISU Dobbs - Lab 3 - BLAST1 BCB 444/544 Lab 3 BLAST Scoring Matrices & Alignment Statistics Sept6.
Database Scanning/Searching FASTA/BLAST/PSIBLAST G P S Raghava.
Approximate Match FASTA, BLAST, and friends
Homology Search Tools Kun-Mao Chao (趙坤茂)
Homology Search Tools Kun-Mao Chao (趙坤茂)
13 Text Processing Hongfei Yan June 1, 2016.
Combinatorial Pattern Matching
Local alignment and BLAST
Homology Search Tools Kun-Mao Chao (趙坤茂)
CSE 5290: Algorithms for Bioinformatics Fall 2009
Fast Sequence Alignments
Sequence alignment, Part 2
Combinatorial Pattern Matching
CSE 589 Applied Algorithms Spring 1999
3. Brute Force Selection sort Brute-Force string matching
Hashing Sections 10.2 – 10.3 Lecture 26 CS302 Data Structures
Basic Local Alignment Search Tool (BLAST)
BIOINFORMATICS Fast Alignment
Constructing Probability Matrices
3. Brute Force Selection sort Brute-Force string matching
Basic Local Alignment Search Tool
Basic Local Alignment Search Tool (BLAST)
Homology Search Tools Kun-Mao Chao (趙坤茂)
Sequence alignment, E-value & Extreme value distribution
CSE 5290: Algorithms for Bioinformatics Fall 2009
3. Brute Force Selection sort Brute-Force string matching
Presentation transcript:

CSE 5290: Algorithms for Bioinformatics Fall 2011 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cse.yorku.ca/course/5290 11/30/2018 CSE 5290, Fall 2011

Last time Graph algorithms for sequence assembly Next: Pattern matching The following slides are based on slides by the authors of our text. 11/30/2018 CSE 5290, Fall 2011

Genomic Repeats Example of repeats: ATGGTCTAGGTCCTAGTGGTC Motivation to find them: Genomic rearrangements are often associated with repeats Trace evolutionary secrets Many tumors are characterized by an explosion of repeats 11/30/2018 CSE 5290, Fall 2011

Genomic Repeats The problem is often more difficult: ATGGTCTAGGACCTAGTGTTC Motivation to find them: Genomic rearrangements are often associated with repeats Trace evolutionary secrets Many tumors are characterized by an explosion of repeats 11/30/2018 CSE 5290, Fall 2011

l-mer Repeats Long repeats are difficult to find Short repeats are easy to find (e.g., hashing) Simple approach to finding long repeats: Find exact repeats of short l-mers (l is usually 10 to 13) Use l-mer repeats to potentially extend into longer, maximal repeats 11/30/2018 CSE 5290, Fall 2011

l-mer Repeats (cont’d) There are typically many locations where an l-mer is repeated: GCTTACAGATTCAGTCTTACAGATGGT The 4-mer TTAC starts at locations 3 and 17 11/30/2018 CSE 5290, Fall 2011

Extending l-mer Repeats GCTTACAGATTCAGTCTTACAGATGGT Extend these 4-mer matches: Maximal repeat: TTACAGAT 11/30/2018 CSE 5290, Fall 2011

Maximal Repeats 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 11/30/2018 CSE 5290, Fall 2011

Hashing: What is it? What does hashing do? For different data, generate a unique integer Store data in an array at the unique integer index generated from the data Hashing is a very efficient way to store and retrieve data 11/30/2018 CSE 5290, Fall 2011

Hashing: Definitions Hash table: array used in hashing Records: data stored in a hash table Keys: identifies sets of records Buckets: Hash function: uses a key to generate an index (bucket) to insert at in hash table Collision: when more than one record is mapped to the same index in the hash table 11/30/2018 CSE 5290, Fall 2011

When does hashing work well? When there are few collisions! Good hash functions minimize collisions Problems knowing what function to use What buckets to use 11/30/2018 CSE 5290, Fall 2011

Hashing: Example Where do the animals eat? Records: each animal Keys: where each animal eats 11/30/2018 CSE 5290, Fall 2011

Hashing DNA sequences Each l-mer can be translated into a binary string (A, T, C, G can be represented as 00, 01, 10, 11) After assigning a unique integer per l-mer it is easy to get all start locations of each l-mer in a genome 11/30/2018 CSE 5290, Fall 2011

Hashing: Maximal Repeats To find repeats in a genome: For all l-mers in the genome, note the start position and the sequence Generate a hash table index for each unique l-mer sequence In each index of the hash table, store all genome start locations of the l-mer which generated that index Extend l-mer repeats to maximal repeats 11/30/2018 CSE 5290, Fall 2011

Hashing: Collisions Dealing with collisions: “Chain” all start locations of l-mers (linked list) 11/30/2018 CSE 5290, Fall 2011

Hashing: Summary When finding genomic repeats from l-mers: Generate a hash table index for each l-mer sequence In each index, store all genome start locations of the l-mer which generated that index Extend l-mer repeats to maximal repeats 11/30/2018 CSE 5290, Fall 2011

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 11/30/2018 CSE 5290, Fall 2011

Pattern Matching Problem Goal: Find all occurrences of a pattern in a text Input: Pattern p = p1…pn and text t = t1…tm Output: All positions 1< i < (m – n + 1) such that the n-letter substring of t starting at i matches p Motivation: Searching database for a known pattern 11/30/2018 CSE 5290, Fall 2011

Exact Pattern Matching: A Brute-Force Algorithm PatternMatching(p,t) n  length of pattern p m  length of text t for i  1 to (m – n + 1) if ti…ti+n-1 = p output i 11/30/2018 CSE 5290, Fall 2011

Exact Pattern Matching: An Example PatternMatching algorithm for: Pattern GCAT Text CGCATC GCAT CGCATC GCAT CGCATC GCAT CGCATC GCAT CGCATC GCAT CGCATC 11/30/2018 CSE 5290, Fall 2011

Exact Pattern Matching: Running Time PatternMatching runtime: O(nm) The average case is often O(m) Rarely will there be close to n comparisons in line 4 Better solution: suffix trees Can solve problem in O(m) time Conceptually related to keyword trees 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Example Apple 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Example (cont’d) Apple Apropos 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Example (cont’d) Apple Apropos Banana 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Example (cont’d) Apple Apropos Banana Bandana 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Example (cont’d) Apple Apropos Banana Bandana Orange 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Properties -Stores a set of keywords in a rooted labeled tree Each edge 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 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Threading (cont’d) Thread “appeal” appeal 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Threading (cont’d) Thread “appeal” appeal 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Threading (cont’d) Thread “appeal” appeal 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Threading (cont’d) Thread “appeal” appeal 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Threading (cont’d) Thread “apple” apple 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Threading (cont’d) Thread “apple” apple 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Threading (cont’d) Thread “apple” apple 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Threading (cont’d) Thread “apple” apple 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Threading (cont’d) Thread “apple” apple 11/30/2018 CSE 5290, Fall 2011

Multiple Pattern Matching 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 t = t1…tm Output: Positions 1 < i < m where substring of t starting at i matches pj for 1 < j < k Motivation: Searching database for known multiple patterns 11/30/2018 CSE 5290, Fall 2011

Multiple Pattern Matching: Straightforward Approach Can solve as k “Pattern Matching Problems” Runtime: O(kmn) using the PatternMatching algorithm k times m - length of the text n - average length of the pattern 11/30/2018 CSE 5290, Fall 2011

Multiple Pattern Matching: Keyword Tree Approach Or, we could use keyword trees: Build keyword tree in O(N) time; N is total length of all patterns With naive threading: O(N + nm) Aho-Corasick algorithm: O(N + m) 11/30/2018 CSE 5290, Fall 2011

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 11/30/2018 CSE 5290, Fall 2011

Keyword Trees: Threading (cont’d) Threading is “complete” when we reach a leaf in the keyword tree When threading is “complete,” we’ve found a pattern in the text 11/30/2018 CSE 5290, Fall 2011

Suffix Trees=Collapsed Keyword Trees Similar to keyword trees, except edges that form paths are collapsed Each edge is labeled with a substring of a text All internal edges have at least two outgoing edges Leaves labeled by the index of the pattern. 11/30/2018 CSE 5290, Fall 2011

Suffix Tree of a Text ATCATG TCATG CATG ATG TG G Keyword Tree Suffix trees of a text is constructed for all its suffixes ATCATG TCATG CATG ATG TG G Keyword Tree Suffix Tree 11/30/2018 CSE 5290, Fall 2011

Suffix Tree of a Text ATCATG TCATG CATG ATG TG G Keyword Tree Suffix trees of a text is constructed for all its suffixes ATCATG TCATG CATG ATG TG G Keyword Tree Suffix Tree How much time does it take? 11/30/2018 CSE 5290, Fall 2011

Suffix Tree of a Text ATCATG TCATG CATG ATG TG G Keyword Tree Suffix trees of a text is constructed for all its suffixes ATCATG TCATG CATG ATG TG G Keyword Tree Suffix Tree quadratic Time is linear in the total size of all suffixes, i.e., it is quadratic in the length of the text 11/30/2018 CSE 5290, Fall 2011

Suffix Trees: Advantages Suffix trees of a text is constructed for all its suffixes Suffix trees build faster than keyword trees ATCATG TCATG CATG ATG TG G Keyword Tree Suffix Tree quadratic linear (Weiner suffix tree algorithm) 11/30/2018 CSE 5290, Fall 2011

Use of Suffix Trees Suffix trees hold all suffixes of a text i.e., ATCGC: ATCGC, TCGC, CGC, GC, C Builds in O(m) time for text of length m To find any pattern of length n in a text: Build suffix tree for text Thread the pattern through the suffix tree Can find pattern in text in O(n) time! O(n + m) time for “Pattern Matching Problem” Build suffix tree and lookup pattern 11/30/2018 CSE 5290, Fall 2011

Pattern Matching with Suffix Trees SuffixTreePatternMatching(p,t) Build suffix tree for text t Thread pattern p through suffix tree if threading is complete output positions of all p-matching leaves in the tree else output “Pattern does not appear in text” 11/30/2018 CSE 5290, Fall 2011

Suffix Trees: Example 11/30/2018 CSE 5290, Fall 2011

Multiple Pattern Matching: Summary Keyword and suffix trees are used to find patterns in a text Keyword trees: Build keyword tree of patterns, and thread text through it Suffix trees: Build suffix tree of text, and thread patterns through it 11/30/2018 CSE 5290, Fall 2011

Approximate vs. Exact Pattern Matching So far all we’ve seen exact pattern matching algorithms Usually, because of mutations, it makes much more biological sense to find approximate pattern matches Biologists often use fast heuristic approaches (rather than local alignment) to find approximate matches 11/30/2018 CSE 5290, Fall 2011

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 (i.e., FASTA) 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 11/30/2018 CSE 5290, Fall 2011

Dot Matrices Dot matrices show similarities between two sequences FASTA makes an implicit dot matrix from short exact matches, and tries to find long diagonals (allowing for some mismatches) 11/30/2018 CSE 5290, Fall 2011

Dot Matrices (cont’d) Identify diagonals above a threshold length Diagonals in the dot matrix indicate exact substring matching 11/30/2018 CSE 5290, Fall 2011

Diagonals in Dot Matrices Extend diagonals and try to link them together, allowing for minimal mismatches/indels Linking diagonals reveals approximate matches over longer substrings 11/30/2018 CSE 5290, Fall 2011

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 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., Hamming distance between ti…ti+n-1 and p < k) 11/30/2018 CSE 5290, Fall 2011

Approximate Pattern Matching: A Brute-Force Algorithm ApproximatePatternMatching(p, t, k) n  length of pattern p m  length of text t for i  1 to m – n + 1 dist  0 for j  1 to n if ti+j-1 != pj dist  dist + 1 if dist < k output i 11/30/2018 CSE 5290, Fall 2011

Approximate Pattern Matching: Running Time That algorithm runs in O(nm). Landau-Vishkin algorithm: O(kn) We can generalize the “Approximate Pattern Matching Problem” into a “Query Matching Problem”: 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 11/30/2018 CSE 5290, Fall 2011

Query Matching Problem Goal: Find all substrings of the 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 q starting at i approximately matches the n-letter substring of t starting at j, with at most k mismatches 11/30/2018 CSE 5290, Fall 2011

Approximate Pattern Matching vs Query Matching 11/30/2018 CSE 5290, Fall 2011

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). 11/30/2018 CSE 5290, Fall 2011

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 Potential match detection: find all matches of l-tuples in query and text for some small l Potential match verification: Verify each potential match by extending it to the left and right, until (k + 1) mismatches are found 11/30/2018 CSE 5290, Fall 2011

Filtration: Match Detection If x1…xn and y1…yn match with at most k mismatches, they must share an l-tuple that is perfectly matched, with l = n/(k + 1) 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 11/30/2018 CSE 5290, Fall 2011

Filtration: Match Detection (cont’d) 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 1…l l +1…2l 2l +1…3l 3l +1…n 1 2 k k + 1 11/30/2018 CSE 5290, Fall 2011

Filtration: Match Verification For each l -match we find, try to extend the match further to see if it is substantial Extend perfect match of length l until we find an approximate match of length n with k mismatches query text 11/30/2018 CSE 5290, Fall 2011

Filtration: Example Shorter perfect matches required k = 0 k = 1 k = 2 k = 3 k = 4 k = 5 l -tuple length n n/2 n/3 n/4 n/5 n/6 Shorter perfect matches required Performance decreases 11/30/2018 CSE 5290, Fall 2011

Local alignment is to slow… Quadratic local alignment is too slow while looking for similarities between long strings (e.g. the entire GenBank database) 11/30/2018 CSE 5290, Fall 2011

Local alignment is to slow… Quadratic local alignment is too slow while looking for similarities between long strings (e.g. the entire GenBank database) 11/30/2018 CSE 5290, Fall 2011

Local alignment is to slow… Quadratic local alignment is too slow while looking for similarities between long strings (e.g. the entire GenBank database) 11/30/2018 CSE 5290, Fall 2011

Local alignment is to slow… 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 11/30/2018 CSE 5290, Fall 2011

Local alignment is to slow… Quadratic local alignment is too slow while looking for similarities between long strings (e.g. the entire GenBank database) Basic Local Alignment Search Tool Altschul, S., Gish, W., Miller, W., Myers, E. & Lipman, D.J. Journal of Mol. Biol., 1990 Search sequence databases for local alignments to a query 11/30/2018 CSE 5290, Fall 2011

Next Pattern matching using BLAST Some of the following slides are based on slides by the authors of our text. 11/30/2018 CSE 5290, Fall 2011

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”), only explores locally around these “hits” 1. 11/30/2018 CSE 5290, Fall 2011

What Similarity Reveals BLASTing a new gene Evolutionary relationship Similarity between protein function BLASTing a genome Potential genes 11/30/2018 CSE 5290, Fall 2011

BLAST algorithm Keyword search of all words of length w from the query of length n in database of length m with score above threshold w = 11 for DNA queries, w =3 for proteins Local alignment extension for each found keyword Extend result until longest match above threshold is achieved Running time O(nm) 11/30/2018 CSE 5290, Fall 2011

BLAST algorithm (cont’d) keyword Query: KRHRKVLRDNIQGITKPAIRRLARRGGVKRISGLIYEETRGVLKIFLENVIRD GVK 18 GAK 16 GIK 16 GGK 14 GLK 13 GNK 12 GRK 11 GEK 11 GDK 11 Neighborhood words neighborhood score threshold (T = 13) extension Query: 22 VLRDNIQGITKPAIRRLARRGGVKRISGLIYEETRGVLK 60 +++DN +G + IR L G+K I+ L+ E+ RG++K Sbjct: 226 IIKDNGRGFSGKQIRNLNYGIGLKVIADLV-EKHRGIIK 263 High-scoring Pair (HSP) 11/30/2018 CSE 5290, Fall 2011

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 11/30/2018 CSE 5290, Fall 2011

Original BLAST: Example A C G A A G T A A G G T C C A G T w = 4 Exact keyword match of GGTC Extend diagonals with mismatches until score is under 50% Output result GTAAGGTCC GTTAGGTCC C T G A T C C T G G A T T G C G A 11/30/2018 CSE 5290, Fall 2011 From lectures by Serafim Batzoglou (Stanford)

Gapped BLAST : Example Original BLAST exact keyword search, THEN: A C G A A G T A A G G T C C A G T Original BLAST exact keyword search, THEN: Extend with gaps around ends of exact match until score < threshold Output result GTAAGGTCCAGT GTTAGGTC-AGT C T G A T C C T G G A T T G C G A 11/30/2018 CSE 5290, Fall 2011 From lectures by Serafim Batzoglou (Stanford)

Assessing sequence similarity Need to know how strong an alignment can be expected 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 “Junk” DNA Codon bias Etc. 11/30/2018 CSE 5290, Fall 2011

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: Sli=1 d(xi, yi) 11/30/2018 CSE 5290, Fall 2011

BLAST: Locally Maximal Segment Pairs A segment pair is maximal if it has the best score over all 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 11/30/2018 CSE 5290, Fall 2011

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 11/30/2018 CSE 5290, Fall 2011