Lab 3: Practical Hidden Markov Models (HMM)

Similar documents
Hidden Markov Model. Ying Wu. Electrical Engineering and Computer Science Northwestern University Evanston, IL 60208

Further details of the Baum-Welch algorithm

Multiscale Systems Engineering Research Group

Hidden Markov Modelling

Machine Learning for natural language processing

Computational Genomics and Molecular Biology, Fall

Parametric Models Part III: Hidden Markov Models

Lecture 11: Hidden Markov Models

O 3 O 4 O 5. q 3. q 4. Transition

Hidden Markov Models. By Parisa Abedi. Slides courtesy: Eric Xing

CISC 889 Bioinformatics (Spring 2004) Hidden Markov Models (II)

Hidden Markov Models The three basic HMM problems (note: change in notation) Mitch Marcus CSE 391

Hidden Markov Models (I)

Hidden Markov Models. Aarti Singh Slides courtesy: Eric Xing. Machine Learning / Nov 8, 2010

Data Mining in Bioinformatics HMM

Hidden Markov Models Hamid R. Rabiee

Hidden Markov Models for biological sequence analysis

CS1820 Notes. hgupta1, kjline, smechery. April 3-April 5. output: plausible Ancestral Recombination Graph (ARG)

Introduction to Machine Learning CMU-10701

Basic math for biology

An Introduction to Bioinformatics Algorithms Hidden Markov Models

HIDDEN MARKOV MODELS IN SPEECH RECOGNITION

Data-Intensive Computing with MapReduce

Hidden Markov Models for biological sequence analysis I

Computational Genomics and Molecular Biology, Fall

Graphical Models 101. Biostatistics 615/815 Lecture 12: Hidden Markov Models. Example probability distribution. An example graphical model

Hidden Markov Models. Ivan Gesteira Costa Filho IZKF Research Group Bioinformatics RWTH Aachen Adapted from:

Hidden Markov Model and Speech Recognition

Dynamic Approaches: The Hidden Markov Model

Today s Lecture: HMMs

Lecture 4: Hidden Markov Models: An Introduction to Dynamic Decision Making. November 11, 2010

A Higher-Order Interactive Hidden Markov Model and Its Applications Wai-Ki Ching Department of Mathematics The University of Hong Kong

CS 7180: Behavioral Modeling and Decision- making in AI

COMP90051 Statistical Machine Learning

Hidden Markov model. Jianxin Wu. LAMDA Group National Key Lab for Novel Software Technology Nanjing University, China

Supervised Learning Hidden Markov Models. Some of these slides were inspired by the tutorials of Andrew Moore

HIDDEN MARKOV MODELS

ASR using Hidden Markov Model : A tutorial

Statistical Processing of Natural Language

EECS730: Introduction to Bioinformatics

Hidden Markov Models

Hidden Markov Models and Gaussian Mixture Models

Hidden Markov Models

10. Hidden Markov Models (HMM) for Speech Processing. (some slides taken from Glass and Zue course)

An Introduction to Bioinformatics Algorithms Hidden Markov Models

CS 7180: Behavioral Modeling and Decision- making in AI

COMS 4771 Probabilistic Reasoning via Graphical Models. Nakul Verma

Hidden Markov Models (HMMs)

Hidden Markov models

Hidden Markov Models,99,100! Markov, here I come!

Hidden Markov Models

Hidden Markov Models

We Live in Exciting Times. CSCI-567: Machine Learning (Spring 2019) Outline. Outline. ACM (an international computing research society) has named

Hidden Markov Models. Three classic HMM problems

Hidden Markov Models

HMM : Viterbi algorithm - a toy example

Advanced Data Science

VL Algorithmen und Datenstrukturen für Bioinformatik ( ) WS15/2016 Woche 16

Page 1. References. Hidden Markov models and multiple sequence alignment. Markov chains. Probability review. Example. Markovian sequence

L23: hidden Markov models

Lecture 3: ASR: HMMs, Forward, Viterbi

Introduction to Hidden Markov Models for Gene Prediction ECE-S690

Automatic Speech Recognition (CS753)

Hidden Markov Models

Lecture 9. Intro to Hidden Markov Models (finish up)

Recap: HMM. ANLP Lecture 9: Algorithms for HMMs. More general notation. Recap: HMM. Elements of HMM: Sharon Goldwater 4 Oct 2018.

CSCE 471/871 Lecture 3: Markov Chains and

Master 2 Informatique Probabilistic Learning and Data Analysis

Lecture 7 Sequence analysis. Hidden Markov Models

Hidden Markov models 1

HMM: Parameter Estimation

Lecture 12: Algorithms for HMMs

HMM : Viterbi algorithm - a toy example

Hidden Markov Models

order is number of previous outputs

Hidden Markov Models

Genome 373: Hidden Markov Models II. Doug Fowler

1 What is a hidden Markov model?

Biostatistics 615/815 Lecture 20: The Baum-Welch Algorithm Advanced Hidden Markov Models

Lecture 3: Markov chains.

Learning from Sequential and Time-Series Data

More on HMMs and other sequence models. Intro to NLP - ETHZ - 18/03/2013

Sequence Labeling: HMMs & Structured Perceptron

Machine Learning for OR & FE

Hidden Markov Models NIKOLAY YAKOVETS

6 Markov Chains and Hidden Markov Models

Bayesian Machine Learning - Lecture 7

CS 4495 Computer Vision

STA 414/2104: Machine Learning

Hidden Markov Models Part 2: Algorithms

Statistical Sequence Recognition and Training: An Introduction to HMMs

Sequence labeling. Taking collective a set of interrelated instances x 1,, x T and jointly labeling them

6.047/6.878/HST.507 Computational Biology: Genomes, Networks, Evolution. Lecture 05. Hidden Markov Models Part II

Hidden Markov Models. Main source: Durbin et al., Biological Sequence Alignment (Cambridge, 98)

Lecture 12: Algorithms for HMMs

Linear Dynamical Systems (Kalman filter)

Grundlagen der Bioinformatik, SS 09, D. Huson, June 16, S. Durbin, S. Eddy, A. Krogh and G. Mitchison, Biological Sequence

1/22/13. Example: CpG Island. Question 2: Finding CpG Islands

Bioinformatics 2 - Lecture 4

Markov Chains and Hidden Markov Models. = stochastic, generative models

Transcription:

Advanced Topics in Bioinformatics Lab 3: Practical Hidden Markov Models () Maoying, Wu Department of Bioinformatics & Biostatistics Shanghai Jiao Tong University November 27, 2014

Hidden Markov Models (s) Three components of s: Initial State Probability vector π π i : the initial probability of state i State transition matrix A R N N independent of t a ij : state transition probability of S i S j Confusion/Emission matrix B R N M independent of t b i(ot): probability of symbol O t given state i.

Problems and Solutions Evaluation: Pr(O 1:T λ) Forward algorithm Backward algorithm Decoding: Pr(S 1:T O 1:T, λ) Viterbi algorithm Learning: O λ Forward-backward (Baum-Welch) algorithm

Forward Algorithm Input: Hidden Markov model λ, observation O 1... O T with length T Bayesian equation: P(A C) = B P(AB C) P(O 1 O 2... O T λ) = N q T =1 P(O 1O 2... O T, q T λ) Forward variable (local probability of observing O 1... O t and state at time t is j given hidden Markov model): α t (j) = P(O 1 O 2... O t, q t = j λ) Forward Algorithm: 1 Initialization: α 1 (j) = π(j)b j(o1) 2 Recursion: α t (j) = N i=1 (α t 1(i)a ij )b j(ot) 3 Output: p = N j=1 α T (j) The time complexity of forward algorithm is O(N 2 T )

Backward Algorithm Input: Hidden Markov model λ, observation O 1... O T with length T P(A C) = B P(AB C) P(O t O t 1... O 1 λ) = N q 1 =1 P(O to t 1... O 1, q 1 λ) Backward variable (local probability of observing O t+1... O T given that state at time t is i and the is λ): β t (i) = P(O t+1 O t+2... O T q t = i, λ) Backward Algorithm: 1 Initialization: β T (i) = 1.0 2 Recursion: β t (i) = N j=1 (β t+1(j)a ij )b j(ot+1) 3 Output: p = N i=1 β 1(i)

Viterbi Algorithm: Finding Most Probable Hidden-State Path Used for decoding Partial best path and its associated local probability δ t (i) Initialization: δ 1 (i) = π(i)b io1 Recursion: δ t (i) = max j (δ t 1 (j)a ji b iot ) Backtracking: φ t (i) = arg max j (δ t 1 (j)a ji b iot ) Output: the maximum likelihood p = max i (δ T (i)) and the most probable path (s 1,..., s T ).

Forward-Backward algorithm: Baum-Welch Definition: γ t(i) = P(q t = S i O, λ) (prob. of transition starting from S i at time t) γ t(i) = αt (i)βt (i) αt (i)βt (i) = P(O λ) Ni=1 α t (i)β t (i) Definition: ξ t(i, j) = P(q t = S i, q t+1 = S j O, λ) (prob of S i S j at time t) ξ t(i, j) = α t (i)a ij b jot+1 β t+1 (j) Ni=1 Nj=1 α t (i)a ij b jot+1 β t+1 (j) Thus T 1 t=1 γt(i) is expected number of transition starting from S i, and T 1 t=1 ξt(i, j) is the expected number of S i S j. Inferring model parameters ˆπ i = γ 1 (i) (1) T 1 t=1 ξt(i, j) â ij = T 1 t=1 γt(i) (2) T t=1,q ˆb j(ok ) = t =O k γ t(j) T t=1 γt(j) (3)

Exercise 1 The Bacteriophage lambda genome sequence (NCBI accession NC 001416) has long stretches of either very GC-rich (mostly in the first half of the genome) or very AT-rich sequence (mostly in the second half of the genome). Use a with two different states ( AT-rich and GC-rich ) to infer which state of the is most likely to have generated each nucleotide position in the Bacteriophage lambda genome sequence. For the AT-rich state, set p = (p A, p C, p G, p T ) = 0.27, 0.2084, 0.198, 0.3236. For the GC-rich state, set p = (0.2462, 0.2476, 0.2985, 0.2077). Set the probability of switching from the AT-rich state to the GC-rich state to be 0.0002, and the probability of switching from the GC-rich state to the AT-rich state to be 0.0002. What is the most probable state path?

Exercise 2 Given a with four different states ( A-rich, C-rich, G-rich and T-rich ), infer which state of the is most likely to have generated each nucleotide position in the Bacteriophage lambda genome sequence. For the A-rich state, set p = (p A, p C, p G, p T ) = (0.3236, 0.2084, 0.198, 0.27); For the C-rich state, set p = (0.2462, 0.2985, 0.2476, 0.2077); For the G-rich state, set p = (0.2462, 0.2476, 0.2985, 0.2077); For the T-rich state, set p = (0.27, 0.2084, 0.198, 0.3236). Set the probability of switching between any two different states to be 6.666667e 05. What is the most probable state path? Do you find differences between these results and the results from simply using a two-state?

Exercise 3 Make a two-state to model protein sequence evolution, with hydrophilic and hydrophobic states. hydrophilic: set p = (p A, p R, p N, p D, p C, p Q, p E, p G, p H, p I, p L, p K, p M, p F, p P, p S, p T, p W, p Y, p V ) = (0.02, 0.068, 0.068, 0, 068, 0.02, 0.068, 0.068, 0.068, 0.068, 0.012, 0.012, 0.012, 0.068, 0.02, 0.02, 0.068, 0.068, 0.068, 0.068, 0.012) hydrophobic p = (0.114, 0.007, 0.007, 0.007, 0.114, 0.007, 0.007, 0.025, 0.007, 0.114, 0.114, 0.007, 0.114, 0.114, 0.025, 0.026, 0.026, 0.025, 0.026, 0.114). Set the probability of switching between two states to be 0.01. Now infer which state of the is most likely to have generated each amino acid position in the the human odorant receptor 5BF1 protein (UniProt accession Q8NHC7). What is the most probable state path? The odorant receptor is a 7-transmembrane protein, meaning that it crosses the cell membrane seven times. As a consequence the protein has 7 hydrophobic regions that cross the fatty cell membrane, and 7 hydrophilic segments that touch the watery cytoplasm and extracellular environments. What do you think are the coordinates in the protein of the seven transmembrane regions?