The host metabolite D-serine contributes to bacterial niche specificity through gene selection