HMMs in protein or NA sequence alignments I would be very grateful if someone could explain to me how hidden markov models are used to generate a sequence alignment. I was trying to read on it, however ended up in attaining basic concepts and I'm interested in the mechanism that takes place in between the two points: I input 2 or more sequences (first) and get the alignment on my screen (second). I don't really understand the way an HMM is generated in the case of performing sequence alignments.
I'll be thankful even if someone could provide me with links to sources to read on the subject.
I will be very grateful for any help,
Thank you.
 A: Try to read Biological Sequence Analysis: Probabilistic Models of Proteins and Nucleic Acids by Durbin, Eddy, Krogh and Mitchison. It sounds as if Chapter 4 in that book is most relevant to you. 
A: As @NRN pointed out, it's a subtle issue which requires much background. A specific albeit more technical reference I can recommend is Statistical Methods in Bioinformatics where chapter 4 covers basic probability models and Markov processes. It even introduces the highly obfuscated BLAST algorithm around chapter 10. A less technical, more general reference would be Probability Models from Ross which is an extremely well written text that covers Markov models in great depth. The key assumption for the HMM is that of the Markov property: that given the present state of our sequence, the frequency (or probability if you're a Bayesian) of the following potential outcomes does not depend on any prior information. This allows us to use the empirical frequencies of nucleotides to calibrate the degree to which sequences are aligned and find an optimal such alignment using maximum likelihood.
