19
Probabilistic methods: Gibbs Sampling
instructor: Ross A. Lippert
http://www-math.mit.edu/~lippert/18.417/
Announcements:- Start chapter 12
- Problem sets to hand back
|  |
Review of the motif finding problem
A motif logo

Motifs are captured by profiles
| | gtatac | | | | | | | | START |
| | | | | | | | atataa | | START |
| gaataa | | | | | | | | | | START |
| | | | gtctta | | | | | | START |
|
| 1 | 2 | 3 | 4 | 5 | 6 |
| a | 1 | 1 | 3 | 0 | 3 | 3 |
| c | 0 | 0 | 1 | 0 | 0 | 1 |
| g | 3 | 0 | 0 | 0 | 0 | 0 |
| t | 0 | 3 | 0 | 4 | 1 | 0 |
| - | G | T | A | T | A | A |
Scoring function to reflect nearness to consensus
Brute force enumeration can take a great deal of time
The basic problem
This is a ridiculously general version of the problem:
- Given a multivariable scoring function f(y{1}...y{n}) >= 0
- Find max f
This is a ridiculous sounding solution:
- Set up a probabilistic system where f(opt) has a good chance to appear
- Run the system for a while and take the best f seen
Candidate probabilistic systems
- prob(y{1}...y{n}) =~ f(y)
- prob(y{1}...y{n}) =~ f(y)^(1/T)
- prob(y{1}...y{n}) =~ exp(f(y)/T) (f as a tropical quantity)
Tropics: sampling from f^(1/T) as T->0 should give f(opt)
Gibbs sampling
Solves the following problem:
- Input: prob(y{1}...y{n}), where |y|^n is big, but |y| is managable
- Output: a random y chosen with prob, or a series of such y's
How do we do it?
- Setup Markov chain with states y
- Transitions: (y{1}...y{m}...y{n})-->(y{1}...y'{m}...y{n})
- Transition Probs: pick m uniformly, then proportional to prob(y{1}...y'{m}...y{n})
Specialized instance of more general idea Monte Carlo Markov Chains
Recasting the motif problem as a probability problem
Given letter frequencies p(x) and profile positions s{1}...s{n}
- prob(C) =~ PROD p(x)^C{x,i} / C{x,i}!
- 1/prob(C) = score of candidate s{1}...s{n}
- logarithmic version: SUM C{x,i} log(C{x,i}/p(x))
This is incidental motivation for this scoring function -- it will have nice properties
Gibbs sampling of motifs
- generate start state: s{1}...s{n}
- pick uniformly m from 1...n
- replace s{m} <-- s picked by 1/prob(C(s{1}...s...s{n})) weights
- <do whatever with the sample>
- goto 2
At this point, the algorithm is essentially done.
For the chosen objective function, something cute happens
prob(s) =~ C(s{1}...s...s{n}){T[s+i],i} / p(T[s+i])
Typical hack:
- C(s{1}...s...s{n}){T[s+i],i} = C(s{1}...()...s{n}){T[s+i],i}
What can we do with this?
Other applications
- sampling of phylogenetic histories
- haplotype phasing problem (maybe I'll talk about it next time
- exploring hidden state sequences in a random model (e.g. HMM)
- training an random model (e.g. HMM)
- measure relative uncertainties in the profile quantities
- in general: establish sensitivity coefficients or find moments
- what structures are stable over time?
Simulated Annealing
We found a way to sample from prob =~ f(y{1}...y{k})
Annealing is a process by which glass is put into a highly durable state via a process of slow cooling
Same idea here: prob(T) =~ f^(1/T) and T-->0



What can go wrong?
- How long do we run?
- How often can we sample?