1 / 41

Hidden Markov Models BIOL 7711 Computational Bioscience

Consortium for Comparative Genomics. University of Colorado School of Medicine. Hidden Markov Models BIOL 7711 Computational Bioscience. Why a Hidden Markov Model?. Data elements are often linked by a string of connectivity, a linear sequence

unity
Download Presentation

Hidden Markov Models BIOL 7711 Computational Bioscience

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Consortium for Comparative Genomics University of Colorado School of Medicine Hidden Markov ModelsBIOL 7711 Computational Bioscience

  2. Why a Hidden Markov Model? • Data elements are often linked by a string of connectivity, a linear sequence • Secondary structure prediction (Goldman, Thorne, Jones) • CpG islands • Models of exons, introns, regulatory regions, genes • Mutation rates along genome

  3. Sequence Alignment ProfilesMouse TCR Va

  4. Why a Hidden Markov Model? • Complications? • Insertion and deletion of states (indels) • Long-distance interactions • Benefits • Flexible probabilistic framework • E.g., compared to regular expressions

  5. Gap Gap insert insert insert A .1C .05D .2E .08F .01 A .04C .1D .01E .2F .02 A .2C .01D .05E .1F .06 Profiles: an Example continue continue delete

  6. Gap Gap insert insert insert A .1C .05D .2E .08F .01 A .04C .1D .01E .2F .02 A .2C .01D .05E .1F .06 Profiles, an Example: States continue continue State #1 State #2 State #3 delete

  7. Gap Gap insert insert insert A .1C .05D .2E .08F .01 A .04C .1D .01E .2F .02 A .2C .01D .05E .1F .06 Profiles, an Example: Emission Sequence Elements (possibly emitted by a state) continue continue State #1 State #2 State #3 delete

  8. Gap Gap insert insert insert A .1C .05D .2E .08F .01 A .04C .1D .01E .2F .02 A .2C .01D .05E .1F .06 Profiles, an Example: Emission Sequence Elements (possibly emitted by a state) Emission Probabilities continue continue State #1 State #2 State #3 delete

  9. Gap Gap insert insert A .1C .05D .2E .08F .01 A .04C .1D .01E .2F .02 A .2C .01D .05E .1F .06 Profiles, an Example: Arcs continue continue insert transition State #1 State #2 State #3 delete

  10. Gap Gap insert insert A .1C .05D .2E .08F .01 A .04C .1D .01E .2F .02 A .2C .01D .05E .1F .06 Profiles, an Example: Special States Self => Self Loop continue continue insert transition State #1 State #2 State #3 delete No Delete “State”

  11. A Simpler not very Hidden MMNucleotides, no Indels, Unambiguous Path G .1C .1A .7T .1 G .1C .3A .2T .4 G .3C .3A .1T .3 1.0 1.0 1.0 A 0.7 T 0.4 T 0.3

  12. A Simpler not very Hidden MMNucleotides, no Indels, Unambiguous Path G .1C .1A .7T .1 G .1C .3A .2T .4 G .3C .3A .1T .3 1.0 1.0 1.0 A 0.7 T 0.4 T 0.3

  13. Emit G Emit C Begin End Emit A Emit T A Toy not-Hidden MMNucleotides, no Indels, Unambiguous PathAll arcs out are equal Example sequences:GATC ATC GC GAGAGC AGATTTC Arc Emission

  14. A Simple HMMCpG Islands; States are Really Hidden Now 0.8 0.9 0.2 G .3C .3A .2T .2 G .1C .1A .4T .4 0.1 CpG Non-CpG

  15. The Forward AlgorithmProbability of a Sequence is the Sum of All Paths that Can Produce It CpG 0.8 G .3C .3A .2T .2 G .3 .3*( .3*.8+ .1*.1) =.075 0.2 0.1 G .1 .1*( .3*.2+ .1*.9) =.015 G .1C .1A .4T .4 G C 0.9 Non-CpG

  16. The Forward AlgorithmProbability of a Sequence is the Sum of All Paths that Can Produce It CpG 0.8 G .3C .3A .2T .2 G .3 .3*( .3*.8+ .1*.1) =.075 .3*( .075*.8+ .015*.1) =.0185 0.2 0.1 G .1 .1*( .3*.2+ .1*.9) =.015 .1*( .075*.2+ .015*.9) =.0029 G .1C .1A .4T .4 G C G 0.9 Non-CpG

  17. The Forward AlgorithmProbability of a Sequence is the Sum of All Paths that Can Produce It CpG 0.8 G .3C .3A .2T .2 G .3 .3*( .3*.8+ .1*.1) =.075 .3*( .075*.8+ .015*.1) =.0185 .2*( .0185*.8+ .0029*.1) =.003 .2*( .003*.8+ .0025*.1) =.0005 0.2 0.1 G .1 .1*( .3*.2+ .1*.9) =.015 .1*( .075*.2+ .015*.9) =.0029 .4*( .0185*.2+ .0029*.9) =.0025 .4*( .003*.2+ .0025*.9) =.0011 G .1C .1A .4T .4 G C G A A 0.9 Non-CpG

  18. The Forward AlgorithmProbability of a Sequence is the Sum of All Paths that Can Produce It CpG 0.8 G .3C .3A .2T .2 G .3 .3*( .3*.8+ .1*.1) =.075 .3*( .075*.8+ .015*.1) =.0185 .2*( .0185*.8+ .0029*.1) =.003 .2*( .003*.8+ .0025*.1) =.0005 0.2 0.1 G .1 .1*( .3*.2+ .1*.9) =.015 .1*( .075*.2+ .015*.9) =.0029 .4*( .0185*.2+ .0029*.9) =.0025 .4*( .003*.2+ .0025*.9) =.0011 G .1C .1A .4T .4 G C G A A 0.9 Non-CpG

  19. The Viterbi AlgorithmMost Likely Path CpG 0.8 G .3C .3A .2T .2 G .3 .3*m( .3*.8, .1*.1) =.072 .3*m( .075*.8, .015*.1) =.0173 .2*m( .0185*.8, .0029*.1) =.0028 .2*m( .003*.8, .0025*.1) =.00044 0.2 0.1 G .1 .1*m( .3*.2, .1*.9) =.009 .1*m( .075*.2, .015*.9) =.0014 .4*m( .0185*.2, .0029*.9) =.0014 .4*m( .003*.2, .0025*.9) =.0050 G .1C .1A .4T .4 G C G A A 0.9 Non-CpG

  20. Forwards and BackwardsProbability of a State at a Position CpG 0.8 .2*( .0185*.8+ .0029*.1) =.003 .003*( .2*.8+ .4*.2) =.0007 G .3C .3A .2T .2 .2*( .003*.8+ .0025*.1) =.0005 .4*( .0185*.2+ .0029*.9) =.0025 0.2 0.1 .0025*( .2*.1+ .4*.9) =.0009 .4*( .003*.2+ .0025*.9) =.0011 G .1C .1A .4T .4 G C G A A 0.9 Non-CpG

  21. Forwards and BackwardsProbability of a State at a Position .003*( .2*.8+ .4*.2) =.0007 .0025*( .2*.1+ .4*.9) =.0009 G C G A A

  22. Homology HMM • Gene recognition, identify distant homologs • Common Ancestral Sequence • Match, site-specific emission probabilities • Insertion (relative to ancestor), global emission probs • Delete, emit nothing • Global transition probabilities

  23. insert insert insert end match match start delete delete Homology HMM

  24. Homology HMM • Uses • Score sequences for match to HMM • Compare alternative models • Alignment • Structural alignment

  25. Multiple Sequence Alignment HMM • Defines predicted homology of positions (sites) • Recognize region within longer sequence • Model domains or whole proteins • Can modify model for sub-families • Ideally, use phylogenetic tree • Often not much back and forth • Indels a problem

  26. Model Comparison • Based on • For ML, take • Usually to avoid numeric error • For heuristics, “score” is • For Bayesian, calculate

  27. Parameters, • Types of parameters • Amino acid distributions for positions • Global AA distributions for insert states • Order of match states • Transition probabilities • Tree topology and branch lengths • Hidden states (integrate or augment) • Wander parameter space (search) • Maximize, or move according to posterior probability (Bayes)

  28. Expectation Maximization (EM) • Classic algorithm to fit probabilistic model parameters with unobservable states • Two Stages • Maximize • If know hidden variables (states), maximize model parameters with respect to that knowledge • Expectation • If know model parameters, find expected values of the hidden variables (states) • Works well even with e.g., Bayesian to find near-equilibrium space

  29. Homology HMM EM • Start with heuristic (e.g., ClustalW) • Maximize • Match states are residues aligned in most sequences • Amino acid frequencies observed in columns • Expectation • Realign all the sequences given model • Repeat until convergence • Problems: Local, not global optimization • Use procedures to check how it worked

  30. Model Comparison • Determining significance depends on comparing two models • Usually null model, H0, and test model, H1 • Models are nested if H0 is a subset of H1 • If not nested • AkaikeIinformation Criterion (AIC) [similar to empirical Bayes] or • Bayes Factor (BF) [but be careful] • Generating a null distribution of statistic • Z-factor, bootstrapping, , parametric bootstrapping, posterior predictive

  31. Z Test Method • Database of known negative controls • E.g., non-homologous (NH) sequences • Assume NH scores • i.e., you are modeling known NH sequence scores as a normal distribution • Set appropriate significance level for multiple comparisons (more below) • Problems • Is homology certain? • Is it the appropriate null model? • Normal distribution often not a good approximation • Parameter control hard: e.g., length distribution

  32. Bootstrapping and Parametric Models • Random sequence sampled from the same set of emission probability distributions • Same length is easy • Bootstrapping is re-sampling columns • Parametric uses estimated frequencies, may include variance, tree, etc. • More flexible, can have more complex null • Pseudocounts of global frequencies if data limit • Insertions relatively hard to model • What frequencies for insert states? Global?

  33. Homology HMM Resources • UCSC (Haussler) • SAM: align, secondary structure predictions, HMM parameters, etc. • WUSTL/Janelia (Eddy) • Pfam: database of pre-computed HMM alignments for various proteins • HMMer: program for building HMMs

  34. Increasing Asymmetry with Increasing Single Strandedness e.g., P ( A=> G) = c + t t = ( DssH * Slope ) + Intercept

  35. 2x Redundant Sites

  36. 4x Redundant Sites

  37. Beyond HMMs • Neural nets • Dynamic Bayesian nets • Factorial HMMs • Boltzmann Trees • Kalman filters • Hidden Markov random fields

  38. COI Functional Regions O2 + protons+ electrons = H2O + secondary proton pumping (=ATP) Water H (alt) Water H Electron Oxygen D H D K K

More Related