a–f, Midpoint-rooted core-genome maximum-likelihood trees of E. cloacae complex, K. oxytoca and K. pneumoniae strains isolated in this study (a–c) and in the context of public genomes (d–f). a–c, Number of strains of E. cloacae (a) (n = 37, isolated from 37 faecal samples of 30 subjects, 1,861 core genes), K. oxytoca (b) (n = 107, isolated from 90 faecal samples of 62 subjects, 2,910 core genes) and K. pneumoniae strains (c) (n = 53, isolated from 47 faecal samples of 35 subjects, 3,471 core genes) of the BBS. Solid lines between strains indicate the intra-subject strain persistence (E. cloacae, n = 5 strains in 5 babies; K. oxytoca, n = 25 strains in 18 babies; and K. pneumoniae, n = 11 strains in 8 babies. Dashed lines indicate phylogenetically distinct strains isolated from longitudinal samples (E. cloacae, n = 2 strains in 2 individuals; K. oxytoca, n = 7 strains in 6 subjects; and K. pneumoniae, n = 1 strain in 1 individual); arrows indicate the direction of potential transmission (early-to-later samples). In situations in which multiple identical strains (no difference in SNPs in species core genome) were isolated from the same faecal sample, only one representative strain was included in the species phylogenetic tree (number of non-redundant BBS strains: E. cloacae, n = 52; K. oxytoca, n = 150; K. pneumoniae, n = 78). For each species, the main phylogroups identified with UK hospital collections are shown (E. cloacae, III and VIII; K. oxytoca, KoI, KoII, KoV and KoVI; K. pneumoniae, KpI, KpII and KpIII); these were distributed across three hospitals in this study, with no phylogroup limited to any single hospital. d–f, The number of public genomes included in the phylogenetic analysis of E. cloacae (d) (UK hospitals, n = 314; gut microbiota, n = 8; environmental sources, n = 43; 1,484 core genes), K. oxytoca (e) (UK hospitals, n = 40; gut microbiota, n = 9; environmental sources, n = 8; 3,399 core genes) and K. pneumoniae strains (f) (UK hospitals, n = 250; gut microbiota, n = 17; environmental sources, n = 66; 2,510 core genes).