47
Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado School of Medicine [email protected] www.EvolutionaryGenomics.com www.ProteinEvolution.org Multiple Sequence Alignment (MSA); short version BIOL 7711 Computational Bioscience University of Colorado School of Medicine Consortium for Comparative Genomics

Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Embed Size (px)

Citation preview

Page 1: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Biochemistry and Molecular GeneticsHuman Medical Genetics and Genomics

Computational BioscienceConsortium for Comparative Genomics

University of Colorado School of [email protected]

www.EvolutionaryGenomics.comwww.ProteinEvolution.org

Multiple Sequence Alignment (MSA); short version

BIOL 7711 Computational Bioscience

University of Colorado School of Medicine

Consortium for Comparative Genomics

Page 2: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Sequence Alignment ProfilesMouse TCR Va

Page 3: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

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, genesMutation rates along genome

Page 4: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Why a Hidden Markov Model?

Complications?Insertion and deletion of states (indels)Long-distance interactions

BenefitsFlexible probabilistic framework

E.g., compared to regular expressions

Page 5: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Multiple Sequence Alignment

Generalize pairwise alignment of sequences to include more than twoLooking at more than two sequences

gives us much more information Site-specific information

Sites are different!E.g., which amino acids, coevolutionProcess of change at a site

Evolutionary/phylogenetic relationshipsShorter branches, dissect compound indels

Page 6: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Sample MSA: cFOS

FOS_RAT MMFSGFNADYEASSSRCSSASPAGDSLSYYHSPADSFSSMGSPVNTQDFCADLSVSSANF 60FOS_MOUSE MMFSGFNADYEASSSRCSSASPAGDSLSYYHSPADSFSSMGSPVNTQDFCADLSVSSANF 60FOS_CHICK MMYQGFAGEYEAPSSRCSSASPAGDSLTYYPSPADSFSSMGSPVNSQDFCTDLAVSSANF 60FOSB_MOUSE -MFQAFPGDYDS-GSRCSS-SPSAESQ--YLSSVDSFGSPPTAAASQE-CAGLGEMPGSF 54FOSB_HUMAN -MFQAFPGDYDS-GSRCSS-SPSAESQ--YLSSVDSFGSPPTAAASQE-CAGLGEMPGSF 54 *:..* .:*:: .***** **:.:* * *..***.* :.. :*: *:.*. ...*

FOS_RAT IPTVTAISTSPDLQWLVQPTLVSSVAPSQ-------TRAPHPYGLPTPS-TGAYARAGVV 112FOS_MOUSE IPTVTAISTSPDLQWLVQPTLVSSVAPSQ-------TRAPHPYGLPTQS-AGAYARAGMV 112FOS_CHICK VPTVTAISTSPDLQWLVQPTLISSVAPSQ-------NRG-HPYGVPAPAPPAAYSRPAVL 112FOSB_MOUSE VPTVTAITTSQDLQWLVQPTLISSMAQSQGQPLASQPPAVDPYDMPGTS----YSTPGLS 110FOSB_HUMAN VPTVTAITTSQDLQWLVQPTLISSMAQSQGQPLASQPPVVDPYDMPGTS----YSTPGMS 110 :******:** **********:**:* **... ::. .**.:* : *: ..:

FOS_RAT KTMSGGRAQSIG--------------------RRGKVEQLSPEEEEKRRIRRERNKMAAA 152FOS_MOUSE KTVSGGRAQSIG--------------------RRGKVEQLSPEEEEKRRIRRERNKMAAA 152FOS_CHICK KAP-GGRGQSIG--------------------RRGKVEQLSPEEEEKRRIRRERNKMAAA 151FOSB_MOUSE AYSTGGASGSGGPSTSTTTSGPVSARPARARPRRPREETLTPEEEEKRRVRRERNKLAAA 170FOSB_HUMAN GYSSGGASGSGGPSTSGTTSGPGPARPARARPRRPREETLTPEEEEKRRVRRERNKLAAA 170 :** . * *.::: :::.. .: .: : .** : * *:********:******:***

Page 7: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Optimal MSA

Use Dynamic Programming?Optimal alignment algorithm exists,

but is _________n is the number of sequencesL is the length of the longest sequence

10 sequences of length 100 take 21010010~1023 operations, around 1 million years at 3GHz

Exponential algorithms strike againSo, approximation approaches?

Page 8: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Progressive MSA

Start with pairwise alignments of closely related sequences

Add more distantly related sequences one at a timeComplexity proportional to L2*n

Requires a priori assumptions about the phylogenetic relationships

Can be estimated from all pairwise comparisons

Unfortunate circularity to this approach

SATCHMO method tries to estimate both at once

MSA score based on sum of pairwise scores

Can be weighted to reduce influence of similar sequences

Page 9: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Gaps in Progressive MSAs

How to score gaps in MSAs?Want to align gaps with each other over all sequences. A gap in a pairwise alignment that “matches” a gap in another pairwise alignment should cost less than introducing a totally new gap.

Possible that a new gap could be made to “match” an older one by shifting around the older pairwise alignmentChange gap penalty near conserved domains of

various kinds (e.g. secondary structure, hydrophobic regions)

CLUSTALW2 http://www.ebi.ac.uk/Tools/clustalw2/ is the most widely used Progressive MSA program

Page 10: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Greedy Algorithms

Best alignment of each new sequence to the existing alignment

Then never revisit the decision

Even if changing an old decision (e.g. moving around the gaps in a previous alignment) could increase the score, this approach doesn't do it.Approach is called “greedy” because it uses the best solution at the current step, then moves on

Have to hope that the best solution to a part of the problem will be good solution for the whole problemThis is a common way to resolve exponential problems

Page 11: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Problems with Progressive MSA

Depends crucially on the quality of the pairwise alignments, particularly among the closest matches (which are aligned first)

Small errors propagate to whole alignment

There is no suitable resolution to the problem of gap penalties over multiple sequencesWorks reasonably well for closely related sequences.

Even then, manual adjustments are common

Page 12: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Iterative MSA Methods

Start with a reasonable approximation to the optimal MSA

e.g. by using a progressive methodThen “tweak” to improve itCommon CS idea, called “optimization”

Various optimization techniques tried

e.g., GAs and simulated annealing Key is the scoring function for the

whole MSAAlso, what steps (tweaks) to take that

are likely to improve the score

Page 13: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Block Based Methods

Start with short local alignments (blocks)

Then reduce the problem to aligning the regions between the blocks

“Divide and conquer” Another common CS approach to

exponential problemsHow to find the blocks?

DALIGN (local alignment methods)DCA (divide and conquer alignments)Tmsa (identify patterns and use them to

define blocks)

Page 14: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

MSA Databases

E.g., Pfam, Tigergam, etc.

Look them up and surf

Page 15: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Protein motifs

Recall that local alignments can identify similar regions in non-homologous proteinsThese regions (sometimes called domains) often have shared structure and/or functionExample: Zinc-finger DNA binding motifHow to define them?

Consensus sequenceRegular expressionProfile (probability for each amino acid at each position)

Page 16: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

ProSite consensus sequences

Page 17: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Recognizing ProSite patterns

L14 Ribosome pattern: [GA]-[LIV](3)-x(9,10)-[DNS]-G-x(4)-[FY]-x(2)-[NT]-x(2)-V-[LIV]Some matching sequences:

GIIIACGHLIPQTNGACRTYILNDRVVGVLLWQPKHCSNAADGAWAWFAATAAVLALIVEANIIILSISGRATTFHATSAVI

ProSite patterns can be translated into regular expressions, although the bounded length patterns (e.g. [LIV](3,5) are unwieldy to write down as regexps

Page 18: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Profiles

Rather than identifying only the “consensus” (i.e. most common) amino acid at a particular location, we can assign a probability to each amino acid in each position of the domain

1 2 3A 0.1 0.5 0.25C 0.3 0.1 0.25D 0.2 0.2 0.25E 0.4 0.2 0.25

Page 19: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Applying a profile

Calculate score (probability of match) for a profile at each position in a sequence by multiplying individual probabilities.

Uses a “sliding window”

To calculate a significance value, normalize by the probability of match to random sequence

For sequence EACDC:EAC = .4 * .5 * .25 = .05ACD = .1 * .1 * .25 = .0025CDC = .3 * .2 * .25 = .015

1 2 3A 0.1 0.5 0.25C 0.3 0.1 0.25D 0.2 0.2 0.25E 0.4 0.2 0.25

Page 20: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Using motifs

Great for annotating a sequence with no strong homologsINTERPRO is an uniform interface to

many different motif methods and databases

ProSitePrints (fingerprints = multiple motifs)ProDom (like Pfam, but for domains)SMART (mobile domains)

Page 21: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Creating profiles

Given a local MSA, creating a profile is straightforward

Calculate frequency of each amino acid at each position

What about zero frequencies?Could be sampling errors, not real zero probabilitiesZero probabilities always make zero scores!

RegularizationPseudocountsDirichlet mixtures (blend in background frequencies)

Page 22: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Better regularizers

Adding one pseudocount is too large and too uniform in the small MSA caseInstead, can add a fraction

proportional to the overall frequency of occurrence of the amino acidMight want to add different

pseudocounts depending on the actual count (add more to smaller counts, especially 0)Can use substitution matrices to

estimate

Page 23: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Feature alphabetsAmino acids can be grouped by their

characteristics:Size, hydrophobicity, ionizability, etc.An amino acid is generally in more than

one group

Can set different regularizers (pseudocounts) for each different featureMost useful when there are multiple

featuresotherwise many amino acids get same

pseudocount

Page 24: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Dirichlet mixture priorsFanciest (and near optimal)

regularizerAllows several dimensions (like a

feature, but not predefined), each of which has a different weight for each amino acid.Each pseudocount depends on the

prior probability of seeing a particular distribution in a position

Add more “prior” to more unusual observations

Pseudocount falls off with more observations

Page 25: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

A Simpler not very Hidden MM

Nucleotides, no Indels, Unambiguous Path

G .1C .3A .2T .4

G .1C .1A .7T .1

G .3C .3A .1T .3

A0.7

T0.4

T0.3

1.0 1.0 1.0

Page 26: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

A Toy not-Hidden MMNucleotides, no Indels, Unambiguous

PathAll arcs out are equal

Example sequences: GATC ATC GC GAGAGC AGATTTC

BeginEmit G

Emit A

Emit C

Emit T

End

Arc Emission

Page 27: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

A Simple HMMCpG Islands; States are Really Hidden

Now

G .1C .1A .4T .4

G .3C .3A .2T .2 0.1

0.2

CpG Non-CpG

0.8 0.9

Page 28: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

The Forward AlgorithmProbability of a Sequence is the

Sum of All Paths that Can Produce It

G .1C .1A .4T .4

G .3C .3A .2T .2

0.10.2

Non-CpG

0.8

0.9 G

CpG

G .3

G .1

.3*(

.3*.8+

.1*.1)=.075

.1*(

.3*.2+

.1*.9)=.015

C

Page 29: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

The Forward AlgorithmProbability of a Sequence is the

Sum of All Paths that Can Produce It

G .1C .1A .4T .4

G .3C .3A .2T .2

0.10.2

Non-CpG

0.8

0.9 G

CpG

G .3

G .1

.3*(

.3*.8+

.1*.1)=.075

.1*(

.3*.2+

.1*.9)=.015

C

.3*(

.075*.8+

.015*.1)=.0185

.1*(

.075*.2+

.015*.9)=.0029

G

Page 30: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

The Forward AlgorithmProbability of a Sequence is the

Sum of All Paths that Can Produce It

G .1C .1A .4T .4

G .3C .3A .2T .2

0.10.2

Non-CpG

0.8

0.9 G

CpG

G .3

G .1

.3*(

.3*.8+

.1*.1)=.075

.1*(

.3*.2+

.1*.9)=.015

C

.3*(

.075*.8+

.015*.1)=.0185

.1*(

.075*.2+

.015*.9)=.0029

G

.2*(

.0185*.8+.0029*.1

)=.003.4*(.0185*.2+.0029*.9

)=.0025A

.2*(

.003*.8+

.0025*.1

)=.0005.4*(.003*.2+.0025*.9

)=.0011

A

Page 31: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

The Forward AlgorithmProbability of a Sequence is the

Sum of All Paths that Can Produce It

G .1C .1A .4T .4

G .3C .3A .2T .2

0.10.2

Non-CpG

0.8

0.9 G

CpG

G .3

G .1

.3*(

.3*.8+

.1*.1)=.075

.1*(

.3*.2+

.1*.9)=.015

C

.3*(

.075*.8+

.015*.1)=.0185

.1*(

.075*.2+

.015*.9)=.0029

G

.2*(

.0185*.8+.0029*.1

)=.003.4*(.0185*.2+.0029*.9

)=.0025A

.2*(

.003*.8+

.0025*.1

)=.0005.4*(.003*.2+.0025*.9

)=.0011

A

Page 32: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

The Viterbi AlgorithmMost Likely Path

G .1C .1A .4T .4

G .3C .3A .2T .2

0.10.2

Non-CpG

0.8

0.9 G

CpG

G .3

G .1

.3*m(

.3*.8,

.1*.1)=.072

.1*m(

.3*.2,

.1*.9)=.009

C

.3*m(

.075*.8,

.015*.1)=.0173

.1*m(

.075*.2,

.015*.9)=.0014

G

.2*m(

.0185*.8,.0029*.1

)=.0028.4*m(.0185*.2,.0029*.9

)=.0014A

.2*m(

.003*.8,

.0025*.1

)=.00044.4*m(.003*.2,.0025*.9

)=.0050

A

Page 33: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Forwards and BackwardsProbability of a State at a Position

G .1C .1A .4T .4

G .3C .3A .2T .2

0.10.2

Non-CpG

0.8

0.9 G

CpG

C G

.2*(

.0185*.8+.0029*.1

)=.003.4*(.0185*.2+.0029*.9

)=.0025

A

.2*(

.003*.8+

.0025*.1

)=.0005.4*(.003*.2+.0025*.9

)=.0011

A

.003*(

.2*.8+

.4*.2)=.0007.0025*(.2*.1+

.4*.9)=.0009

Page 34: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Forwards and BackwardsProbability of a State at a Position

G C G A A

.003*(

.2*.8+

.4*.2)=.0007.0025*(.2*.1+

.4*.9)=.0009

Page 35: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Homology HMMGene recognition, identify distant

homologs

Common Ancestral SequenceMatch, site-specific emission probabilitiesInsertion (relative to ancestor), global emission probsDelete, emit nothingGlobal transition probabilities

Page 36: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Homology HMM

start

insert insert

match

delete delete

match end

insert

Page 37: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado
Page 38: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Homology HMMUses

Score sequences for match to HMMCompare alternative modelsAlignmentStructural alignment

Page 39: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Multiple Sequence Alignment HMM

Defines predicted homology of positions (sites)

Recognize region within longer sequenceModel domains or whole proteins

Can modify model for sub-familiesIdeally, use phylogenetic tree

Often not much back and forthIndels a problem

Page 40: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Model Comparison

Based on For ML, take

Usually to avoid numeric error

For heuristics, “score” isFor Bayesian, calculate

Page 41: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Parameters,

Types of parametersAmino acid distributions for positionsGlobal AA distributions for insert statesOrder of match statesTransition probabilitiesTree topology and branch lengthsHidden states (integrate or augment)

Wander parameter space (search)Maximize, or move according to

posterior probability (Bayes)

Page 42: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Expectation Maximization (EM)

Classic algorithm to fit probabilistic model parameters with unobservable statesTwo Stages

MaximizeIf know hidden variables (states), maximize

model parameters with respect to that knowledge

ExpectationIf know model parameters, find expected

values of the hidden variables (states)

Works well even with e.g., Bayesian to find near-equilibrium space

Page 43: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Homology HMM EMStart with heuristic (e.g., ClustalW)Maximize

Match states are residues aligned in most sequencesAmino acid frequencies observed in

columns

ExpectationRealign all the sequences given model

Repeat until convergenceProblems: Local, not global

optimizationUse procedures to check how it worked

Page 44: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Model ComparisonDetermining significance depends

on comparing two modelsUsually null model, H0, and test model,

H1

Models are nested if H0 is a subset of H1

If not nestedAkaike Iinformation 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

Page 45: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Z Test MethodDatabase of known negative controls

E.g., non-homologous (NH) sequencesAssume NH scores

i.e., you are modeling known NH sequence scores as a normal distribution

Set appropriate significance level for multiple comparisons (more below)

ProblemsIs homology certain?Is it the appropriate null model?

Normal distribution often not a good approximation

Parameter control hard: e.g., length distribution

Page 46: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

Bootstrapping and Parametric Models

Random sequence sampled from the same set of emission probability distributions

Same length is easyBootstrapping is re-sampling columnsParametric uses estimated frequencies, may include variance, tree, etc.

More flexible, can have more complex nullPseudocounts of global frequencies if data limit

Insertions relatively hard to modelWhat frequencies for insert states? Global?

Page 47: Biochemistry and Molecular Genetics Human Medical Genetics and Genomics Computational Bioscience Consortium for Comparative Genomics University of Colorado

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 proteinsHMMer: program for building HMMs