25Bacterial communities are composed of distinct groups of potentially interacting lineages, each 26 thought to occupy a distinct ecological niche. It remains unclear, however, how quickly niche 27 preference evolves and whether more closely related lineages are more likely to share ecological 28 niches. We addressed these questions by following the dynamics of two bloom-forming 29 cyanobacteria genera over an 8-year time-course in Lake Champlain, Canada, using 16S 30 amplicon sequencing and measurements of several environmental parameters. The two genera, 31Microcystis (M) and Dolichospermum (D), are frequently observed simultaneously during bloom 32 events and thus have partially overlapping niches. However, the extent of their niche overlap is 33 debated, and it is also unclear to what extent niche partitioning occurs among strains within each 34 genus. To identify strains within each genus, we applied minimum entropy decomposition 35 (MED). We confirmed that at a genus level, M and D have different preferences for nitrogen and 36 phosphorus concentrations. Within each genus, we also identified strains differentially associated 37 with temperature, precipitation, and concentrations of nutrients and toxins. In general, niche 38 similarity between strains (as measured by co-occurrence over time) declined with genetic 39 distance. This pattern is consistent with habitat filtering -in which closely-related taxa are 40 ecologically similar, and therefore tend to co-occur under similar environmental conditions. In 41 contrast with this general pattern, similarity in certain niche dimensions (notably particulate 42 nitrogen and phosphorus) did not decline linearly with genetic distance, and instead showed a 43 complex polynomial relationship. This observation suggests the importance of processes other 44 than habitat filtering -such as competition between closely-related taxa, or convergent trait 45 evolution in distantly-related taxa -in shaping particular traits in microbial communities. 46 47 48