Profile HMMs Biology 162 Computational Genetics Todd Vision 16 Sep 2004
Outline Profile HMMs generate MSAs States and transitions for –Matches, Insertions, Deletions, Silent and Flanking states Statistics –Null model, E values Training –Model construction, Weighting training sequences and including pseudocounts (which have a Bayesian interpretation) Existing tools –Interpro, including Pfam and HMMER
Globins Helix HBA_HUMAN -DLS-----HGSAQVKGHGKKVADALTNAVAHV---D--DMPNALSALSDLHAHKL- HBB_HUMAN GDLSTPDAVMGNPKVKAHGKKVLGAFSDGLAHL---D-- NLKGTFATLSELHCDKL- MYG_PHYCA KHLKTEAEMKASEDLKKHGVTVLTALGAILKK----K- GHHEAELKPLAQSHATKH- LGB2_LUPLU LK- GTSEVPQNNPELQAHAGKVFKLVYEAAIQLQVTGVVVTDATLKNLGSVHVSKG- Consensus.l.t....kHg.kV. a l. L..H. K.
Hidden Markov models Observed sequence of symbols Hidden sequence of underlying states Transition probabilities govern transitions among states Emission probabilities govern the likelihood of observing a symbol in a particular state
Profile HMMs Use scores rather than emission probabilities directly
A PSSM as a simple HMM beginM1M1 MiMi M i+1 MLML end …… With emission probabilities unique to each match state
But what about gaps? Ignore them (BLOCKS database) OR Model them –Insert states have background emission probabilities beginM1M1 MiMi MLML end …… IiIi
Gap scores For an insert of length k with background emission probabilities, we have affine gap scores
Length distribution of inserts Geometric distribution I a MI a II a IM
Which columns are match states? Options –Assign columns to be match states by eye –Heuristic i.e. no more than 50% gaps per column –Maximum a posteriori (MAP) model construction O(L 2 ) dynamic programming algorithm exists to find model that optimizes score on training data Helix HBA_HUMAN -DLS-----HGSAQVKGHGKKVADALTNAVAHV---D--DMPNALSALSDLHAHKL- HBB_HUMAN GDLSTPDAVMGNPKVKAHGKKVLGAFSDGLAHL---D-- NLKGTFATLSELHCDKL- MYG_PHYCA KHLKTEAEMKASEDLKKHGVTVLTALGAILKK----K- GHHEAELKPLAQSHATKH- LGB2_LUPLU LK- GTSEVPQNNPELQAHAGKVFKLVYEAAIQLQVTGVVVTDATLKNLGSVHVSKG- Consensus.l.t....kHg.kV. a l. L..H. K.
Two ways to handle deletions Transitions between match states Silent deletion states (no emission) beginM1M1 MiMi MLML end …… beginM1M1 M2M2 M3M3 end D2D2 D1D1 D3D3
Profile HMM
Flanking states Many sites in a sequence may be assigned to 'flanking' states (N, C, or J) Transitions should force one or more match states to be traversed at least once
Local or global alignment? Are transitions allowed –From start to internal match? –From internal match to end? Are there states that can emit sequences before and after the profile? Do transitions allow the profile to be repeated? In HMMs –Global/local behavior governed by model not algorithm –Behavior may differ w.r.t. the profile and the sequence
Null model S N T
Extreme value problems How to convert S bit to an expect value? Since alignment is not truly local, theory used for BLAST does not hold here Solutions (both available in HMMER) –Conservative approximation valid for any profile –Empirically fit extreme value distribution using simulated sequences –Must be done once for every profile HMM
Why not always use full model? The sum of probabilities is constrained to be one Spreading probability among many paths decreases power to discriminate among them You should always choose the most restrictive model (fewest transitions) consistent with your purpose
Which algorithm to use? Three choices –Viterbi: maximum likelihood path –Forward: sum of probabilities of all possible paths –Forward-backward: prob of each state at each pos For database search –Query sequence against a database of profile HMMs –Profile HMM against a database of sequences? For alignment –Adding new sequence(s) to an existing alignment
Training a profile HMM Weighting training sequences –We saw the same problem when scoring multiple alignments –Same approaches are used for profile HMMs Estimating transition probabilities –Taken care of by MAP model construction Estimating emission probabilities –We will assume the alignment is correct –Only issue is how to add pseudocounts
Better pseudocounts Laplace's Rule –Ignores background frequencies of residues Background frequency pseudocounts –
Pseudocounts as Bayesian priors Bayes' rule Posterior PriorLikelihood
Dirichlet mixture pseudocounts Background probabilities are not uniform throughout the protein –eg exposed loops (hydrophilic residues abundant) vs. buried core (small side chains abundant) Different sets of pseudocount priors (Dirichlet distributions) for each environment Pseudocounts for I i are determined by a mixture of Dirichlet distributions fit to position i
Evolutionary pseudocounts Related to phylogenetic methods we will see later –Calculate probability of each residue having been the common ancestor of the residues in a column –Calculate probability of each residue as a descendent –Use these probabilities as priors with appropriate weighting Requires use of a position-independent scoring matrix (eg PAM)
Queries vs. subjects Two directions of search are possible –Sequence query against database of profile HMMs –Profile HMM against a database of sequences Bit scores will be the same regardless But E-values will differ –Search space (ie number of subjects in database) can differ considerably –It is usually more sensitive to search a database of profile HMMs
Interpro Regular Expressions –PROSITE PSSMs, other motifs –PROSITE, PRINTS, PRODOM Profile HMMs –Pfam –SMART –TIGRFAMs –PIR SuperFamily –SUPERFAMILY
Interpro v8
Pfam A profile HMM database –Based on Swissprot and TREMBL Current version (v15) has 7503 families. –~75% of all new protein sequences match an existing Pfam profile Profiles constructed semi-automatically –New families identified –Seed alignment manually optimized –Profile HMM constructed –All matching sequences aligned to HMM
HMMER Used in construction of Pfam –Can build a profile (with MAP algorithm) –Can search a sequence against a profile and vice versa (i.e. with forward algorithm) –Can add new sequences to an alignment (via Viterbi) –Uses Plan 7 profiles User sets the local/global behavior
HMMER2.0 [2.3.1] NAME fn3 ACC PF DESC Fibronectin type III domain LENG 84 ALPH Amino RF no CS no MAP yes COM hmmbuild -F HMM_ls.ann SEED.ann COM hmmcalibrate --seed 0 HMM_ls.ann NSEQ 108 DATE Mon Jul 26 14:10: CKSUM 1153 GA TC NC XT NULT NULE EVD HMM A C D E F G H I K L M N P Q R S T V W Y m->m m->i m->d i->m i->i d->m d->d b->m m->e -13 * *
Summary Profile HMMs generate MSAs States and transitions for –Matches, Insertions (which can model affine gaps), Deletions, which allow local alignment, Silent states and flanking states Statistics –Scored relative to a null model and E values must be determined empirically Training –MAP model construction, Training sequence weighting and pseudocounts (which have a Bayesian interpretation) Existing tools –Interpro, including Pfam and HMMER
Assignment Look over study guide –posted on Blackboard Turn in lab/problem set on Tuesday Midterm on Thursday