Topic 4.2
MEME
Find the motif shared by a set of sequences when you do not know where in each sequence the site sits.
The goal
A transcription factor binds a short, slightly variable stretch of DNA. Each sequence below contains one binding site, but nobody tells you where. Find the shared pattern and the position of every site.
Five sequences, one hidden site each
Two unknowns that depend on each other
If you knew the sites, you could stack them and count letters in each column to get the motif. If you knew the motif, you could score every window and pick where it fits. You know neither, so MEME alternates: a soft guess about the sites using the current motif (E step), then a rebuilt motif from those guesses (M step). Each round fits the data at least as well as the last.
What MEME optimizes
Choose the motif p that maximizes ℒ(p) = ∏i Σt Pr(xi, ti=t | p). Sum over each sequence's possible starts, multiply across sequences.
Model as in lecture: exactly one site per sequence, forward strand only, every start equally likely before seeing the motif, uniform background (each base ¼) outside the site.
Where people get stuck
- The E step does not pick a start.Every start in a sequence keeps a probability z, and each sequence's z values sum to 1. Nothing is thrown away.
- v is not z.v(i,t) multiplies motif probabilities down the columns of one window. z(i,t) divides v by the total over all windows in that sequence.
- The M step is counting with fractions.Each window votes for its bases with weight z instead of 1. Divide by N so every column sums to 1.
- The seed numbers are guesses.0.4 and 0.2 are starting probabilities for the first E step, not counts from data.
- EM climbs the nearest hill.The likelihood never goes down, but different seeds can settle on different motifs.
| Symbol | Meaning |
|---|---|
| pj(b) | Motif: probability of base b in column j. |
| v(i,t) | ∏j pj(base of window at column j). Weight of start t in sequence i. |
| z(i,t) | v(i,t) / Σu v(i,u). Probability that sequence i's site starts at t. |
| Cj(b) | Σi Σt z(i,t) · 1[xi(t+j−1) = b]. Expected count of b in column j. |
| p′j(b) | Cj(b) / N. The updated motif. |
Watch it run
Press Next step to move from seed to E to M and around again. Click a sequence name in an E step to see its arithmetic. Click a cell of the new motif in an M step to see which windows voted for it. Arrow keys also step.
Seed k-mer (count of exact occurrences). Pick any to start from it.
Motif so far
Log-likelihood by EM cycle
Seeds and local optima
Each E/M cycle can only raise the likelihood or leave it unchanged, so the run always settles. It does not promise the best answer overall. Run EM from every k-mer in the current example and compare where each one ends.
Check yourself
In the lecture example, why does CATGA get weights 1/6, 2/3, 1/6 in the first E step?
The seed gives 0.4 to A, C, G in columns 1, 2, 3 and 0.2 to everything else. The windows are CAT, ATG and TGA. CAT scores 0.2 × 0.2 × 0.2 = 0.008. ATG scores 0.4 × 0.2 × 0.4 = 0.032. TGA scores 0.2 × 0.2 × 0.2 = 0.008. The total is 0.048, so ATG gets 0.032 / 0.048 = 2/3 and the others get 1/6 each.
Why does the background probability not show up in v(i,t)?
With a uniform background and equal prior starts, every window in a sequence has the same number of bases outside the site and the same prior. That shared factor appears in every v and cancels when you divide by the total to get z.
Why divide by N in the M step?
Each sequence spreads a total weight of exactly 1 across its starts. Summed over all sequences and bases, the expected counts in any one column add up to N. Dividing by N makes each column a probability distribution.
Two seeds end at different motifs. Which do you trust?
Compare their final log-likelihoods. The higher one explains the data better under the model, and when several seeds land on the same answer that adds confidence. It is still a statistical answer, not proof of the true biological motif.
What does real MEME do that this page leaves out?
It can allow zero or several sites per sequence, search both strands, use a Markov background, find several motifs in turn, and report statistical significance. It also runs a few cycles from many starting points and finishes the most promising one.