In microbial mat communities of Yellowstone hot springs, ribosomal RNA (rRNA) sequence diversity patterns indicate the presence of closely related bacterial populations along environmental gradients of temperature and light. To identify the functional bases for adaptation, we sequenced the genomes of two cyanobacterial (Synechococcus OS-A and OS-B') isolates representing ecologically distinct populations that dominate at different temperatures and are major primary producers in the mat. There was a marked lack of conserved large-scale gene order between the two Synechococcus genomes, indicative of extensive genomic rearrangements. Comparative genomic analyses showed that the isolates shared a large fraction of their gene content at high identity, yet, differences in phosphate and nitrogen utilization pathways indicated that they have adapted differentially to nutrient fluxes, possibly by the acquisition of genes by lateral gene transfer or their loss in certain populations. Comparisons of the Synechococcus genomes to metagenomic sequences derived from mats where these Synechococcus stains were originally isolated, revealed new facets of microbial diversity. First, Synechococcus populations at the lower temperature regions of the mat showed greater sequence diversity than those at high temperatures, consistent with a greater number of ecologically distinct populations at the lower temperature. Second, we found evidence of a specialized population that is apparently very closely related to Synechococcus OS-B', but contains genes that function in the uptake of reduced ferrous iron. In situ expression studies demonstrated that these genes are differentially expressed over the diel cycle, with highest expression when the mats are anoxic and iron may be in the reduced state. Genomic information from these mat-specific isolates and metagenomic information can be coupled to detect naturally occurring populations that are associated with different functionalities, not always represented by isolates, but which may nevertheless be important for niche partitioning and the establishment of microbial community structure.