An Introduction to Bioinformatics Algorithms www bioalgorithms info
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Graph Algorithms and Fragment Assembly
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Outline • • • Introduction to Graph Theory Eulerian & Hamiltonian Cycle Problems Benzer Experiment and Interval Graphs DNA Sequencing The Shortest Superstring & Traveling Salesman Problems • Sequencing by Hybridization and de Bruijn Graphs • Fragment Assembly and Repeats in DNA • Fragment Assembly Algorithms
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info The Bridge Obsession Problem Find a tour crossing every bridge just once Leonhard Euler, 1735 Bridges of Königsberg
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Eulerian Cycle Problem • Find a cycle that visits every edge exactly once • Linear time More complicated Königsberg
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Hamiltonian Cycle Problem • Find a cycle that visits every vertex exactly once • NP – complete Game invented by Sir William Hamilton in 1857
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Mapping Problems to Graphs • Arthur Cayley studied chemical structures of hydrocarbons in the mid-1800 s • He used trees (acyclic connected graphs) to enumerate structural isomers
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Beginning of Graph Theory in Biology Benzer’s work • Developed deletion mapping • “Proved” linearity of genomes • Demonstrated internal structure of the genome Seymour Benzer, 1950 s
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Viruses Attack Bacteria • Normally bacteriophage T 4 (a virus) kills bacteria • However if T 4 is mutated (e. g. , an important gene is deleted) it gets disabled and loses ability to kill bacteria • Suppose the bacteria is infected with two different mutants each of which is disabled – would the bacteria still survive? • Amazingly, a pair of disable viruses can kill a bacteria even if each of them is disabled. • How can it be explained?
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Benzer’s Experiment • Idea: infect bacteria with pairs of mutant T 4 bacteriophage (virus) • Each T 4 mutant has an unknown interval deleted from its genome • If the two intervals overlap: T 4 pair is missing part of its genome and is disabled – bacteria survive • If the two intervals do not overlap: T 4 pair has its entire genome and is enabled – bacteria die
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Complementation between pairs of mutant T 4 bacteriophages
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Benzer’s Experiment and Graphs • Construct an interval graph: each T 4 mutant is a vertex, place an edge between mutant pairs where bacteria survived (i. e. , the deleted intervals in the pair of mutants overlap) • Interval graph structure reveals whether the T 4 DNA is linear or branched
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Interval Graph: Linear Genome
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Interval Graph: Branched Genome
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Interval Graph: Comparison Linear genome Branched genome
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info DNA Sequencing: History Sanger method (1977): labeled dd. NTPs terminate DNA copying at random points. Gilbert method (1977): chemical method to cleave DNA at specific points (G, G+A, T+C, C). Both methods generate labeled fragments of varying lengths that are further electrophoresed.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Sanger Method: Generating Reads 1. Start at primer (restriction site) 2. Grow DNA chain 3. Include dd. NTPs 4. Stops reaction at all possible points 5. Separate products by length, using gel electrophoresis
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info DNA Sequencing (Shotgun) • Shear DNA into millions of small fragments • Read 500 – 700 nucleotides at a time from the small fragments (by e. g. Sanger method)
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Fragment (or Genome) Assembly • Computational Challenge: Assemble individual short fragments (reads) into a single genomic sequence (“superstring”) • Until late 1990 s the shotgun fragment assembly of human genome was viewed as an intractable problem
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Shortest Superstring Problem • Problem: Given a set of strings, find a shortest string that contains all of them • Input: Strings s 1, s 2, …. , sn • Output: A string s that contains all strings s 1, s 2, …. , sn as substrings, such that the length of s is minimized • Complexity: NP – hard • Note: this formulation does not take into account sequencing errors
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Shortest Superstring Problem: Example
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Reducing SSP to TSP • Define overlap( si, sj ) as the length of the longest (proper) prefix of sj that matches a suffix of si. aaaggcatcaaatctaaaggcatcaaa What is overlap ( si, sj ) for these strings?
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Reducing SSP to TSP • Define overlap( si, sj ) as the length of the longest (proper) prefix of sj that matches a suffix of si. aaaggcatcaaatctaaaggcatcaaa overlap=12
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Reducing SSP to TSP • Define overlap( si, sj ) as the length of the longest (proper) prefix of sj that matches a suffix of si. aaaggcatcaaatctaaaggcatcaaa • Construct a complete graph with n vertices representing the n strings s 1, s 2, …. , sn. • Insert edges of length overlap ( si, sj ) between vertices si and sj. • Find the longest path that visits every vertex exactly once (i. e. , a Hamiltonian path). This is the max Traveling Salesman Problem (TSP), which is also NP – hard.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Reducing SSP to TSP (cont’d)
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info SSP to TSP: An Example S = { ATC, CCA, CAG, TCC, AGT } TSP SSP ATC AGT 0 CCA 1 AGT ATCCAGT 1 1 2 TCC CAG 2 CAG CCA 1 2 TCC ATCCAGT
An Introduction to Bioinformatics Algorithms Approximation Algorithms for SSP www. bioalgorithms. info
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Sequencing by Hybridization (SBH): History • 1988: SBH suggested as an an alternative sequencing method. Nobody believed it will ever work • 1991: Light directed polymer synthesis developed by Steve Fodor and colleagues. • 1994: Affymetrix develops first 64 -kb DNA microarray First microarray prototype (1989) First commercial DNA microarray prototype w/16, 000 features (1994) 500, 000 features per chip (2002)
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info How SBH Works • Attach all possible DNA probes (oligos) 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 DNA fragment (single strand) to the array. • The DNA fragment hybridizes with those probes that are complementary to substrings of length l of the fragment.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info How SBH Works (cont’d) • Using a spectroscopic detector, determine which probes hybridize to the DNA fragment to obtain the l–mer composition of the target DNA fragment. • Apply the combinatorial algorithm (below) to reconstruct the sequence of the target DNA fragment from the l–mer composition.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Hybridization on DNA Array
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info l-mer composition • Spectrum(s, l ) - unordered multiset of all possible (n – l + 1) l-mers in a string s of length n • The order of individual elements in Spectrum(s, l ) does not matter • For s = TATGGTGC all of the following are equivalent representations of Spectrum(s, 3 ): {TAT, ATG, TGG, GGT, GTG, TGC} {ATG, GGT, GTG, TAT, TGC, TGG} {TGG, TGC, TAT, GTG, GGT, ATG}
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info l-mer composition • Spectrum(s, l ) - unordered multiset of all possible (n – l + 1) l-mers in a string s of length n • The order of individual elements in Spectrum(s, l ) does not matter • For s = TATGGTGC all of the following are equivalent representations of Spectrum(s, 3 ): {TAT, ATG, TGG, GGT, GTG, TGC} {ATG, GGT, GTG, TAT, TGC, TGG} {TGG, TGC, TAT, GTG, GGT, ATG} • We usually choose the lexicographically maximal representation as the canonical one.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Different sequences – the same spectrum • Different sequences may have the same spectrum: Spectrum(GTATCT, 2)= Spectrum(GTCTAT, 2)= {AT, CT, GT, TA, TC}
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info The SBH Problem • Goal: Reconstruct a string from its l-mer spectrum (which is a multiset) • Input: A multiset S, representing all l-mers from an (unknown) string s • Output: String s such that Spectrum(s, l ) = S
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info SBH: Hamiltonian Path Approach S = { ATG AGG TGC TCC GTC GGT GCA CAG } H ATG AGG TGC TCC GTC GGT ATGCAGG TC C Path visited every VERTEX once GCA CAG
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info SBH: Hamiltonian Path Approach A more complicated graph: S = { ATG TGC GTG GGC GCA GCG CGT }
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info SBH: Hamiltonian Path Approach S = { ATG TGC GTG GGC GCA GCG CGT } Path 1: ATGCGTGGCA Path 2: ATGGCGTGCA But the problem is NP-complete in general!
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info 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. Multi-edges are allowed. This data structure is now called a de Bruijn graph. GT AT TG CG GC GG CA Path visited every EDGE once
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info SBH: Eulerian Path Approach S = { ATG, TGC, GTG, GGC, GCA, GCG, CGT } may result in two different paths: GT AT TG CG GC GG ATGGCGTGCA GT CA AT TG CG GC GG ATGCGTGGCA CA
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Euler Theorem • A graph is balanced if for every vertex the number of incoming edges equals to the number of outgoing edges: in(v)=out(v) • Theorem: A connected graph is Eulerian (i. e. , contains a Eulerian cycle) if and only if each of its vertices is balanced.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Euler Theorem: Proof • Eulerian → balanced For every edge entering v (incoming edge), there exists an edge leaving v (outgoing edge). Therefore in(v)=out(v) • Balanced → Eulerian ? ? ?
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Algorithm for Constructing an Eulerian Cycle a. Start with an arbitrary vertex v and form an arbitrary cycle with unused edges until a dead end is reached. Since the graph is Eulerian this dead end is necessarily the starting point, i. e. , vertex v.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Algorithm for Constructing an Eulerian Cycle (cont’d) b. If cycle from (a) above is not an Eulerian cycle, it must contain a vertex w, which has untraversed edges. Perform step (a) again, using vertex w as the starting point. Once again, we will end up in the starting vertex w.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Algorithm for Constructing an Eulerian Cycle (cont’d) c. Combine the cycles from (a) and (b) into a single cycle and iterate step (b).
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Euler Theorem: Extension • Theorem: A connected graph has an Eulerian path if and only if it contains two (complementary) semi-balanced vertices and all other vertices are balanced.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Some Difficulties with SBH • Fidelity of Hybridization: difficult to detect differences between probes hybridized with perfect matches and 1 or 2 mismatches • Array Size: Effect of low fidelity can be decreased with longer l-mers, but array size increases exponentially in l. Array size is limited with current technology. • Practicality: SBH is still impractical. As DNA microarray technology improves, SBH may become practical in the future • Practicality again: Although SBH is still impractical, it spearheaded expression analysis and SNP analysis techniques
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Traditional DNA Sequencing DNA Shake DNA fragments (clones) Vector: Circular genome (bacterium, plasmid) + = Insert Known location (restriction site)
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Different Types of Vectors VECTOR Size of insert (bp) Plasmid 2, 000 - 10, 000 Cosmid 40, 000 BAC (Bacterial Artificial Chromosome) 70, 000 - 300, 000 YAC (Yeast Artificial Chromosome) > 300, 000 Not used much recently A physcal map for the clones is built, and then each clone is fragemented again, sequenced by Sanger method, and assembled.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Electrophoresis Diagrams
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Challenges to Reading
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Reading an Electropherogram • Filtering • Smoothening • Correction for length compressions • A method for calling the nucleotides – PHRED
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Shotgun Sequencing genomic segment cut many times at random (Shotgun) ~500 bp Get one or two reads (double barreled) from each fragment
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Fragment (or Genome) Assembly reads Cover region with ~7 -fold redundancy Overlap reads and extend to reconstruct the original genomic region
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Read Coverage C Length of genomic segment: L Number of (sequenced) reads: n Length of each read: l Coverage C=nl/L How much coverage is enough? Lander-Waterman model: Assuming uniform distribution of reads, C=10 results in 1 gapped region per 1, 000 nucleotides
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info 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 Green and blue fragments are interchangeable when assembling repetitive DNA
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Repeat Types • Low-complexity DNA (e. g. , ATATACATA…) • Microsatellite repeats • Transposons/retrotransposons • SINE Short Interspersed Nuclear Elements (e. g. , Alu: ~300 bps long, 106 copies) (a 1…ak)N where k ~ 3 -6 bps (e. g. , CAGCAGTAGCAGCACCAG) • LINE Long Interspersed Nuclear Elements ~500 - 5, 000 bps long, 200, 000 copies • LTR retroposons • Gene families Long Terminal Repeats (~700 bps) at each end genes duplicate & then diverge • Segmental duplications ~very long, very similar copies
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Overlap-Layout-Consensus Assemblers: ARACHNE, PHRAP, CAP, TIGR, CELERA Overlap: find potentially overlapping reads Layout: merge reads into contigs and contigs into supercontigs (scaffolds) Consensus: derive the DNA sequence and correct sequencing errors . . ACGATTACAATAGGTT. .
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Overlap • Find the best match between some suffix of one read and some prefix of another • Due to sequencing errors, we need to use dynamic programming to find the optimal overlap alignment • Apply a fast filtration method to filter out pairs of reads that do not share a significantly long common substring
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Overlapping Reads • Sort all k-mers in reads • Find pairs of reads sharing a k-mer • (k ~ 24) Extend to full alignment – throw away if not >95% similar TACA TAGATTACACAGATTAC T GA || ||||||||| | || TAGT TAGATTACACAGATTAC TAGA
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Overlapping Reads and Repeats • A k-mer that appears N times initiates N 2 comparisons • For an Alu that appears 106 times 1012 comparisons – too much • Solution: Discard all k-mers that appear more than t Coverage (e. g. , t ~ 10)
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info From Overlapping Reads to Layout Create local multiple alignments from the overlapping reads TAGATTACACAGATTACTGA TAG TTACACAGATTATTGA TAGATTACACAGATTACTGA
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Layout • Repeats are a major challenge • Do two aligned fragments really overlap, or are they from two copies of a repeat? • Solution: repeat masking – hide the repeats!!! • But masking results in a high rate of misassembly (up to 20%) • Misassembly means alot more work at the finishing step
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Merge Reads into Contigs repeat region Merge reads up to potential repeat boundaries
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Repeats, Errors and Read Lengths • Repeats shorter than read length are OK • Repeats with more base pair differences than sequencing error rate are OK • To make a smaller portion of the genome appear repetitive, try to: • Increase read length • Decrease sequencing error rate
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Link Contigs into Supercontigs Normal density Too dense: Overcollapsed? Inconsistent links: Overcollapsed?
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Consensus • A consensus sequence is derived from a profile of the assembled fragments • A sufficient number of reads is required to ensure a statistically significant consensus • Reading errors are corrected
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Derive Consensus Sequence TAGATTACACAGATTACTGA TTGATGGCGTAA CTA TAGATTACACAGATTACTGACTTGATGGCGTAAACTA TAG TTACACAGATTATTGACTTCATGGCGTAA CTA TAGATTACACAGATTACTGACTTGATGGGGTAA CTA TAGATTACACAGATTACTGACTTGATGGCGTAA CTA Derive multiple alignment from pairwise read alignments (i. e. , progressive alignment) Derive each consensus base by weighted voting Another approach based on finding a longest path in a DAG is given in the popular assembler Phrap
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info EULER – Yet Another Approach to Fragment Assembly • Traditional “overlap-layout-consensus” technique has a high rate of mis-assembly • EULER uses the Eulerian Path approach borrowed from the SBH problem and a de Bruijn graph constructed from k-mers • Fragment assembly without repeat masking can be done in linear time with a greater accuracy. The approach is popular among NGS assemblers.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Multiple Repeats Repeat 1 Repeat 2 Can be easily constructed with any number of repeats
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Construction of Repeat Graph • Construction of repeat graph from k – mers: emulates an SBH experiment with a huge (virtual) DNA chip. • Breaking reads into k – mers: Transform sequencing data into virtual DNA chip data.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Construction of Repeat Graph (cont’d) • Error correction in reads: “consensus first” approach to fragment assembly. Makes reads (almost) error-free BEFORE the assembly even starts. • Using reads and mate-pairs to simplify the repeat graph (Eulerian Superpath Problem).
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Approaches to Fragment Assembly Find a path visiting every VERTEX exactly once in the OVERLAP graph: Hamiltonian path problem NP-complete: algorithms unknown
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Approaches to Fragment Assembly (cont’d) Find a path visiting every EDGE exactly once in the REPEAT graph: Eulerian path problem Linear time algorithms are known
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Making Repeat Graph Without DNA • Problem: Construct the repeat graph from a collection of reads. ? • Solution: Break the reads into smaller pieces.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Repeat Sequences: Emulating a DNA Chip • Virtual DNA chip allows the biological problem to be solved within the technological constraints.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Repeat Sequences: Emulating a DNA Chip (cont’d) • Reads are constructed from an original sequence in lengths that allow biologists a high level of certainty. • They are then broken again to allow the technology to sequence each within a reasonable array.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Minimizing Errors • If an error exists in one of the 20 -mer reads, the error will be perpetuated among all of the smaller pieces broken from that read.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Minimizing Errors (cont’d) • However, that error will not be present in the other instances of the 20 -mer read. • So it is possible to eliminate most point mutation errors before reconstructing the original sequence.
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info Conclusions • Graph theory is a vital tool for solving biological problems • Wide range of applications, including sequencing, motif finding, protein networks, and many more
An Introduction to Bioinformatics Algorithms www. bioalgorithms. info References • Simons, Robert W. Advanced Molecular Genetics Course, UCLA (2002). http: //www. mimg. ucla. edu/bobs/C 159/Presentations/Benzer. pdf • Batzoglou, S. Computational Genomics Course, Stanford University (2004). http: //www. stanford. edu/class/cs 262/handouts. html
- Slides: 80