Introduction
Understanding the roles of environment and geography in the process of evolutionary divergence is essential to understand the mechanisms underlying the early stages of speciation. Evolutionary divergence may result from the accumulation of genetic differences caused by drift in geographic isolation, a mode of divergence driven by neutral factors (1, 2 ). In turn, geographic variation in environmental conditions can result in divergent selection, the diversifying process that drives ecological speciation (3 ). In ecological speciation models, reproductive barriers arise as a by-product of cumulative, ecologically adaptive changes (4, 5 ), enabling genome‐wide differentiation at both neutral and selected loci through isolation-by-adaptation (IBA;3 ). Ecological speciation in geographic isolation is theoretically uncontroversial, and deemed common in nature as a mechanism maintaining lineage diversity upon secondary contact (3, 5 ). However, whether ecological speciation in the absence of geographic isolation and reduced gene flow occurs frequently in nature remains questioned in evolutionary research (6, 7 ). The interactions between selection and the stochastic effects derived from processes such as founder events, bottlenecks and genetic drift also remain poorly understood, and difficult to assess in natural systems (8, 9 ).
Biological systems occurring in the environmentally heterogeneous and often extreme habitats at species’ range edges are suitable models to investigate questions related to evolution. The environment at the edges of species’ range tends to be stressful and spatially discontinuous, as well as temporally unstable (10 ), frequently resulting in dynamic settings of multiple isolated populations subject to strong differential selection. The severe and stochastic character of peripheral environments is hypothesized to generate strong selective interplay between adaptation and neutral processes (11 ), providing an ideal opportunity for speciation research. One of such systems is provided by gray mangrove populations in the Arabian Peninsula (Avicennia marina var. marina ). The gray mangrove has the broadest distribution of any mangrove species, extending across the Indian Ocean and into the West Pacific as far as Japan and New Zealand (12 ). The Arabian Peninsula represents one of the northernmost edges of the species’ distribution, as well as a stressful habitat characterized by extreme temperatures, aridity, and often extreme salinity, factors known to be limiting for mangrove growth (13-15 ). Arabian marine domains are also environmentally diverse both within, and between, the main water bodies bordering the peninsula, which define three main biogeographic regions: (i) the Red Sea, where the marine system presents opposing gradients of salinity and temperature, with the highest temperature and lowest salinity values occurring in the shallow southern basin, while the north has cooler temperatures but high salinity as a result of limited precipitation and high evaporation (16, 17 ); (ii) the Persian/Arabian Gulf (referred to as ‘PAG’ hereafter) to the northeast of the Arabian Peninsula, where populations are subject to arid (<250 mm) to hyper-arid (<100 mm) rainfall regimes, and experience the widest range of air temperatures in the region throughout the year, with temperatures varying from 2 °C to 48 °C in specific coastal sites (18, 19 ); and (iii) the Arabian Sea, which in contrast with former biogeographic regions, has normal oceanic salinity, and summer temperatures that are buffered by cold-water upwelling as a result of the Indian Ocean monsoon, resulting in more moderate environmental conditions (20 ).
The Arabian Peninsula has experienced large fluctuations in environmental conditions throughout glacio-eustatic cycles that largely impacted the biodiversity of the region, in particular for the enclosed water bodies of the Red Sea and the PAG (21 ). Throughout the last 400,000 years, the Red Sea remained connected to the Gulf of Aden, yet cross-sectional areas along the Strait of Bab al Mandab connecting them were, at times of glacial maxima, as low as 2% of that today, resulting in major increases in salinity and temperature within the Red Sea (22 ). For several sustained periods during the last two glacial cycles, the minimum channel widths connecting the Red Sea to the Arabian Sea were less than 4 km wide and remained narrow whenever the local sea levels were 50 meters below the current ones (22 ). In contrast, models show that the PAG was nearly completely drained during the peak of the last glaciation until c.a. 14,000 years ago, when a waterway opened in the Strait of Hormuz (23 ). The marine incursion into the southern PAG basin started approximately 12,500 years ago, and the northern basin flooded ca. 1,000 years later. The present PAG shorelines were reached just 6,000 years ago (23 ). As an open ocean habitat, the Arabian Sea coast has only experienced vertical migration of sea levels during these glacial periods, without geographic isolation.
The combination of extreme environmental conditions, differential changes in habitat and dynamic barriers to gene flow, makes the seas bordering the Arabian Peninsula one of the most variable marine environments in the world, with a high potential for speciation driven by both neutral and selective factors (24 ). Although the phylogenetic relationships for the varieties of A. marina and congeneric species have been reported for other regions (25, 26 ), the extensive gray mangrove populations from the Arabian coasts have rarely been included in reported DNA sequence-based analyses (see25, 26, 27 ). The specific drivers and molecular basis of local adaptation and lineage diversification in A. marina remain understudied both in Arabia and across its entire distribution.
Here, we used the Arabian gray mangrove complex to examine how extreme habitat conditions and heterogeneous spatial settings have shaped genetic diversity at the highly variable edge of the species’ range using whole genome and georeferenced environmental data. First, we analyzed patterns of population structure and reconstructed the evolutionary and demographic history of the species in the Arabian Peninsula. Two general competing hypotheses about the evolutionary history of the Arabian mangroves were tested in this study: (i) mangroves from the Red Sea and PAG were extirpated during the glacial cycles of the Pleistocene, followed by a recolonization after the last glacial maximum (LGM); and (ii) mangroves remained within the enclosed seas in glacial refugia during glacial periods, and expanded once sea levels rose. Second, we studied patterns of adaptive variability applying genotype-environment association (GEA) analysis. We used redundancy analysis combining environmental and single nucleotide polymorphisms (SNP) data to survey the genome and jointly identify environmental variables and functional genes potentially involved in local adaptation and lineage divergence.