120 likes | 249 Views
Class 5: HMMs and Profile HMMs. Review of HMM. Hidden Markov Models Probabilistic models of sequences Consist of two parts: Hidden states These act like a stochastic automata Observations These are determined (stochastically) by the hidden state. 0.95. 0.9. 1: 1/10 2: 1/10 3: 1/10
E N D
Review of HMM • Hidden Markov Models • Probabilistic models of sequences • Consist of two parts: • Hidden statesThese act like a stochastic automata • ObservationsThese are determined (stochastically) by the hidden state
0.95 0.9 1: 1/10 2: 1/10 3: 1/10 4: 1/10 5: 1/10 6: 1/2 1: 1/6 2: 1/6 3: 1/6 4: 1/6 5: 1/6 6: 1/6 0.05 1.0 0.1 Begin Loaded Fair Example Possible Sequence:
Hidden Markov Models Two components: • A Markov chain of hidden statesH1,…,Hn with L values • P(Hi+1=k |Hi=l ) = Akl • ObservationsX1,…,Xn • Assumption: Xidepends only on hidden state Hi • P(Xi=a |Hi=k ) = Bka
HMM Three aspects: • Representation • Computation • Viterbi algorithm • Forward-Backward algorithm • Learning
1.0 Begin AA 0.21 AC 0.01 AG 0.05 AT 0.04 CA 0.02 …. 1.0 Match Example: pair-HMM • We want to model the joint distribution of two aligned sequences • We start with ungapped alignment
Begin Pair-HMM • This model is equivalentto ungapped models wetreated two classes ago • Can we add gaps? 1.0 AA 0.21 AC 0.01 AG 0.05 AT 0.04 CA 0.02 …. 1.0 Match
Begin Adding GAP States A- 0.2 C- 0.4 G- 0.3 T- 0.1 1- 1-2 Gap Y AA 0.21 AC 0.01 AG 0.05 AT 0.04 CA 0.02 …. 1- -A 0.2 -C 0.4 -G 0.3 -T 0.1 Match Gap X
Gapped Alignment What happens if we do not observe skips? • Suppose input is AAT and ATATT Each sequence of hidden states determines an alignment!!
Viterbi in Pair-HMM • Finding most probable sequence of hidden states is exactly global sequence alignment
Scoring Alignments with HMMs • Viterbi finds most probable alignment • The probability of this alignment can be small… • Using HMM algorithm we can compute the probability of generating the two sequences • This sums over all possible alignments of the two strings • Such methods are more sensitive than standard alignment procedures • We can easily extend the pair-HMM for dealing with local alignment