Patterns of sequence variation in families of homologous proteins