For the LRT for selection on any branch, P-values were computed empirically, based on simulation experiments. 10,000 alignments were simulated under the 'nearly neutral model' (allowing for a fraction p 0 of sites to evolve with v 0 ,1 and a fraction 12p 0 to evolve with v 1 = 1) for each G+C class using evolver [84] . Alignment lengths and values of m, v 0 and p 0 were drawn from the empirical distribution defined by the real alignments (using estimates obtained under the null model), and the remaining parameters were fixed at global estimates for each G+C class. Log likelihood ratios (LLRs) were then computed exactly as for the real data. The nominal P -value for a LLR of r was defined as the fraction of all simulated alignments with LLR$r, unless the number of such alignments was ,10, in which case we assumed 2r*x 2 df~1 (an adequate approximation for small P-values, according to the simulation experiments). The method of Benjamini and Hochberg [85] was used to estimate the appropriate P-value threshold for a false discovery rate of ,0.05. For the lineage-and clade-specific LRTs, P-values were computed assuming the null distribution was a 50:50 mixture of a x 2 df~1 distribution and a point mass at zero (see [27] and discussion in Text S1).