Connection Between Alignment and HMMs. A state model for alignment -AGGCTATCACCTGACCTCCAGGCCGA--TGCCC--- TAG-CTATCAC--GACCGC-GGTCGATTTGCCCGACC IMMJMMMMMMMJJMMMMMMJMMMMMMMIIMMMMMIII.

Slides:



Advertisements
Similar presentations
Lecture 6, Thursday April 17, 2003
Advertisements

Hidden Markov Models. Two learning scenarios 1.Estimation when the “right answer” is known Examples: GIVEN:a genomic region x = x 1 …x 1,000,000 where.
Computational Genomics Lecture 1, Tuesday April 1, 2003.
DNA Sequencing Lecture 9, Tuesday April 29, 2003.
Hidden Markov Models 1 2 K … 1 2 K … 1 2 K … … … … 1 2 K … x1x1 x2x2 x3x3 xKxK 2 1 K 2.
Physical Mapping I CIS 667 February 26, Physical Mapping A physical map of a piece of DNA tells us the location of certain markers  A marker is.
DNA Sequencing. The Walking Method 1.Build a very redundant library of BACs with sequenced clone- ends (cheap to build) 2.Sequence some “seed” clones.
DNA Sequencing Some Terminology insert a fragment that was incorporated in a circular genome, and can be copied (cloned) vector the circular genome (host)
DNA Sequencing.
DNA Sequencing. CS273a Lecture 3, Spring 07, Batzoglou DNA sequencing How we obtain the sequence of nucleotides of a species …ACGTGACTGAGGACCGTG CGACTGAGACTGACTGGGT.
DNA Sequencing. Next few topics DNA Sequencing  Sequencing strategies Hierarchical Online (Walking) Whole Genome Shotgun  Sequencing Assembly Gene Recognition.
DNA Sequencing and Assembly
DNA Sequencing.
Lecture 9 Hidden Markov Models BioE 480 Sept 21, 2004.
Hidden Markov Models 1 2 K … x1 x2 x3 xK.
DNA Sequencing. CS262 Lecture 9, Win07, Batzoglou DNA sequencing How we obtain the sequence of nucleotides of a species …ACGTGACTGAGGACCGTG CGACTGAGACTGACTGGGT.
CS273a Lecture 4, Autumn 08, Batzoglou Hierarchical Sequencing.
Proteins, Pair HMMs, and Alignment. CS262 Lecture 8, Win06, Batzoglou A state model for alignment -AGGCTATCACCTGACCTCCAGGCCGA--TGCCC--- TAG-CTATCAC--GACCGC-GGTCGATTTGCCCGACC.
DNA Sequencing and Assembly. DNA sequencing How we obtain the sequence of nucleotides of a species …ACGTGACTGAGGACCGTG CGACTGAGACTGACTGGGT CTAGCTAGACTACGTTTTA.
Hidden Markov Models 1 2 K … 1 2 K … 1 2 K … … … … 1 2 K … x1x1 x2x2 x3x3 xKxK 2 1 K 2.
DNA Sequencing.
DNA Sequencing. DNA sequencing How we obtain the sequence of nucleotides of a species …ACGTGACTGAGGACCGTG CGACTGAGACTGACTGGGT CTAGCTAGACTACGTTTTA TATATATATACGTCGTCGT.
Conditional Random Fields 1 2 K … 1 2 K … 1 2 K … … … … 1 2 K … x1x1 x2x2 x3x3 xKxK 2 1 K 2.
DNA Sequencing. CS262 Lecture 9, Win06, Batzoglou DNA Sequencing – gel electrophoresis 1.Start at primer(restriction site) 2.Grow DNA chain 3.Include.
DNA Sequencing. CS262 Lecture 9, Win06, Batzoglou DNA sequencing How we obtain the sequence of nucleotides of a species …ACGTGACTGAGGACCGTG CGACTGAGACTGACTGGGT.
CS273a Lecture 1, Autumn 10, Batzoglou DNA Sequencing.
CS273a Lecture 2, Autumn 10, Batzoglou DNA Sequencing (cont.)
DNA Sequencing. CS273a Lecture 3, Autumn 08, Batzoglou DNA sequencing How we obtain the sequence of nucleotides of a species …ACGTGACTGAGGACCGTG CGACTGAGACTGACTGGGT.
Computational Genomics Lecture 1, Tuesday April 1, 2003.
CS273a Lecture 4, Autumn 08, Batzoglou DNA Sequencing.
Bioinformatics Unit 1: Data Bases and Alignments Lecture 3: “Homology” Searches and Sequence Alignments (cont.) The Mechanics of Alignments.
DNA Sequencing. Next few topics DNA Sequencing  Sequencing strategies Hierarchical Online (Walking) Whole Genome Shotgun  Sequencing Assembly Gene Recognition.
Genome sequencing and assembling
Variants of HMMs. Higher-order HMMs How do we model “memory” larger than one time point? P(  i+1 = l |  i = k)a kl P(  i+1 = l |  i = k,  i -1 =
Genome sequencing. Vocabulary Bac: Bacterial Artificial Chromosome: cloning vector for yeast Pac, cosmid, fosmid, plasmid: cloning vectors for E. coli.
Basic Molecular Biology Many slides by Omkar Deshpande.
Mouse Genome Sequencing
Graphs and DNA sequencing CS 466 Saurabh Sinha. Three problems in graph theory.
Scoring Matrices Scoring matrices, PSSMs, and HMMs BIO520 BioinformaticsJim Lund Reading: Ch 6.1.
Genome sequencing Haixu Tang School of Informatics.
Motif finding with Gibbs sampling CS 466 Saurabh Sinha.
Biological Motivation for Fragment Assembly Rhys Price Jones Anne R. Haake.
A Sequenciação em Análises Clínicas Polymerase Chain Reaction.
JM - 1 Introduction to Bioinformatics: Lecture III Genome Assembly and String Matching Jarek Meller Jarek Meller Division of Biomedical.
CS5263 Bioinformatics Lecture 20 Practical issues in motif finding Final project.
HMMs for alignments & Sequence pattern discovery I519 Introduction to Bioinformatics.
Linkage and Mapping. Figure 4-8 For linked genes, recombinant frequencies are less than 50 percent.
Human Genome.
PCR AND DNA SEQUENCING MBG-487 Işık G. Yuluğ.
DNA Sequencing.
Construction of Substitution matrices
Genomics Part 1. Human Genome Project  G oal is to identify the DNA sequence of every gene in humans Genome  all the DNA in one cell of an organism.
Whole Genome Sequencing (Lecture for CS498-CXZ Algorithms in Bioinformatics) Sept. 13, 2005 ChengXiang Zhai Department of Computer Science University of.
V diagonal lines give equivalent residues ILS TRIVHVNSILPSTN V I L S T R I V I L P E F S T Sequence A Sequence B Dot Plots, Path Matrices, Score Matrices.
V diagonal lines give equivalent residues ILS TRIVHVNSILPSTN V I L S T R I V I L P E F S T Sequence A Sequence B Dot Plots, Path Matrices, Score Matrices.
Genome Analysis. This involves finding out the: order of the bases in the DNA location of genes parts of the DNA that controls the activity of the genes.
More on HMMs and Multiple Sequence Alignment BMI/CS 776 Mark Craven March 2002.
4.2 - Algorithms Sébastien Lemieux Elitra Canada Ltd.
Title: Studying whole genomes Homework: learning package 14 for Thursday 21 June 2016.
Cse587A/Bio 5747: L2 1/19/06 1 DNA sequencing: Basic idea Background: test tube DNA synthesis DNA polymerase (a natural enzyme) extends 2-stranded DNA.
9/6/07BCB 444/544 F07 ISU Dobbs - Lab 3 - BLAST1 BCB 444/544 Lab 3 BLAST Scoring Matrices & Alignment Statistics Sept6.
Virginia Commonwealth University
DNA Sequencing Project
Ab initio gene prediction
Bioinformatics: Buzzword or Discipline (???)
DNA and the Genome Key Area 8a Genomic Sequencing.
A Sequenciação em Análises Clínicas
Variants of HMMs.
Introduction to Sequencing
Fragment Assembly 7/30/2019.
Presentation transcript:

Connection Between Alignment and HMMs

A state model for alignment -AGGCTATCACCTGACCTCCAGGCCGA--TGCCC--- TAG-CTATCAC--GACCGC-GGTCGATTTGCCCGACC IMMJMMMMMMMJJMMMMMMJMMMMMMMIIMMMMMIII M (+1,+1) I (+1, 0) J (0, +1) Alignments correspond 1-to-1 with sequences of states M, I, J

Let’s score the transitions -AGGCTATCACCTGACCTCCAGGCCGA--TGCCC--- TAG-CTATCAC--GACCGC-GGTCGATTTGCCCGACC IMMJMMMMMMMJJMMMMMMJMMMMMMMIIMMMMMIII M (+1,+1) I (+1, 0) J (0, +1) Alignments correspond 1-to-1 with sequences of states M, I, J s(x i, y j ) -d -e

How do we find optimal alignment according to this model? Dynamic Programming: M(i, j):Optimal alignment of x 1 …x i to y 1 …y j ending in M I(i, j): Optimal alignment of x 1 …x i to y 1 …y j ending in I J(i, j): Optimal alignment of x 1 …x i to y 1 …y j ending in J The score is additive, therefore we can apply DP recurrence formulas

Needleman Wunsch with affine gaps – state version Initialization: M(0,0) = 0; M(i,0) = M(0,j) = - , for i, j > 0 I(i,0) = d + i  e;J(0,j) = d + j  e Iteration: M(i – 1, j – 1) M(i, j) = s(x i, y j ) + max I(i – 1, j – 1) J(i – 1, j – 1) e + I(i – 1, j) I(i, j) = maxe + J(i, j – 1) d + M(i – 1, j – 1) e + I(i – 1, j) J(i, j) = maxe + J(i, j – 1) d + M(i – 1, j – 1) Termination: Optimal alignment given by max { M(m, n), I(m, n), J(m, n) }

Probabilistic interpretation of an alignment An alignment is a hypothesis that the two sequences are related by evolution Goal: Produce the most likely alignment Assert the likelihood that the sequences are indeed related

A Pair HMM for alignments M P(x i, y j ) I P(x i ) J P(y j ) 1 – 2  –  1 – 2  –        BEGIN END M J I    1 – 2  – 

A Pair HMM for not aligned sequences BEGIN I P(x i ) END BEGIN J P(y j ) END 1 -    P(x, y | R) =  (1 –  ) m P(x 1 )…P(x m )  (1 –  ) n P(y 1 )…P(y n ) =  2 (1 –  ) m+n  i P(x i )  j P(y j ) Model R

To compare ALIGNMENT vs. RANDOM hypothesis Every pair of letters contributes: (1 – 2  –  ) P(x i, y j ) when matched  P(x i ) P(y j ) when gapped (1 –  ) 2 P(x i ) P(y j ) in random model Focus on comparison of P(x i, y j ) vs. P(x i ) P(y j ) BEGIN I P(x i ) END BEGIN J P(y j ) END 1 -    M P(x i, y j ) I P(x i ) J P(y j ) 1 – 2  –  1 – 2  –      

To compare ALIGNMENT vs. RANDOM hypothesis Idea: We will divide alignment score by the random score, and take logarithms Let P(x i, y j ) (1 – 2  –  ) s(x i, y j ) = log ––––––––––– + log ––––––––––– P(x i ) P(y j ) (1 –  ) 2  (1 – 2  –  ) P(x i ) d = – log –––––––––––––––––––– (1 –  ) (1 – 2  –  ) P(x i )  P(x i ) e = – log ––––––––––– (1 –  ) P(x i ) Every letter b in random model contributes (1 –  ) P(b)

The meaning of alignment scores Because , , are small, and ,  are very small, P(x i, y j ) (1 – 2  –  ) P(x i, y j ) s(x i, y j ) = log ––––––––– + log ––––––––––  log –––––––– + log(1 – 2  ) P(x i ) P(y j ) (1 –  ) 2 P(x i ) P(y j )  (1 –  –  ) 1 –  d = – log ––––––––––––––––––  – log  –––––– (1 –  ) (1 – 2  –  ) 1 – 2   e = – log –––––––  – log  (1 –  )

The meaning of alignment scores The Viterbi algorithm for Pair HMMs corresponds exactly to the Needleman-Wunsch algorithm with affine gaps However, now we need to score alignment with parameters that add up to probability distributions   1/mean arrival time of next gap   1/mean length of next gap  affine gaps decouple arrival time with length   1/mean length of conserved segments(set to ~0)   1/mean length of sequences of interest(set to ~0)

The meaning of alignment scores Match/mismatch scores: P(x i, y j ) s(a, b)  log ––––––––––– (let’s ignore log(1 – 2  ) for the moment – assume no gaps) P(x i ) P(y j ) Example: Say DNA regions between human and mouse have average conservation of 50% Then P(A,A) = P(C,C) = P(G,G) = P(T,T) = 1/8 (so they sum to ½) P(A,C) = P(A,G) =……= P(T,G) = 1/24 (24 mismatches, sum to ½) Say P(A) = P(C) = P(G) = P(T) = ¼ log [ (1/8) / (1/4 * 1/4) ] = log 2 = 1, for match Then, s(a, b) = log [ (1/24) / (1/4 * 1/4) ] = log 16/24 = Note: / = 37.5 According to this model, a 37.5%-conserved sequence with no gaps would score on average * 1 – * = 0 Why? 37.5% is between the 50% conservation model, and the random 25% conservation model !

Substitution matrices A more meaningful way to assign match/mismatch scores For protein sequences, different substitutions have dramatically different frequencies! BLOSUM matrices: 1.Start from BLOCKS database (curated, gap-free alignments) 2.Cluster sequences according to > X% identity 3.Calculate A ab : # of aligned a-b in distinct clusters, correcting by 1/mn, where m, n are the two cluster sizes 4.Estimate P(a) = (  b A ab )/(  c≤d A cd ); P(a, b) = A ab /(  c≤d A cd )

BLOSUM matrices BLOSUM 50 BLOSUM 62 (The two are scaled differently)

DNA Sequencing

Next few topics DNA Sequencing  Sequencing strategies Hierarchical Online (Walking) Whole Genome Shotgun  Sequencing Assembly Gene Recognition  The GENSCAN hidden Markov model  Comparative Gene Recognition – Twinscan, SLAM Large-scale and multiple sequence alignment Microarrays, Regulation, and Motif-finding Evolution and Phylogeny RNA Structure and Modeling

New topic: DNA sequencing How we obtain the sequence of nucleotides of a species …ACGTGACTGAGGACCGTG CGACTGAGACTGACTGGGT CTAGCTAGACTACGTTTTA TATATATATACGTCGTCGT ACTGATGACTAGATTACAG ACTGATTTAGATACCTGAC TGATTTTAAAAAAATATT…

Which representative of the species? Which human? Answer one: Answer two: it doesn’t matter Polymorphism rate: number of letter changes between two different members of a species Humans: ~1/1,000 Other organisms have much higher polymorphism rates

Why humans are so similar A small population that interbred reduced the genetic variation Out of Africa ~ 100,000 years ago Out of Africa

Migration of human variation

Migration of human variation

Migration of human variation

DNA Sequencing Goal: Find the complete sequence of A, C, G, T’s in DNA Challenge: There is no machine that takes long DNA as an input, and gives the complete sequence as output Can only sequence ~500 letters at a time

DNA sequencing – vectors + = DNA Shake DNA fragments Vector Circular genome (bacterium, plasmid) Known location (restriction site)

Different types of vectors VECTORSize of insert Plasmid 2,000-10,000 Can control the size Cosmid40,000 BAC (Bacterial Artificial Chromosome) 70, ,000 YAC (Yeast Artificial Chromosome) > 300,000 Not used much recently

DNA sequencing – gel electrophoresis 1.Start at primer(restriction site) 2.Grow DNA chain 3.Include dideoxynucleoside (modified a, c, g, t) 4.Stops reaction at all possible points 5.Separate products with length, using gel electrophoresis

Electrophoresis diagrams

Challenging to read answer

Reading an electropherogram 1.Filtering 2.Smoothening 3.Correction for length compressions 4.A method for calling the letters – PHRED PHRED – PHil’s Read EDitor (by Phil Green) Based on dynamic programming Several better methods exist, but labs are reluctant to change

Output of PHRAP: a read A read: nucleotides A C G A A T C A G …A …21 Quality scores: -10  log 10 Prob(Error) Reads can be obtained from leftmost, rightmost ends of the insert Double-barreled sequencing: Both leftmost & rightmost ends are sequenced

Method to sequence segments longer than 500 cut many times at random (Shotgun) genomic segment Get one or two reads from each segment ~500 bp

Reconstructing the Sequence (Fragment Assembly) Cover region with ~7-fold redundancy (7X) Overlap reads and extend to reconstruct the original genomic region reads

Definition of Coverage Length of genomic segment:L Number of reads: n Length of each read:l Definition: Coverage C = n l / L How much coverage is enough? Lander-Waterman model: Assuming uniform distribution of reads, C=10 results in 1 gapped region /1,000,000 nucleotides C

Challenges with Fragment Assembly Sequencing errors ~1-2% of bases are wrong Repeats Computation: ~ O( N 2 ) where N = # reads false overlap due to repeat

Repeats Bacterial genomes:5% Mammals:50% Repeat types: Low-Complexity DNA (e.g. ATATATATACATA…) Microsatellite repeats (a 1 …a k ) N where k ~ 3-6 (e.g. CAGCAGTAGCAGCACCAG) Transposons  SINE (Short Interspersed Nuclear Elements) e.g., ALU: ~300-long, 10 6 copies  LINE (Long Interspersed Nuclear Elements) ~500-5,000-long, 200,000 copies  LTR retroposons (Long Terminal Repeats (~700 bp) at each end) cousins of HIV Gene Families genes duplicate & then diverge (paralogs) Recent duplications ~100,000-long, very similar copies

Strategies for whole-genome sequencing 1.Hierarchical – Clone-by-clone yeast, worm, human i.Break genome into many long fragments ii.Map each long fragment onto the genome iii.Sequence each fragment with shotgun 2.Online version of (1) – Walkingrice genome i.Break genome into many long fragments ii.Start sequencing each fragment with shotgun iii.Construct map as you go 3.Whole Genome Shotgunfly, human, mouse, rat, fugu One large shotgun pass on the whole genome

Hierarchical Sequencing

Hierarchical Sequencing Strategy 1.Obtain a large collection of BAC clones 2.Map them onto the genome (Physical Mapping) 3.Select a minimum tiling path 4.Sequence each clone in the path with shotgun 5.Assemble 6.Put everything together a BAC clone map genome

Methods of physical mapping Goal: Map the clones relative to one another Use the map to select a minimal tiling set of clones to sequence Methods: Hybridization Digestion

1. Hybridization Short words, the probes, attach to complementary words 1.Construct many probes p 1, p 2, …, p n 2.Treat each clone C i with all probes 3.Record all attachments (C i, p j ) 4.Same words attaching to clones X, Y  overlap p1p1 pnpn

Hybridization – Computational Challenge Matrix: m probes  n clones (i, j):1, if p i hybridizes to C j 0, otherwise Definition: Consecutive ones matrix 1s are consecutive in each row & col Computational problem: Reorder the probes so that matrix is in consecutive-ones form Can be solved in O(m 3 ) time (m > n) p 1 p 2 …………………….p m C 1 C 2 ……………….C n 1 0 1………………… ………………… …………………..1 p i1 p i2 …………………….p im C j1 C j2 ……………….C jn …………… …………… …………… ……… ………

Hybridization – Computational Challenge If we put the matrix in consecutive-ones form, then we can deduce the order of the clones & which pairs of clones overlap p i1 p i2 …………………….p im C j1 C j2 ……………….C jn …………… …………… …………… ……… ……… C j1 C j2 ……………….C jn p i1 p i2 ………………………………….p im

Hybridization – Computational Challenge Additional challenge: A probe (short word) can hybridize in many places in the genome Computational Problem: Find the order of probes that implies the minimal probe repetition Equivalent: find the shortest string of probes such that each clone appears as a substring APX-hard Solutions: Greedy, Probabilistic, Lots of manual curation p 1 p 2 …………………….p m C 1 C 2 ……………….C n 1 0 1………………… ………………… …………………..1

2.Digestion Restriction enzymes cut DNA where specific words appear 1.Cut each clone separately with an enzyme 2.Run fragments on a gel and measure length 3.Clones C a, C b have fragments of length { l i, l j, l k }  overlap Double digestion: Cut with enzyme A, enzyme B, then enzymes A + B

Online Clone-by-clone The Walking Method

The Walking Method 1.Build a very redundant library of BACs with sequenced clone-ends (cheap to build) 2.Sequence some seed clones 3.Walk from seeds using clone-ends to pick library clones that extend left & right

Walking: An Example

Advantages & Disadvantages of Hierarchical Sequencing Hierarchical Sequencing  ADV. Easy assembly  DIS. Build library & physical map; redundant sequencing Whole Genome Shotgun (WGS)  ADV. No mapping, no redundant sequencing  DIS. Difficult to assemble and resolve repeats The Walking method – motivation Sequence the genome clone-by-clone without a physical map The only costs involved are:  Library of end-sequenced clones (CHEAP)  Sequencing

Walking off a Single Seed ADV:Low redundant sequencing DIS:Too many sequential steps

Walking off Several Seeds in Parallel Few sequential steps Additional redundant sequencing In general, can sequence a genome in ~5 walking steps, with <20% redundant sequencing EfficientInefficient