The nonsynonymous (amino acid-altering) to synonymous (silent) substitution rate ratio (omega = d(N)/d(S)) provides a measure of natural selection at the protein level. with omega = 1, >1, and >1, indicating neutral evolution, purifying selection. and positive selection. respectively, Previous studies that used this Measure to detect positive,election have often taken all approach of pairwise comparison, estimating substitution rates by averaging over all site,, in the protein. As most amino acids in a functional protein arc Wider structural and functional constraints and adaptive evolution probably affects only a few sites at a few time points, this approach of averaging rates mer sites and Over time has little power. Previously, we de eloped codon-based substitution models that allow the omega ratio to vary either among lineages or among sites. In this paper we extend previous Models to allow the omega ratio to vary both among sites and among lineages and implement the new model,, in the likelihood framework, These models may be useful for identifying positive selection along prespecified lineages that affects only a few sites in the protein. We apply those branch-site models as well as previous branch- and site-specific models to three data sets: the lysozyme genes from primates. the tumor suppressor BRCA1 genes front primates, and the phytochrome gene family in angiosperms. Positive selection is detected in the lysozyme and BRCA genes by both the new and the old models. However. only the new models detected positive,election acting on lineages after gene duplication in the PHY gene family. Additional tests on several data sets suggest that the new models may be useful in detecting positive selection after gene duplication in gene family evolution.