Week 6: Restriction sites, RAPDs, microsatellites,...

59
Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models Genome 570 April, 2008 Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.1/59

Transcript of Week 6: Restriction sites, RAPDs, microsatellites,...

Page 1: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Week 6: Restriction sites, RAPDs, microsatellites,likelihood, hidden Markov models

Genome 570

April, 2008

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.1/59

Page 2: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Restriction sites

GGGCAATCCCAGTCAGGTTCCGTTAGTGAATCCGTTACCCGTAAT

GGG AATCCCAGTCAGGTTCCGTTAGTGAATCCGTTACCCGTAATG

CCCGTTACCCGTAATGGGTAATCCCAGTCAGGTTCCGTTAGTGAA

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.2/59

Page 3: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Number of sequences in a restriction site location

Nk =

(r

k

)3k.

k number0 11 182 1353 5404 12155 14586 729

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.3/59

Page 4: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Transition probabilities for restriction sites, aggregated

Pk` =b∑

m=a

(r−k

`−k+m

)p`−k+m(1 − p)r−k−(`−k+m)

×(

km

) (p

3

)m (1 − p

3

)k−m

Pk` =min[k,r−`]∑

m=max[0,k−`]

(r−k

`−k+m

)p`−k+m(1 − p)r−`+m

×(

km

) (p

3

)m (1 − p

3

)k−m

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.4/59

Page 5: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Presence/absence of restriction sites

π0 =

(1

4

)r

P++ = π0(1 − p)r

P++ =

(1

4

)r[

1 + 3e−43t

4

]r

P+− = P−+ =

(1

4

)r(

1 −[

1 + 3e−43t

4

]r)

P−− = 1 −(

1

4

)r(

2 −[

1 + 3e−43t

4

]r)

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.5/59

Page 6: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Conditioning on the site not being entirely absent

Prob (+ + | not −−) = P++ / (P++ + P+− + P−+)

Prob (− + | not −−) = P−+ / (P++ + P+− + P−+)

Prob (+ − | not −−) = P+− / (P++ + P+− + P−+)

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.6/59

Page 7: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Likelihoods for two sequences with restriction sites

L =

(P++

P++ + P+− + P−+

)n++(

P+−

P++ + P+− + P−+

)n+−+n

−+

is of the form

L = xn++

(1

2(1 − x)

)n+−+n

−+

where

x =P++

P++ + P+− + P−+

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.7/59

Page 8: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Maximizing the likelihood

The maximum likelihood is when

x =n++

n++ + n+− + n−+

using the equations for the P’s and for x

(1 + 3e−

43t

4

)r

=n++

n++ + 12(n+− + n−+)

which can be solved for t to give the distance

D = t̂ = −3

4ln

4

3

[n++

n++ + 12(n+− + n−+)

]1/r

− 1

3

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.8/59

Page 9: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Are shared restriction sites parallelisms?

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0.00.0 0.5 1.0 1.5 2.0

tt++

+

restrictionsite (6 bases)

t

two−state 0 − 1 model

Pro

babi

lity

ance

stor

is +

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.9/59

Page 10: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

A one-step microsatellite model

Computing the probability that there are a net of i steps by having i + k

steps up and k steps down,

Prob (there are i + 2k steps) = e−µt (µt)i+2k

/(i + 2k)!

Prob (i + k of these are steps upwards) =(i+2k

i+k

) (12

)i+k ( 12

)k

=(i+2k

i+k

) (12

)i+2k

... we put these together to and sum over k to get the result ...

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.10/59

Page 11: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Transition probabilities in the microsatellite model

Transition probability of i steps net change in branch of length µt is

then

pi(µt) =∞∑

k=0

e−µt (µt)i+2k

(i+2k)!

(i+2k

i+k

) (12

)i+2k

= e−µt∞∑

k=0

(µt

2

)i+2k 1(i+k)!k!

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.11/59

Page 12: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Why the (δµ)2 distance works

t generationse2N generations

approximately

e2N generations

approximately

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.12/59

Page 13: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

(δµ)2 distance for microsatellites

(δµ)2 = (µA − µB)2

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.13/59

Page 14: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Transition probabilities in a one-step model

−10 −5 0 5 10

change in number of repeats

µ

µ t = 1

t = 5

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.14/59

Page 15: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

A Brownian motion approximation

Prob (m + k|m) ' min

[1,

1√

µt√

2πexp

(−1

2

k2

µt

)]

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.15/59

Page 16: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Is it accurate? well ...

0.2 0.5 1 2 50

0.2

0.4

0.6

0.8

1P

roba

bilit

y

Branch Length

0

1 23

.01 .05 0.1.02

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.16/59

Page 17: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Likelihood ratios: the odds-ratio form of Bayes’ theorem

Prob (H1|D)Prob (H2|D) = Prob (D|H1)

Prob (D|H2)Prob (H1)Prob (H2)

︸ ︷︷ ︸ ︸ ︷︷ ︸ ︸ ︷︷ ︸posterior likelihood priorodds ratio ratio odds ratio

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.17/59

Page 18: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

With many sites the likelihood wins out

Independence of the evolution in the different sites implies that:

Prob (D|Hi)

= Prob (D(1)|Hi) Prob (D(2)|Hi) . . . Prob (D(n)|Hi)

so we can rewrite the odds-ratio formula as

Prob (H1|D)

Prob (H2|D)=

(n∏

i=1

Prob (D(i)|H1)

Prob (D(i)|H2)

)Prob (H1)

Prob (H2)

This implies that as n gets large the likelihood-ratio part will dominate.

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.18/59

Page 19: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

An example – coin tossing

If we toss a coin 11 times and get HHTTHTHHTTT, the likelihood is:

L = Prob (D|p)

= p p (1 − p) (1 − p) p (1 − p) p p (1 − p) (1 − p) (1 − p)

= p5(1 − p)6

Solving for the maximum likelihood estimate for p by finding themaximum:

dL

dp= 5p4(1 − p)6 − 6p5(1 − p)5

and equating it to zero and solving:

dL

dp= p4(1 − p)5 (5(1 − p) − 6p) = 0

gives p̂ = 5/11

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.19/59

Page 20: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Likelihood as function of p for the 11 coin tosses

0.0 0.2 0.4 0.6 0.8 1.0

Like

lihoo

d

p 0.454

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.20/59

Page 21: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Maximizing the likelihood

ln L = 5 ln p + 6 ln(1 − p),

and

d(ln L)

dp=

5

p− 6

(1 − p)= 0,

so that, again,

p̂ = 5/11

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.21/59

Page 22: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

An example with one site

AC

C

C G

x

z

w

t 1 t 2

t 3

t 4 t 5

t 6t 7

t 8

y

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.22/59

Page 23: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Likelihood sums over states of interior nodes

The likelihood is the product over sites (as they are independent giventhe tree):

L = Prob (D|T) =m∏

i=1

Prob(D(i)|T

)

For site i, summing over all possible states at interior nodes of the tree:

Prob(D(i)|T

)=∑

x

y

z

w

Prob (A, C, C, C, G, x, y, z, w|T)

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.23/59

Page 24: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

... the products over events in the branches

By independence of events in different branches (conditional only ontheir starting states):

Prob (A, C, C, C, G, x, y, z, w|T) =

Prob (x) Prob (y|x, t6) Prob (A|y, t1) Prob (C|y, t2)

Prob (z|x, t8) Prob (C|z, t3)

Prob (w|z, t7) Prob (C|w, t4) Prob (G|w, t5)

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.24/59

Page 25: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

The result looks hard to compute

Summing over all x, y, z, and w (each taking values A, G, C, T):

Prob(D(i)|T

)=

∑x

∑y

∑z

∑w

Prob (x) Prob (y|x, t6) Prob (A|y, t1)

Prob (C|y, t2)

Prob (z|x, t8) Prob (C|z, t3)

Prob (w|z, t7) Prob (C|w, t4) Prob (G|w, t5)

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.25/59

Page 26: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

... but there’s a trick ...

We can move summations in as far as possible:

Prob(D(i)|T

)=

∑x

Prob (x)

(∑y

Prob (y|x, t6) Prob (A|y, t1) Prob (C|y, t2))

(∑z

Prob (z|x, t8) Prob (C|z, t3)

(∑w

Prob (w|z, t7) Prob (C|w, t4) Prob (G|w, t5)

))

The pattern of parentheses parallels the structure of the tree:

(A, C) (C, (C, G))

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.26/59

Page 27: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Conditional likelihoods in this calculation

Working from innermost parentheses outwards is working down the

tree. We can define a quantity

L(i)j (s) the conditional likelihood at site i

of everything at or above point j in the tree,given that point j have state s

One such is the term:

(∑

w

Prob (w|z, t7) Prob (C|w, t4) Prob (G|w, t5)

)

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.27/59

Page 28: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

The pruning algorithm

This follows the recursion down the tree:

L(i)k (s) =

(∑x

Prob (x|s, t`) L(i)` (x)

)

×(∑y

Prob (y|s, tm) L(i)m (y)

)

At a tip the quantity is easily seen to be like this (if the tip is in state A):

(L(i)(A), L(i)(C), L(i)(G), L(i)(T)

)= (1, 0, 0, 0)

At the bottom we have a weighted sum over all states, weighted by their

prior probabilities:

L(i) =∑

x

πx L(i)0 (x)

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.28/59

Page 29: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Handling ambiguity and error

If a base is unknown: use (1, 1, 1, 1). If known only to be a purine:

(1, 0, 1, 0)Note – do not do something like this: (0.5, 0, 0.5, 0). It is not the

probability of being that base but the probability of the observation given

that base.

If there is sequencing error use something like this:

(1 − ε, ε/3, ε/3, ε/3)

(assuming an error is equally likely to be each of the three other bases).

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.29/59

Page 30: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Rerooting the tree

before after

0

8

t8

6t6

x

yz

0

8

t8

6t6

x

y

z

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.30/59

Page 31: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Unrootedness

L(i) =∑

x

y

z

Prob (x) Prob (y|x, t6) Prob (z|x, t8)

Reversibility of the Markov process guarantees that

Prob (x) Prob (y|x, t6) = Prob (y) Prob (x|y, t6).

Substituting that in:

L(i) =∑

y

x

y

Prob (y) Prob (x|y, t6) Prob (z|x, t8)

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.31/59

Page 32: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

A data example: 7-species primates mtDNA

Mouse

Human

ChimpGorilla

Orang

Gibbon

Bovine

0.792 0.902

0.486

0.3360.1210.049

0.3040.1530.075

0.172

0.106

ln L = −1405.6083

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.32/59

Page 33: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Rate variation among sites

Evolution is independent once each site has had its rate specified

Prob (D | T, r1, r2, . . . , rp) =

p∏i=1

Prob (D(i) | T, ri).

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.33/59

Page 34: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Coping with uncertainty about rates

Using a Gamma distribution independently assigning rates to sites:

L =m∏

i=1

[∫∞

0

f(r; α) L(i)(r) dr

]

Unfortunately this is hard to compute on a tree with more than a fewspecies.Yang (1994a) approximated this by a discrete histogram of rates:

L(i) =

∫∞

0

f(r; α) L(i)(r) dr 'k∑

j=1

wkL(i)(rk)

Felsenstein (J. Mol. Evol., 2001) has suggested using Gauss-Laguerrequadrature to choose the rates ri and the weights wi.

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.34/59

Page 35: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Hidden Markov Models

These are the most widely used models allowing rate variation to be

correlated along the sequence.

We assume:

There are a finite number of rates, m. Rate i is ri.

There are probabilities pi of a site having rate i.

A process not visible to us (“hidden") assigns rates to sites. It is a

Markov process working along the sequence. For example it mighthave transition probability Prob (j|i) of changing to rate j in the

next site, given that it is at rate i in this site.

The probability of our seeing some data are to be obtained bysumming over all possible combinations of rates, weighting

approproately by their probabilities of occurrence.

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.35/59

Page 36: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Likelihood with a[n] HMM

Suppose that we have a way of calculating, for each possible rate at each

possible site, the probability of the data at that site (i) given that rate

(rj). This is

Prob(D(i) | rj

)

This can be done because the probabilities of change as a function of therate r and time t are (in almost all models) just functions of their

product rt, so a site that has twice the rate is just like a site that has

branches twice as long.

To get the overall probability of all data, sum over all possible pathsthrough the array of sites × rates, weighting each combination of rates

by its probability:

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.36/59

Page 37: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Hidden Markov Model of rate variation

C

C

C

C

A

A

G

G

A

A

C

T

A

A

G

G

A

G

A

T

A

A

A

A

G

C

C

C

C

C

G

G

G

G

G

A

A

G

G

C

1 2 3 4 5 6 7 8

...

10.0

2.0

0.3

...

Sites

Phylogeny

Hidden Markov Process

Ratesof

evolution

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.37/59

Page 38: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Hidden Markov Models

If there are a number of hidden rate states, with state i having rate ri

Prob (D | T) =∑i1

∑i2

· · ·∑ip

Prob (ri1 , ri2 , . . . rip)

× Prob (D | T, ri1 , ri2 , . . . rim)

Evolution is independent once each site has had its rate specified

Prob (D | T, r1, r2, . . . , rp) =

p∏i=1

Prob (D(i) | T, ri).

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.38/59

Page 39: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Seems impossible ...

To compute the likelihood we sum over all ways rate states could be

assigned to sites:

L = Prob (D | T)

=m∑

i1=1

m∑i2=1

· · ·m∑

ip=1

Prob(ri1 , ri2 , . . . , rip

)

× Prob(D(1) | ri1

)Prob

(D(2) | ri2

). . .Prob

(D(n) | rip

)

Problem: The number of rate combinations is very large. With 100 sites

and 3 rates at each, it is 3100 ' 5 × 1047. This makes the summationimpractical.

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.39/59

Page 40: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Factorization and the algorithm

Fortunately, the terms can be reordered:

L = Prob (D | T)

=m∑

i1=1

m∑i2=1

. . .m∑

ip=1

Prob (i1) Prob(D(1) | ri1

)

× Prob (i2 | i1) Prob(D(2) | ri2

)

× Prob (i3 | i2) Prob(D(3) | ri3

)

...

× Prob (ip | ip−1) Prob(D(p) | rip

)

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.40/59

Page 41: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Using Horner’s Rule

and the summations can be moved each as far rightwards as it can go:

L =m∑

i1=1

Prob (i1) Prob(D(1) | ri1

)

m∑i2=1

Prob (i2 | i1) Prob(D(2) | ri2

)

m∑i3=1

Prob (i3 | i2) Prob(D(3) | ri3

)

...

m∑ip=1

Prob (ip | ip−1) Prob(D(p) | rip

)

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.41/59

Page 42: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Recursive calculation of HMM likelihoods

The summations can be evaluated innermost-outwards. The samesummations appear in multiple terms. We can then evaluate them only

once. A huge saving results. The result is this algorithm:

Define Pi(j) as the probability of everything at or to the right of site i,

given that site i has the j-th rate.Now we can immediately see for the last site that for each possible ratecategory ip

Pp(ip) = Prob(D(p) | rip

)

(as “at or to the right of" simply means “at" for that site).

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.42/59

Page 43: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Recursive calculation

More generally, for site ` < p and its rates i`

P`(i`) = Prob(D(`) | ri`

) m∑

i`=1

Prob (i`+1 | i`) P`+1(i`+1)

We can compute the P’s recursively using this, starting with the last site

and moving leftwards down the sequence. Finally we have the P1(i1) for

all m states. These are simply weighted by the equilibrium probabilities

of the Markov chain of rate categories:

L = Prob (D | T) =m∑

i1=1

Prob (i1) P1(i1)

An entirely similar calculation can be done from left to right,

remembering that the transition probabilities Prob (ik|ik+1) would be

different in that case.

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.43/59

Page 44: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

All paths through the array

array of conditional probabilities of everything at orto the right of that site, given the state at that site

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.44/59

Page 45: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Starting and finishing the calculation

At the end, at site m:

Prob (D[m]|T, rim) = Prob (D(m)|T, rim)

and once we get to site 1, we need only use the prior probabilities of the

rates ri to get a weighted sum:

Prob (D|T) =∑

i1

πi1 Prob (D[1]|T, ri1)

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.45/59

Page 46: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

The pruning algorithm is just like

ancestor

ancestor

species 1 species 2

different bases

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.46/59

Page 47: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

the forward algorithm

site 22

site 21

site 20

different rates

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.47/59

Page 48: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Paths from one state in one site

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.48/59

Page 49: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Paths from another state in that site

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.49/59

Page 50: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Paths from a third state

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.50/59

Page 51: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

We can also use the backward algorithm

you can also do it the other way

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.51/59

Page 52: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Using both we can find likelihood contributed by a state

the "forward−backward" algorithm allows us to getthe probability of everything given one site’s state

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.52/59

Page 53: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

A particular Markov process on rates

There are many possible Markov processes that could be used in theHMM rates problem. I have used:

Prob (ri|rj) = (1 − λ) δij + λ πi

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.53/59

Page 54: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

A numerical example. Cytochrome B

We analyze 31 cytochrome B sequences, aligned by Naoko Takezaki,using the Proml protein maximum likelihood program. Assume a

Hidden Markov Model with 3 states, rates:

category rate probability1 0.0 0.22 1.0 0.43 3.0 0.4

and expected block length 3.

We get a reasonable, but not perfect, tree with the best rate combinationinferred to be

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.54/59

Page 55: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Phylogeny for Takezaki cytochrome B

seaurchin2

seaurchin1

lamprey

carp

trout

loach

xenopus

chicken

opossum

wallarooplatypus horse

dhorserhinocer

cathsealgseal

whalebmwhalebp

bovinegibbon

sorangborang

gorilla1gorilla2cchimppchimp

africancaucasian

ratmouse

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.55/59

Page 56: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Rates inferred from Cytochrome B

� � � � � � � � � � �� � � �� � � � � � �� � � � �� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �

� ��� �� � � � � � � �� �� � �� � � � � � �� � �� �� � � �� �� � � �� � � � � � � � � �� � � � � � � � � �� � � � �� �

� �� � � � � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !� � " ��# $ ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !$� " ��# $ ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !% &� �' ' � � ! ! ! ! ! ! ! ! ! ! � ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !% &� �' ' �� ! ! ! ! ! ! ! ! ! ! � ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !( &� � % ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! � � ! ! ! ! ! ! ! ! ! ! &� � % ! ! ! ! ! ! � � ! ! � ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! !% � ( ( & ! ! ! ! ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! ! � ! ! ! ! � ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! �

( &) � * ! ! ! ! ! ! � � ! ! � � ! ! ! ! �+ ! � � ! ! ! ! ! � ! ! ! ! ! � ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! �

, " �' * (# ! ! ! ! ! ! � � ! ! � � ! ! ! ! � ! ! � � ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! � ! ! ! + ! ! � ! ! ! ! ! ! ! ! ! �

, " �' * ( $ ! ! ! ! ! ! � � ! ! � � ! ! ! ! �+ ! � � ! + ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! � ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! �

- " &� * ! ! ! ! ! ! � � ! ! � � ! ! � ! � ! ! ! ! ! ! ! ! ! � ! ! ! ! ! � ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! �

" &� * ! ! ! ! ! ! � � ! ! � � ! ! � ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! �

� " � &� *� ! ! ! ! ! ! � � ! ! � � ! ! + ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! �

� � . ! ! ! ! ! ! � � ! ! � � ! ! � ! � ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! + ! ! � ! ! ! � ! ! ! ! ! ! ! ! ! �

% * �' ! ! ! ! ! ! � � ! ! � � ! ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! �

" * �' ! ! ! ! ! ! � � ! ! � � ! ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! �

# & � * ! ! ! ! ! ! � ! ! ! � � ! ! � ! � ! ! ! ! ! ! ! ! ! � ! ! ! ! ! � ! ! ! ! ! ! ! ! ! + ! ! �+ ! ! � ! ! ! ! ! ! ! ! ! �

� � . ! ! ! ! ! ! � � ! ! � � ! ! � ! � ! ! ! ! ! ! ! ! ! � ! ! ! ! ! � ! ! ! ! ! ! ! ! ! + ! ! �+ ! ! � ! ! ! ! ! ! ! ! ! �

$' � ./ $ � ! ! ! ! ! � � � ! ! � � ! ! � ! �+ ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! � ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! �

, �' ' �� & & ! ! ! ! ! ! � � ! ! � � ! ! � ! �+ ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! �

& $ & � # ! ! ! ! ! ! � � ! ! � � ! ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! + ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! �

� " �� 0 * ! ! ! ! �� � � ! ! � � ! ! � ! � ! ! � ! � ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! �+ ! ! � � ! ! � ! ! ! � ! ! ! ! ! �

1 * & $ � ! ! ! ! �� � � ! ! � � ! ! � ! � ! ! � ! ! ! ! ! ! ! ! ! ! ! ! � � ! ! ! ! ! ! ! ! + ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! �

� �� $ ! ! ! ! �32 � � ! ! � � ! ! � ! � � ! � � �+ ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! �

' & �� " ! ! ! ! �32 � � ! ! � � ! ! � ! � � ! � � �+ ! ! ! � ! ! ! ! ! + ! ! ! ! ! ! ! ! ! � ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! �

.� & � . ! ! ! ! �32 � � ! ! � � ! ! � ! � � ! � � �+ ! ! ! � ! ! ! ! ! + ! ! ! ! ! ! ! ! ! � ! ! � � ! ! � ! ! ! ! ! ! ! ! ! �

' �# $� */ ! � � � � � � � ! ! � � ! ! � � ! � ! � � �+ ! ! ! � ! � ! ! ! ! ! ! ! ! ! ! ! ! � � ! ! ! ! ! ! � ! ! ! � ! ! ! ! ! �

* �� � � " � � 2 ! ! ! � � ! � ! ! 4 � ! � � � � � ! � � ! + ! ! ! � ! ! ! � ! � ! ! ! ! ! ! ! ! ! � ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! �

* �� � � " � � 2 ! ! ! � � ! � ! ! 4 � ! � � � � � ! � � ! + ! ! ! � ! ! ! � ! � ! ! ! ! ! ! ! ! ! � ! ! ! � ! � � ! ! � ! ! ! ! ! ! �

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.56/59

Page 57: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

Rates inferred from Cytochrome B

� � � � � � � � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �

� ��� �� � � � � � � �� � � � � � � � � � + � � � � � � � � � � �� � � � �� � � � �� � � � � � � � � � � � � � � � 4 �� � � �

� �� � � � � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !� � " ��# $ ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! !$� " ��# $ ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! + ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! !% &� �' ' � � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � � ! ! ! ! ! !% &� �' ' �� ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � � ! ! ! ! ! !( &� � % ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! � ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � � � ! ! ! ! ! ! &� � % ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � � � ! ! ! ! ! !% � ( ( & ! ! ! ! ! ! ! ! ! + ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! !( &) � * � ! � � ! ! ! ! ! + � ! ! � ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! � � ! + ! ! ! ! ! ! ! ! � �� � ! ! ! ! ! !, " �' * (# ! ! � � ! ! ! ! ! + � ! ! � ! ! ! ! ! ! ! + ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � � ! � ! ! ! ! ! ! ! ! � �� � ! ! ! ! ! !, " �' * ( $ ! ! � � ! ! ! ! ! + � ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � � ! � ! ! ! ! ! ! ! ! � �� � ! ! ! ! ! !- " &� * � ! � � ! ! ! ! ! + � ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! + ! ! ! ! ! ! ! ! � �� � ! ! ! ! ! !" &� * � ! � � ! ! ! ! ! + � ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! + ! ! ! ! ! ! ! ! � �� � ! ! ! ! ! !� " � &� *� ! ! � � ! ! ! ! ! + � ! ! � ! ! ! ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! + ! ! ! ! ! ! ! ! � �� � ! ! ! ! ! !� � . � ! � � ! ! ! ! ! + � ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � � ! + ! ! ! � ! ! ! ! � �� ! ! ! ! ! ! !% * �' � ! � � ! ! ! ! ! + � ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � � ! + ! ! ! ! ! ! ! ! � �� � ! ! ! ! ! !" * �' � ! � � ! ! ! ! ! + � ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! � � ! + ! ! ! ! ! ! ! ! � �� � ! ! ! ! ! !# & � * � ! � � ! ! ! ! ! + � ! ! � ! ! ! ! ! ! ! � ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! + ! ! ! ! ! ! ! ! � �� � ! ! ! ! ! !� � . � ! � � ! ! ! ! ! + � ! ! � ! ! ! ! ! ! ! � ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! ! ! + ! ! ! ! ! ! ! ! � �� � ! ! ! ! ! !$' � ./ $ � � ! � ! ! ! ! ! ! + ! ! ! � ! ! ! ! ! ! ! � ! ! ! � ! ! ! ! ! ! � ! ! � ! � ! ! ! ! ! ! ! ! ! ! ! ! � � � � ! ! ! ! ! !, �' ' �� & & � ! � � ! ! ! ! ! + ! ! ! � ! ! ! ! ! ! ! � ! ! � ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! + ! ! ! � ! ! ! ! � ! ! � ! ! ! ! ! !& $ & � # � ! � � ! ! ! ! ! + ! ! ! � ! ! ! ! ! ! ! � ! ! � � ! ! ! ! ! ! ! ! ! � ! ! ! ! ! + ! ! ! � ! ! ! ! � ! ! � ! ! ! ! ! !� " �� 0 * � ! � ! � ! ! ! ! + ! ! �� ! � ! � ! ! ! � ! ! � ! ! ! ! ! ! ! � ! ! ! ! � ! ! ! ! ! ! ! ! ! ! ! ! � ! ! � ! ! ! ! � !1 * & $ � � ! � ! � ! ! ! ! + ! ! ! � � ! ! ! ! ! � � ! ! � ! ! ! ! ! � ! � ! ! ! ! � � ! ! ! ! ! ! ! ! ! ! ! ! ! ! � ! ! ! ! ! !� �� $ � ! � ! ! ! ! ! ! + � ! ! � ! ! ! ! ! ! ! � ! ! � + ! ! ! ! ! ! � ! ! ! ! � � � ! ! � ! ! ! ! ! ! ! � ! ! � ! ! ! ! ! !' & �� " � ! � ! ! ! ! ! ! + ! ! ! � ! ! ! ! ! ! ! � ! ! � � ! ! ! ! ! ! � ! ! ! ! ! � ! ! ! � ! ! ! ! ! ! ! � ! ! � ! ! ! ! ! !.� & � . � ! � ! ! ! ! ! ! + � ! ! � ! ! ! � ! ! ! � ! ! � � ! ! ! ! ! ! � ! ! ! ! � � � ! ! � ! ! ! ! ! ! ! � ! ! � ! ! ! ! ! !' �# $� */ �� � 4 � ! ! ! ! + � ! ! � ! ! ! ! � ! ! � � ! � ! ! ! ! ! ! ! ! ! ! ! ! � � � ! ! ! ! ! � ! ! ! ! � ! ! � ! ! ! ! + ! * �� � � " � � � ! � ! � ! ! ! ! � � ! ! � ! ! ! ! ! ! ! � � ! � + ! ! ! ! ! ! � ! ! ! ! �� � ! ! ! ! ! ! ! ! ! � �� � � ! ! ! ! + ! * �� � � " � � � ! �� � ! ! ! ! + � ! ! � ! ! ! ! ! ! ! � � ! � + ! ! ! � ! ! � ! ! ! ! �� � ! ! ! ! ! ! ! ! ! � �� � � ! ! ! ! + !

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.57/59

Page 58: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

PhyloHMMs: used in the UCSC Genome Browser

The conservation scores calculated in the Genome Browser usePhyloHMMs, which is just these HMM methods.

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.58/59

Page 59: Week 6: Restriction sites, RAPDs, microsatellites, …evolution.gs.washington.edu/gs570/2008/week6.pdfTransition probabilities in a one-step model −10 −5 0 5 10 change in number

How it was done

This freeware-friendly presentation prepared with

Linux (operating system)

LaTeX (mathematical typesetting)

ps2pdf (turning Postscript into PDF)

Idraw (drawing program to modify plots and draw figures)

Adobe Acrobat Reader (to display the PDF in full-screen mode)

Week 6: Restriction sites, RAPDs, microsatellites, likelihood, hidden Markov models – p.59/59