Bacterial gene typing