Role of S-layer proteins in bacteria