Structure of a bacterial self-associating protein