Minimum Edit Distance. Defini'on of Minimum Edit Distance

Similar documents
Dynamic Programming. Lecture Overview Introduction

How To Use A Webmail On A Pc Or Macodeo.Com

Human Genome Sequencing Project: What Did We Learn? How to Analyze Your Own Genome Fall 2013

Sequence Alignment and Dynamic Programming

Network Protocol Analysis using Bioinformatics Algorithms

Pairwise Sequence Alignment

Nodes, Ties and Influence

High Performance Compu2ng Facility

ANALYTICAL TECHNIQUES FOR DATA VISUALIZATION

Hidden Markov Models in Bioinformatics. By Máthé Zoltán Kőrösi Zoltán 2006

Seman&c Web: Benefits For Clinical Decision Support At The Bedside. Emory Fry, MD SemTechBiz 2013

Data Warehousing. Yeow Wei Choong Anne Laurent

Biological Sequence Data Formats

Social Media Analy.cs (SMA)

Data Integra*on in a Networked World. Karl Aberer EPFL karl.aberer@epfl.ch h@p://lsir.epfl.ch/ h@p://

Web Services and Development of Semantic Applications

The Chinese University of Hong Kong igem 2010 Bacterial based storage and encryp2on device

Scheduling Shop Scheduling. Tim Nieberg

Chapter 2. imapper: A web server for the automated analysis and mapping of insertional mutagenesis sequence data against Ensembl genomes

5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

Add page numbers and headers and footers by using the gallery, or create a custom page number, header, or footer.

Big Data in medical image processing

XML, Seman9c Web and Content Analy9cs

DNA Sequencing Overview

Layout Design Post Woods Apartment Complex

Pa8ern Recogni6on. and Machine Learning. Chapter 4: Linear Models for Classifica6on

Approximation Algorithms

1 Solving LPs: The Simplex Algorithm of George Dantzig

Arithmetic Coding: Introduction

Founda'onal IT Governance A Founda'onal Framework for Governing Enterprise IT Adapted from the ISACA COBIT 5 Framework

Non-Cooperative Computation Offloading in Mobile Cloud Computing

Several Views of Support Vector Machines

Rapid alignment methods: FASTA and BLAST. p The biological problem p Search strategies p FASTA p BLAST

HIV NOMOGRAM USING BIG DATA ANALYTICS

Topic Extrac,on from Online Reviews for Classifica,on and Recommenda,on (2013) R. Dong, M. Schaal, M. P. O Mahony, B. Smyth

Distributed systems Lecture 6: Elec3ons, consensus, and distributed transac3ons. Dr Robert N. M. Watson

Announcements. HW due today, 2 to grade this week Welcome back from Spring Break!

ECBDL 14: Evolu/onary Computa/on for Big Data and Big Learning Workshop July 13 th, 2014 Big Data Compe//on

1 Review of Newton Polynomials

Data Warehousing. Jens Teubner, TU Dortmund Winter 2014/15. Jens Teubner Data Warehousing Winter 2014/15 1

CS 5614: (Big) Data Management Systems. B. Aditya Prakash Lecture #18: Dimensionality Reduc7on

Dynamic Programming Problem Set Partial Solution CMPSC 465

Processing of Mix- Sensi0vity Video Surveillance Streams on Hybrid Clouds

Keeping Pace with Big Data

THREE DIMENSIONAL REPRESENTATION OF AMINO ACID CHARAC- TERISTICS

Ins+tuto Superior Técnico Technical University of Lisbon. Big Data. Bruno Lopes Catarina Moreira João Pinho

agucacaaacgcu agugcuaguuua uaugcagucuua

Primes in Sequences. Lee 1. By: Jae Young Lee. Project for MA 341 (Number Theory) Boston University Summer Term I 2009 Instructor: Kalin Kostadinov

So#ware quality assurance - introduc4on. Dr Ana Magazinius

A Publication of FastSpring. FastSpring. Advertiser. QuickStart Guide. Ten Steps to Get Up and Running Quickly in the FastSpring Affiliate Program

BLAST. Anders Gorm Pedersen & Rasmus Wernersson

Matrix-Chain Multiplication

IMBB Genomic DNA purifica8on

Q&As: Microsoft Excel 2013: Chapter 2

Suppor&ng the Design of Safety Cri&cal Systems Using AADL

Guidelines for Establishment of Contract Areas Computer Science Department

NCDS Leadership Summit " The Friday Center" Chapel Hill, North Carolina" April 23 & 24, 2013!

Components of Technology Suppor4ng Data Intensive Research

Solutions to Homework 6

Ohio University Computer Services Center August, 2002 Crystal Reports Introduction Quick Reference Guide

A COMPARISON OF COMPUTATION TECHNIQUES FOR DNA SEQUENCE COMPARISON

Using MS Excel to Analyze Data: A Tutorial

Getting Started on the Computer With Mouseaerobics! Windows XP

Searching Nucleotide Databases

Lecture 4: Exact string searching algorithms. Exact string search algorithms. Definitions. Exact string searching or matching

Dynamic programming. Chapter Shortest paths in dags, revisited S C A B D E

CHAPTER 1. Basic Concepts on Planning and Scheduling

HIPAA Basics. Health Insurance Portability and Accountability Act of 1996

Distributed Data Management Summer Semester 2013 TU Kaiserslautern

Version 5.0 Release Notes

Update on the Cloud Demonstration Project

Alessandro Laio, Maria d Errico and Alex Rodriguez SISSA (Trieste)

Scalable Mul*- Class Traffic Management in Data Center Backbone Networks

Help Framework. Ticket Management Ticket Resolu/on Communica/ons. Ticket Assignment Follow up Customer - communica/on System updates Delay management

A greedy algorithm for the DNA sequencing by hybridization with positive and negative errors and information about repetitions

Software Pipelining - Modulo Scheduling

Closest Pair Problem

Determina)on of MDF fiber size distribu)on: Requirements and innova)ve solu)on

Top Practices in Health IT Compliance. Data Breach & Leading Program Prac3ces

Connec(ng to the NC Educa(on Cloud

Software Getting Started Guide

Project II Using Body Temperature to Estimate Time Since Death

Database Security. Sarajane Marques Peres, Ph.D. University of São Paulo

benefit of virtualiza/on? Virtualiza/on An interpreter may not work! Requirements for Virtualiza/on 1/06/15 Which of the following is not a poten/al

I use several different introductions when it comes to calling purchased leads or leads that I have generated on my own through different ads.

Purdue University Writing Lab Indiana Department of Transportation Workshop Series Dr. David Blakesley, Allen Brizee

Focusing on results not data comprehensive data analysis for targeted next generation sequencing

SEO AND CONTENT MANAGEMENT SYSTEM

Microsoft PowerPoint 2010 Computer Jeopardy Tutorial

Business Analysis Standardization A Strategic Mandate. John E. Parker CVO, Enfocus Solu7ons Inc.

TOOLS FOR T-RFLP DATA ANALYSIS USING EXCEL

Using Formulas, Functions, and Data Analysis Tools Excel 2010 Tutorial

Appendix A Keyboard Shortcuts

Automatic Labeling of Lane Markings for Autonomous Vehicles

4 UNIT FOUR: Transportation and Assignment problems

Lecture 3. Linear Programming. 3B1B Optimization Michaelmas 2015 A. Zisserman. Extreme solutions. Simplex method. Interior point method

Mega Modeling for Scien/fic Big Data Processing

Working with AppleScript

When you install Mascot, it includes a copy of the Swiss-Prot protein database. However, it is almost certain that you and your colleagues will want

Which Soft? Decision Support Software

Transcription:

Minimum Edit Distance Defini'on of Minimum Edit Distance

How similar are two strings? Spell correc'on The user typed graffe Which is closest? graf grab grail giraffe Computa'onal Biology Align two sequences of nucleo'des AGGCTATCACCTGACCTCCAGGCCGATGCCC TAGCTATCACGACCGCGGTCGATTTGCCCGAC Resul'ng alignment: -AGGCTATCACCTGACCTCCAGGCCGA--TGCCC--- TAG-CTATCAC--GACCGC--GGTCGATTTGCCCGAC Also for Machine Transla'on, Informa'on Extrac'on, Speech Recogni'on

Edit Distance The minimum edit distance between two strings Is the minimum number of edi'ng opera'ons Inser'on Dele'on Subs'tu'on Needed to transform one into the other

Minimum Edit Distance Two strings and their alignment:

Minimum Edit Distance If each opera'on has cost of 1 Distance between these is 5 If subs'tu'ons cost 2 (Levenshtein) Distance between them is 8

Alignment in Computa9onal Biology Given a sequence of bases An alignment: AGGCTATCACCTGACCTCCAGGCCGATGCCC TAGCTATCACGACCGCGGTCGATTTGCCCGAC -AGGCTATCACCTGACCTCCAGGCCGA--TGCCC--- TAG-CTATCAC--GACCGC--GGTCGATTTGCCCGAC Given two sequences, align each lexer to a lexer or gap

Other uses of Edit Distance in NLP Evalua'ng Machine Transla'on and speech recogni'on R Spokesman confirms senior government adviser was shot! H Spokesman said the senior adviser was shot dead! S I D I! Named En'ty Extrac'on and En'ty Coreference IBM Inc. announced today IBM profits Stanford President John Hennessy announced yesterday for Stanford University President John Hennessy

How to find the Min Edit Distance? Searching for a path (sequence of edits) from the start string to the final string: Ini9al state: the word we re transforming Operators: insert, delete, subs'tute Goal state: the word we re trying to get to Path cost: what we want to minimize: the number of edits 8

Minimum Edit as Search But the space of all edit sequences is huge! We can t afford to navigate naïvely Lots of dis'nct paths wind up at the same state. We don t have to keep track of all of them Just the shortest path to each of those revisted states. 9

Defining Min Edit Distance For two strings X of length n Y of length m We define D(i,j) the edit distance between X[1..i] and Y[1..j] i.e., the first i characters of X and the first j characters of Y The edit distance between X and Y is thus D(n,m)

Minimum Edit Distance Defini'on of Minimum Edit Distance

Minimum Edit Distance Compu'ng Minimum Edit Distance

Dynamic Programming for Minimum Edit Distance Dynamic programming: A tabular computa'on of D(n,m) Solving problems by combining solu'ons to subproblems. BoXom- up We compute D(i,j) for small i,j And compute larger D(i,j) based on previously computed smaller values i.e., compute D(i,j) for all i (0 < i < n) and j (0 < j < m)

Ini'aliza'on D(i,0) = i! D(0,j) = j Defining Min Edit Distance (Levenshtein) Recurrence Rela'on: For each i = 1 M!! For each j = 1 N D(i-1,j) + 1! Termina'on: D(N,M) is distance! D(i,j)= min D(i,j-1) + 1! D(i-1,j-1) + 2; if X(i) Y(j)! 0; if X(i) = Y(j)!

The Edit Distance Table N 9 O 8 I 7 T 6 N 5 E 4 T 3 N 2 I 1 # 0 1 2 3 4 5 6 7 8 9 # E X E C U T I O N

The Edit Distance Table N 9 O 8 I 7 T 6 N 5 E 4 T 3 N 2 I 1 # 0 1 2 3 4 5 6 7 8 9 # E X E C U T I O N

Edit Distance N 9 O 8 I 7 T 6 N 5 E 4 T 3 N 2 I 1 # 0 1 2 3 4 5 6 7 8 9 # E X E C U T I O N

The Edit Distance Table N 9 8 9 10 11 12 11 10 9 8 O 8 7 8 9 10 11 10 9 8 9 I 7 6 7 8 9 10 9 8 9 10 T 6 5 6 7 8 9 8 9 10 11 N 5 4 5 6 7 8 9 10 11 10 E 4 3 4 5 6 7 8 9 10 9 T 3 4 5 6 7 8 7 8 9 8 N 2 3 4 5 6 7 8 7 8 7 I 1 2 3 4 5 6 7 6 7 8 # 0 1 2 3 4 5 6 7 8 9 # E X E C U T I O N

Minimum Edit Distance Compu'ng Minimum Edit Distance

Minimum Edit Distance Backtrace for Compu'ng Alignments

Compu9ng alignments Edit distance isn t sufficient We oben need to align each character of the two strings to each other We do this by keeping a backtrace Every 'me we enter a cell, remember where we came from When we reach the end, Trace back the path from the upper right corner to read off the alignment

Edit Distance N 9 O 8 I 7 T 6 N 5 E 4 T 3 N 2 I 1 # 0 1 2 3 4 5 6 7 8 9 # E X E C U T I O N

MinEdit with Backtrace

Adding Backtrace to Minimum Edit Distance Base condi'ons: Termina'on: D(i,0) = i D(0,j) = j D(N,M) is distance Recurrence Rela'on: For each i = 1 M!! For each j = 1 N! D(i-1,j) + 1! D(i,j)= min D(i,j-1) + 1! dele'on inser'on D(i-1,j-1) + 2; if X(i) Y(j) subs'tu'on! 0; if X(i) = Y(j)! LEFT! inser'on ptr(i,j)= DOWN! DIAG! dele'on subs'tu'on

The Distance Matrix Every non- decreasing path from (0,0) to (M, N) corresponds to an alignment of the two sequences Slide adapted from Serafim Batzoglou

Result of Backtrace Two strings and their alignment:

Performance Time: Space: Backtrace O(nm) O(nm) O(n+m)

Minimum Edit Distance Backtrace for Compu'ng Alignments

Minimum Edit Distance Weighted Minimum Edit Distance

Weighted Edit Distance Why would we add weights to the computa'on? Spell Correc'on: some lexers are more likely to be mistyped than others Biology: certain kinds of dele'ons or inser'ons are more likely than others

Confusion matrix for spelling errors

Ini'aliza'on: D(0,0) = 0! Weighted Min Edit Distance D(i,0) = D(i-1,0) + del[x(i)]; 1 < i N! D(0,j) = D(0,j-1) + ins[y(j)]; Recurrence Rela'on: D(i-1,j) D(i,j)= min D(i,j-1) Termina'on: D(N,M) is distance! + del[x(i)]! + ins[y(j)]! 1 < j M D(i-1,j-1) + sub[x(i),y(j)]!

Where did the name, dynamic programming, come from? The 1950s were not good years for mathematical research. [the] Secretary of Defense had a pathological fear and hatred of the word, research I decided therefore to use the word, programming. I wanted to get across the idea that this was dynamic, this was multistage I thought, let s take a word that has an absolutely precise meaning, namely dynamic it s impossible to use the word, dynamic, in a pejorative sense. Try thinking of some combination that will possibly give it a pejorative meaning. It s impossible. Thus, I thought dynamic programming was a good name. It was something not even a Congressman could object to. Richard Bellman, Eye of the Hurricane: an autobiography 1984.

Minimum Edit Distance Weighted Minimum Edit Distance

Minimum Edit Distance Minimum Edit Distance in Computa'onal Biology

Sequence Alignment AGGCTATCACCTGACCTCCAGGCCGATGCCC TAGCTATCACGACCGCGGTCGATTTGCCCGAC -AGGCTATCACCTGACCTCCAGGCCGA--TGCCC--- TAG-CTATCAC--GACCGC--GGTCGATTTGCCCGAC

Why sequence alignment? Comparing genes or regions from different species to find important regions determine func'on uncover evolu'onary forces Assembling fragments to sequence DNA Compare individuals to looking for muta'ons

Alignments in two fields In Natural Language Processing We generally talk about distance (minimized) And weights In Computa'onal Biology We generally talk about similarity (maximized) And scores

The Needleman- Wunsch Algorithm Ini'aliza'on: D(i,0) = -i * d! D(0,j) = -j * d Recurrence Rela'on: D(i-1,j) - d! D(i,j)= min D(i,j-1) - d! Termina'on: D(N,M) is distance!! D(i-1,j-1) + s[x(i),y(j)]!

The Needleman- Wunsch Matrix (Note that the origin is at the upper leb.) Slide adapted from Serafim Batzoglou

A variant of the basic algorithm: Maybe it is OK to have an unlimited # of gaps in the beginning and end: ----------CTATCACCTGACCTCCAGGCCGATGCCCCTTCCGGC GCGAGTTCATCTATCAC--GACCGC--GGTCG-------------- If so, we don t want to penalize gaps at the ends Slide from Serafim Batzoglou

Different types of overlaps Example: 2 overlapping reads from a sequencing project Example: Search for a mouse gene within a human chromosome Slide from Serafim Batzoglou

The Overlap Detec9on variant Slide from Serafim Batzoglou Changes: 1. Ini'aliza'on For all i, j,!!f(i, 0) = 0!!F(0, j) = 0! 2. Termina'on! max i F(i, N)! F OPT = max!! max j F(M, j)!

The Local Alignment Problem Given two strings x = x 1 x M, y = y 1 y N Find substrings x, y whose similarity (op'mal global alignment value) is maximum x = aaaacccccggggxa y = Xcccgggaaccaacc Slide from Serafim Batzoglou

The Smith- Waterman algorithm Idea: Ignore badly aligning regions Modifica'ons to Needleman- Wunsch: Ini9aliza9on: F(0, j) = 0!!!!F(i, 0) = 0! 0!! Itera9on: F(i, j) = max F(i 1, j) d!!!!! F(i, j 1) d!!!!! F(i 1, j 1) + s(x i, y j )! Slide from Serafim Batzoglou

The Smith- Waterman algorithm Termina9on: 1. If we want the best local alignment Find F OPT and trace back F OPT = max i,j F(i, j) 2. If we want all local alignments scoring > t?? For all i, j find F(i, j) > t, and trace back? Complicated by overlapping local alignments Slide from Serafim Batzoglou

Local alignment example X = ATCAT! Y = ATTATC! Let: m = 1 (1 point for match) d = 1 (- 1 point for del/ins/sub) A! T! T! A! T! C! 0! 0! 0! 0! 0! 0! 0! A! 0! T! 0! C! 0! A! 0! T! 0!

Local alignment example X = ATCAT! Y = ATTATC! A! T! T! A! T! C! 0! 0! 0! 0! 0! 0! 0! A! 0! 1! 0! 0! 1! 0! 0! T! 0! 0! 2! 1! 0! 2! 0! C! 0! 0! 1! 1! 0! 1! 3! A! 0! 1! 0! 0! 2! 1! 2! T! 0! 0! 2! 0! 1! 3! 2!

Local alignment example X = ATCAT! Y = ATTATC! A! T! T! A! T! C! 0! 0! 0! 0! 0! 0! 0! A! 0! 1! 0! 0! 1! 0! 0! T! 0! 0! 2! 1! 0! 2! 0! C! 0! 0! 1! 1! 0! 1! 3! A! 0! 1! 0! 0! 2! 1! 2! T! 0! 0! 2! 0! 1! 3! 2!

Local alignment example X = ATCAT! Y = ATTATC! A! T! T! A! T! C! 0! 0! 0! 0! 0! 0! 0! A! 0! 1! 0! 0! 1! 0! 0! T! 0! 0! 2! 1! 0! 2! 0! C! 0! 0! 1! 1! 0! 1! 3! A! 0! 1! 0! 0! 2! 1! 2! T! 0! 0! 2! 0! 1! 3! 2!

Minimum Edit Distance Minimum Edit Distance in Computa'onal Biology