After an appropriate burn-in period, each iteration of the Gibbs sampler produces a sample (Z (t) , h (t) ) from P(Z, h|X). Estimated posterior expected values of interest were obtained by averaging these samples or functions of these samples, and Bayesian 95% confidence intervals were obtained by taking the 0.025 and 0.975 quantiles of the sampled values. For example, the posterior expected number of genes under selection on branch k (see Figure 4 ) was estimated as 1