Abstract
The structure and function of the gut microbiome are shaped by a combination of ecological and evolutionary forces. While the ecological dynamics of the community have been extensively studied, much less is known about how strains of gut bacteria evolve over time. Here we show that with a model-based analysis of existing shotgun metagenomic data, we can gain new insights into the evolutionary dynamics of gut bacteria within and across hosts. We find that long-term evolution across hosts is consistent with quasi-sexual evolution and purifying selection, with relatively weak geographic structure in many prevalent species. However, our quantitative approach also reveals new between-host genealogical signatures that cannot be explained by standard population genetic models. By comparing samples from the same host over ~6 month timescales, we find that within-host differences rarely arise from the invasion of strains as distantly related as those in other hosts. Instead, we more commonly observe a small number of evolutionary changes in resident strains, in which nucleotide variants or gene gains or losses rapidly sweep to high frequency within a host. By comparing the signatures of these mutations with the typical between-host differences, we find evidence that many sweeps are driven by introgression from existing species or strains, rather than by de novo mutations. These data suggest that bacteria in the microbiome can evolve on human relevant timescales, and highlight the feedback between these short-term changes and the longer-term evolution across hosts.