graphs and dna sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/lecture9.pdf ·...

35
Graphs and DNA sequencing CS 466 Saurabh Sinha

Upload: others

Post on 17-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Graphs and DNA sequencing

CS 466Saurabh Sinha

Page 2: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Three problems in graph theory

Page 3: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Eulerian Cycle Problem

• Find a cycle thatvisits every edgeexactly once

• Linear time

Page 4: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Hamiltonian Cycle Problem

• Find a cycle thatvisits every vertexexactly once

• NP – complete

Game invented by Sir William Hamilton in 1857

Page 5: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Travelling Salesman Problem• Find the cheapest tour of a given

set of cities

• “Cost” associated with going fromany city to any other city

• Must visit every city exactly once

• NP-complete

Page 6: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

DNA Sequencing

Page 7: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

DNA Sequencing

• Shear DNA intomillions of smallfragments

• Read 500 – 700nucleotides at a timefrom the smallfragments (Sangermethod)

Page 8: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Fragment Assembly

• Computational Challenge: assembleindividual short fragments (reads) into asingle genomic sequence(“superstring”)

Page 9: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Strategies for whole-genomesequencing

1. Hierarchical – Clone-by-clone yeast, worm, humani. Break genome into many long fragmentsii. Map each long fragment onto the genomeiii. Sequence each fragment with shotgun

2. Whole Genome Shotgun fly, human, mouse, rat, fugu

One large shotgun pass on the whole genomeUntil late 1990s the shotgun fragment assembly of human

genome was viewed as intractable problem

Page 10: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Shortest Superstring Problem

• Problem: Given a set of strings, find ashortest string that contains all of them

• Input: Strings s1, s2,…., sn• Output: A string s that contains all

strings s1, s2,…., sn as substrings, suchthat the length of s is minimized

• Complexity: NP – complete

Page 11: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Shortest Superstring Problem: Example

Page 12: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Shortest Superstring Problem

• Can be framed as Travelling SalesmanProblem (TSP):

• Overlap(si,sj) = largest overlap betweensi and sj

• Complete directed graph with verticesfor substrings (si) and edge weightsbeing -overlap(si,sj)

Page 13: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Shortest Superstring Problem

• Doesn’t help to cast this as TSP– TSP is NP-complete

• Early sequencing algorithms used agreedy approach: merge a pair ofstrings with maximum overlap first– Conjectured to have performance

guarantee of 2.

Page 14: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Generating the fragments

+ =

Shake

DNA fragments

VectorCircular genome

(bacterium, plasmid)

Knownlocation(restrictionsite)

Cloning (many many copies)

Page 15: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Different Types of Vectors

> 300,000Not used much

recently

YAC (Yeast ArtificialChromosome)

70,000 - 300,000BAC (Bacterial ArtificialChromosome)

40,000Cosmid

2,000 - 10,000Plasmid

Size of insert(bp)VECTOR

Page 16: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Read Coverage

Length of genomic segment: LNumber of reads: n Coverage C = n l / LLength of each read: l

How much coverage is enough?

Lander-Waterman model:Assuming uniform distribution of reads, C=10 results in 1 gappedregion per 1,000,000 nucleotides

C

Page 17: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Lander-Waterman Model

• Major Assumptions– Reads are randomly distributed in the genome– The number of times a base is sequenced follows

a Poisson distribution

• Implications– G= genome length, L=read length, N = # reads– Mean of Poisson: λ=LN/G (coverage)– % bases not sequenced: p(X=0) =0.0009 = 0.09%– Total gap length: p(X=0)*G

( )!

xe

p X xx

!! "

= = Average times

This model was used to plan the Human Genome Project…

Page 18: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Challenges in Fragment Assembly• Repeats: A major problem for fragment assembly• > 50% of human genome are repeats:

- over 1 million Alu repeats (about 300 bp)- about 200,000 LINE repeats (1000 bp and

longer)Repeat Repeat Repeat

Green and blue fragments are interchangeable when assembling repetitive DNA

Page 19: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Repeat-related problems inassembly

AB C

Overlap information (by comparing reads):A,B;B,C;A,C

Shortest superstring: combine A & C !

Page 20: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Dealing with repeats

• Approach 1: Break genome into largefragments (e.g., 150,000 bp long each),and sequence each separately.

• The number of repeats comes downproportionately (e.g., 30,000 times forhuman genome)

Page 21: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Dealing with repeats• Approach 2: Use “mate-pair” reads• Fragments of length ~ L are selected, and both ends

are sequenced– L >> length of typical repeat

• Reads are now in pairs, separated by approximatelyknown distance (L)

• Both reads of a mate-pair are unlikely to lie in repeatregions

• Using their approximate separation, we can resolveassembly problems

Page 22: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Shotgun Sequencing

cut many times atrandom (Shotgun)

genomic segment

Get one or tworeads from eachsegment

500 bp 500 bp

Page 23: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

A completely different sequencing method:Sequencing by Hybridization

• 1988: SBH suggested as anan alternative sequencingmethod. Nobody believed it willever work

• 1991: Light directed polymersynthesis developed by SteveFodor and colleagues.

• 1994: Affymetrix develops first64-kb DNA microarray

First microarray prototype (1989)

First commercialDNA microarrayprototype w/16,000features (1994)

500,000 featuresper chip (2002)

Page 24: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

How SBH Works• Attach all possible DNA probes of length l to a flat

surface, each probe at a distinct and known location.This set of probes is called the DNA array.

• Apply a solution containing fluorescently labeled DNAfragment to the array.

• The DNA fragment hybridizes with those probes thatare complementary to substrings of length l of thefragment.

Page 25: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

How SBH Works (cont’d)

• Using a spectroscopic detector, determine whichprobes hybridize to the DNA fragment to obtainthe l–mer composition of the target DNAfragment.

• Apply a combinatorial algorithm to reconstructthe sequence of the target DNA fragment fromthe l – mer composition.

Page 26: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

l-mer composition• Spectrum ( s, l ) - unordered multiset of

all possible (n – l + 1) l-mers in a string sof length n

• The order of individual elements inSpectrum ( s, l ) does not matter

Page 27: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

The SBH Problem• Goal: Reconstruct a string from its l-mer

composition

• Input: A set S, representing all l-mers from an(unknown) string s

• Output: String s such that Spectrum(s,l ) = S

Different from the Shortest Superstring Problem

Page 28: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

SBH: Hamiltonian Path Approach

S = { ATG AGG TGC TCC GTC GGT GCA CAG }

Path visited every VERTEX once

ATG AGG TGC TCCH GTC GGT GCA CAG

ATGCAGG TCC

Page 29: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

SBH: Eulerian Path Approach S = { ATG, TGC, GTG, GGC, GCA, GCG, CGT }

Vertices correspond to ( l – 1 ) – mers : { AT, TG, GC, GG, GT, CA, CG }

Edges correspond to l – mers from S

AT

GT CG

CAGCTG

GG Path visited every EDGE once

Page 30: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Euler Theorem

• A graph is balanced if for every vertex thenumber of incoming edges equals to thenumber of outgoing edges:

in(v)=out(v)

• Theorem: A connected graph is Eulerian(has an Eulerian cycle) if and only if each ofits vertices is balanced.

Page 31: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Euler Theorem: Proof

• Eulerian → balanced

for every edge entering v (incoming edge)there exists an edge leaving v (outgoingedge). Therefore

in(v)=out(v)

• Balanced → Eulerian

???

Page 32: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Algorithm for Constructing an Eulerian Cycle

a. Start with an arbitrary vertexv and form an arbitrary cyclewith unused edges until adead end is reached. Sincethe graph is Eulerian thisdead end is necessarily thestarting point, i.e., vertex v.

Page 33: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Algorithm for Constructing an Eulerian Cycle(cont’d)

b. If cycle from (a) is not anEulerian cycle, it mustcontain a vertex w, whichhas untraversed edges.Perform step (a) again,using vertex w as thestarting point. Once again,we will end up in thestarting vertex w.

Page 34: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

Algorithm for Constructing an Eulerian Cycle(cont’d)

c. Combine the cyclesfrom (a) and (b) into asingle cycle and iteratestep (b).

Page 35: Graphs and DNA sequencingveda.cs.uiuc.edu/courses/fa08/cs466/lectures/Lecture9.pdf · 2008-09-25 · Sequencing by Hybridization •1988: SBH suggested as an an alternative sequencing

SBH as Eulerian Path Problem

• A vertex v is “semibalanced” if | in-degree(v) - out-degree(v)| = 1

• If a graph has an Eulerian path starting from s andending at t, then all its vertices are balanced with thepossible exception of s and t

• Add an edge between two semibalanced vertices:now all vertices should be balanced (assuming therewas an Eulerian path to begin with). Find the Euleriancycle, and remove the edge you had added. You nowhave the Eulerian path you wanted.