Introduction

Climate change has a broad impact on environmental conditions and as such can be a major driver of biodiversity turnover. The rate of environmental change and the diversity in taxa specific responses to changing habitats are important determinants of persistence and extinction (Hewitt 2004; Davis et al. 2005; Potter et al. 2018). For example, species can differ in their ability to mitigate the effects of climate change (resilience) with some taxa being more flexible in their ability to track suitable habitat or the capacity to adapt to novel circumstances in-situ, while others that lack such resilience facing local extinction (Davis et al. 2005; Sexton et al. 2017). Such idiosyncratic responses to climate change are not only observed between species from distinct taxonomic groups, but responses can sometimes even vary between closely related species that face common environmental changes (Deutsch et al. 2008; Moussalli et al. 2009; Hoffmann and Sgrò, 2018). With the global average annual temperature projected to rise between 1 and 4 °C by 2100 (Collins et al. 2013; IPCC 2014) and habitat destruction simultaneously accelerating (Habel et al. 2019), there is a growing need to understand how individual species and communities will respond to the ongoing changes in environmental conditions. Many studies address this topic by modelling prospective changes in species distribution and extinction risk (Araújo et al. 2006; Deutsch et al. 2008; Hof et al. 2011; Kafash et al. 2020). However, model accuracy strongly scales with the availability of (reliable) occurrence data and informative model parameters depend on our ability to quantify ecological and physiological requirements for a given species (Le Galliard et al. 2012; Waldvogel et al. 2020). For example, (environmental) specialists and generalists vary substantially in niche breadth and may therefore also differ in terms of resilience under changing conditions (Moussalli et al. 2009; Afonso Silva et al. 2017). Moreover, spatial heterogeneity in microclimatic conditions and complex interactions between taxa can also complicate the prediction of future effects of climate change on individual species (Araújo and Rahbek 2006; Araújo et al. 2006; Moritz et al. 2012; Taheri et al. 2021). Thus, it remains challenging to predict the degree of resilience for individual species by generalising across organismal groups and there is a pressing need to evaluate climate change resilience at a more detailed resolution across the Tree-of-Life.

Among vertebrates, ectotherms are particularly sensitive to changes in external conditions and have frequently been cited as a group where many species may be less able to cope with the predicted changes in climate (Deutsch et al. 2008; Rohr and Palmer 2013; Bestion et al. 2015; Winter et al. 2016). Ectotherms depend on ambient temperatures for thermoregulation and are sensitive to sizeable temperature changes in their surroundings (Winter et al. 2016). The worldwide decline in terrestrial ectotherms, reptiles and amphibians, has been partially attributed to their inability to track or adapt to changing climatic conditions and corresponding changes in prevalence of invasive species or foreign pathogens (Camargo et al. 2010; Hof et al. 2011; Oficialdegui et al. 2019). Many reptiles and amphibians have a limited dispersal capacity (Sinsch 1991; Araújo et al. 2006), are highly dependent on local environmental conditions for reproduction and development (Araújo et al. 2006; Blaustein et al. 2001; Jensen et al. 2018) and are generally considered to rely more heavily on external conditions than thermoregulating species (Deutsch et al. 2008; Bestion et al. 2015; Pie et al. 2017; Rolland et al. 2018). On the other hand, while these traits may be negative for local persistence during climate change, studying the demographic history of species with a narrow climatic niche in a geographic context can simultaneously provide important insights about the location and size of regions that have remained climatically stable over longer time scales (refugia; Hewitt 1996, 2004; Araújo et al. 2008). Thus, the study of climate change resilience in reptiles and amphibians is of particular interest due to their potential vulnerability under changing external conditions and terrestrial ectotherms are at the same time highly suited to evaluate how climatic stability may vary across landscapes.

The overarching aim of this Review is twofold. First, we will outline why climate change resilience is of particular concern in reptiles and amphibians by reviewing how changes in climate directly affect fitness via important biological dimensions, such as thermal regulation, reproduction and development. While more detailed Reviews on each of the aforementioned topics are in place (e.g. Blaustein et al. 2010; Diele-viegas et al. 2018; Butler 2019; Singh et al. 2020), providing a succinct overview on all topics combined will give a holistic view on the various ways that climate change can affect the ectotherm phenotype and how this may lead to population change. We will then continue by assessing how past changes in climate and extant patterns of ectotherm diversity have largely been studied in a phylogeographic rather than a demographic context. We discuss how genomic resources remain relatively absent for large groups of terrestrial ectotherms and how the lack of such resources has hindered the study of demographic history compared to other vertebrates. By providing an overview of different types of genomic data and corresponding developments in inference approaches, we highlight how such advances can be leveraged for the study of demographic history in amphibians and reptiles. This Review therefore outlines the myriad ways in which climate change has direct consequences for amphibian and reptilian fitness and diversity, while simultaneously discussing how we can improve our ability to quantify demographic history during past periods of climate change. These are both key requisites for identifying the proximate factors that have shaped population dynamics in the past and are thus essential for improving our ability to predict how contemporary populations will respond to future changes in environmental conditions. While reviewing (paleo-)environmental niche and predictive models themselves is outside the scope of the present Review (but see Sillero et al. 2021), here we emphasize the vulnerability of terrestrial ectotherms relative to endotherms and simultaneously highlight the outstanding challenges and opportunities for improving demographic inference in amphibians and reptiles. By doing so, we aim to bring herpetologists and population geneticists closer together and stimulate future efforts to study population change and the role of climate in one of the most evolutionary diverse groups of vertebrates.

The evolutionary consequences of climate change on terrestrial ectotherms

Identifying and quantifying the challenges that ectothermic vertebrates face under current climate change models is an essential but challenging task (Deutsch et al. 2008; Huey et al. 2009). Reptiles and amphibians are diverse groups that currently represent around 19,000 described species (Taylor et al. 2021). However, the true number of unique evolutionary lineages is putatively much higher due to the high incidence of cryptic diversity in both groups and extreme levels of species diversity in relatively understudied regions (e.g. the Tropics, Bickford et al. 2007). They are present on every continent except Antarctica, occupy a huge variety of habitats and cover a wide diversity in life-history traits (Pie et al. 2017; Diele-viegas et al. 2018; Taylor et al. 2021). They are strongly reliant on ambient temperature for thermoregulation and metabolic regulation and changes in temperature or corresponding environmental conditions such as the alteration of precipitation patterns, can therefore have many direct physiological and behavioural consequences (Huey 1982; Diele-viegas et al. 2018; Domínguez-Guerrero et al. 2019; Fig. 1). For example, reproductive output can be negatively affected when higher environmental temperatures bias the sex ratio of reptile species with temperature-dependent sex determination (Mitchell and Janzen 2010; Jensen et al. 2018). Similarly, changes in local precipitation and temperature can increase eutrophication in aquatic habitats, leading to e.g. elevated nutrient loading, low light levels, spread of pathogenic infections and hypoxic conditions, which in turn can affect growth and survival of amphibians (Johnson et al. 2007; Blaustein et al. 2010; Isaza et al. 2020; Rodgers 2021). Examples such as these, highlight how ectotherms may be more strongly affected and less likely to cope with rapidly changing environments than endotherms due to the direct interaction between external conditions and physiology (Pie et al. 2017; Rolland et al. 2018). In this section we will briefly summarise the diverse ways in which climate change has a direct impact on the ecology, behaviour and ultimately persistence of reptiles and amphibians.

Fig. 1
figure 1

Direct consequences of climate change for amphibians and reptiles. Reptilian and amphibian populations are strongly reliant on their environment and changes in e.g. temperature and precipitation regimes can have many direct physiological and behavioural consequences. These changes can be largely classified across three biological dimensions: (i) thermal regulation, (ii) reproduction and development and (iii) habitat dependency and dispersal, with the latter being considered a consequence of the first two dimensions. The figure illustrates under each category some examples found in the literature

Thermal regulation

Thermoregulation is the process with which organisms maintain their body temperature within an optimal thermal range in order to optimise biological processes, such as enzymatic activity or embryological development (Hutchison and Dupré 1992). In contrast to endotherms, ectotherms cannot thermoregulate internally and thus rely on external heat sources to adjust body temperature and optimise their performance (Huey 1982; Huey and Berrigan 2001; Rolland et al. 2018). Thermal regulation strategies, such as habitat selection or behavioural adjustments, allow ectotherms to counteract reductions in performance and shifts in thermal optima when environmental temperatures are suboptimal (i.e. due to daily and seasonal temperature fluctuations; Huey 1982; Huey and Berrigan 2001; Kearney et al. 2009; Blaustein et al. 2010; Le Galliard et al. 2012; Sunday et al. 2014; Muñoz et al. 2016; Taylor et al. 2021). The thermal range of a given species sets the utmost boundaries in which an individual can operate and maximise performance at an optimal temperature (Huey et al. 2012), and in the case of ectotherms, increases with latitude (Deutsch et al. 2008; Huey et al. 2009). With more variable environments and broader seasonal fluctuations in temperature, ectotherms in temperate regions generally have wider thermal optima and warming tolerances than tropical ectotherms (Snyder and Weathers 1975; Deutsch et al. 2008; Clusella-Trullas et al. 2011; Huey et al. 2012; Quintero and Wiens 2013), which are more sensitive to temperature changes and will reach their critical maximum faster (Deutsch et al. 2008; Moritz et al. 2012). Nonetheless, even among ectotherms in temperate regions, some species are adapted to cool and humid habitats (e.g. montane environments) and may have relatively narrow thermal ranges and low thermal optima (Garcia-Porta et al. 2019).

When variation in environmental conditions cannot be optimally accounted for via thermoregulation, climate change can lead to major differences in physiological performance. Changes in temperature and precipitation regimes, as well as the increased occurrence of extreme meteorological events, can induce significant changes in water and energy balances of ectotherms, such as increased evaporative water loss, as well as changes in their metabolic activity, greatly influencing their performance (Huey et al. 2012). Several ectotherm species depend on hibernation during harsh seasons and maintain their metabolic requirements at very low levels during periods of low ambient temperatures and decreased food availability (Reading 2007). For such species, changes in temperature patterns leading to bouts of higher environmental temperatures during winter might result in increased metabolic requirements caused by cycles of rewarming and metabolic depression (Reading 2007; Blaustein et al. 2010), resulting in lower fitness at time of arousal (Reading 2007). Altered metabolic activities and decreased performance resulting from shifts from thermal optima can negatively affect immune function, making ectotherms more susceptible to infection (Cohen et al. 2017). This may be particularly concerning in light of the widespread fungal infection outbreaks that have affected many amphibian groups (Blaustein et al. 2010, 2012; Cohen et al. 2019).

Reproduction and development

Changes in local environmental conditions can have important direct and indirect consequences for (the timing of) reproduction and development of reptiles and amphibians (Blaustein et al. 2010; Bestion et al. 2015). Breeding time onset is often affected by temperature (Dunn 2004) and an earlier start of the breeding season has been observed for many amphibian and reptilian species in regions where Spring commences earlier (Blaustein et al. 2010; Green 2017). While experimental studies have reported a positive correlation between breeding time onset, body size and reproductive capacity (Beebee 1995; Gibbs and Breisch 2001; Chadwick et al. 2006; Bestion et al. 2015), shifts in breeding time can have negative consequences for populations when competition for resources and habitat takes place between species that normally do not have overlapping breeding seasons (Blaustein et al. 2010). Breeding activity itself can also be negatively affected when climate change leads to variation in the strength and frequency of rainfall events (Blaustein et al. 2010; Akmentins et al. 2015), particularly for species with aquatic life stages and species that rely on ephemeral water bodies. Moreover, precipitation can be an important prerequisite for egg deposition and spawning activity of amphibians (Jensen et al. 2003). Alterations in reproductive behaviour to counteract the effects of climate change can include the adjustment of nest site selection towards cooler or more protected areas and altering nest site construction, in species where nesting depth is modulated (Doody et al. 2006).

Once eggs have been laid, incubation temperature has a direct impact on important life-history traits such as body size, growth rate, body shape, locomotor performance, thermoregulatory behaviour and sexual phenotype (Noble et al. 2018; Singh et al. 2020). For example, swimming performance and behaviour of hatchlings of the Mary River turtle, Elusor macrurus, can vary with incubation temperature. Individuals that are incubated at cooler temperatures have higher performance and swim more than turtles that are incubated at warmer temperatures (Micheli-Campbell et al. 2011). Most reptilian species lay eggs, with embryos that cannot thermoregulate (Cordero et al. 2018; Singh et al. 2020) and while warmer temperatures may accelerate embryonic growth and hatching time (Bestion et al. 2015; Singh et al. 2020), high temperatures during early stages of embryological development might negatively affect cell, tissue and organ differentiation (Singh et al. 2020). Increased temperatures during development might also accelerate larval growth rate in amphibians and lead to increased body size at the moment of metamorphosis (Peng et al. 2020). Incubation temperature does not only influence development itself, but can even determine offspring sex. There are many reptilian species, such as crocodiles and some turtles, where offspring sex is determined by incubation temperature. An increase in environmental temperature can therefore lead to a significant population bias in sex ratios (Hulin et al. 2009; Mitchell and Janzen 2010; Simoncini et al. 2014; Valenzuela et al. 2019). A skew in sex ratios can increase mate competition and negatively affect reproductive output (Doody et al. 2006; Blaustein et al. 2010; Singh et al. 2020). Rising sand temperature in breeding locations of green turtles, Chelonia mydas, for example, has led to an increased feminization of two populations on the Australian Great Barrier Reef during the last two decades; a sex ratio bias that could potentially lead to the complete feminization of these populations in the near future (Jensen et al. 2018). However, interestingly, some species with temperature-dependent sex determination seem to be able to shift their breeding onset as a behavioural reproductive strategy to compensate for biased sex ratios. These species can adjust the onset of reproduction towards temperatures that favour the production of the less frequent sex (Doody et al. 2006), but it remains unclear to what extent they can compensate.

Habitat dependency and dispersal capacity

The climatic niche, the range of environmental conditions in which a species can occur and persist (Pie et al. 2017; Wollenberg Valero et al. 2019), is generally more restricted for ectotherms than endotherms (Huey 1991; Pie et al. 2017; Rolland et al. 2018). Their dependence on external conditions for thermoregulation, reproduction and development frequently limits their physiological capacity to adopt a broad climatic niche and restricts their ability to disperse across non-suitable habitat and, while behavioural changes may partially alleviate, phenotypic plasticity can only mitigate such negative consequences to a certain extent (Muñoz et al. 2016; Domínguez-Guerrero et al. 2019). The low dispersal capacity of many amphibian and reptile species has likely contributed to an increase in ecological specialisation (Jocque et al. 2010) and while ectotherms globally occupy a wide diversity of ecological niches, many species are highly specialised to local conditions. Tropical regions in particular exhibit high degrees of species endemism and distinct species, which only marginally differ in ecological niche, can frequently be found in close proximity (Jocque et al. 2010; Oliver et al. 2019).

Ecological specialisation to highly localised conditions coupled with low-dispersal capacity increases reliance on habitat stability and rapid changes in climate may pose a considerable threat to ectotherms that are small range endemics. Additionally, the increased spread of invasive species facilitated by climate change, coupled with habitat suitability loss, might introduce further challenges, such as competition for resources or exposure to foreign pathogens (Falaschi et al. 2019; Pabijan et al. 2020). Whereas ecological generalists may be able to track suitable habitat during periods of change, ecological specialists are locally trapped and may go extinct with the disappearance of microhabitat (Moussalli et al. 2009; Garcia-Porta et al. 2019; Nguyen et al. 2019). Ectotherms may therefore be particularly dependent on geographic regions that have served as evolutionary refugia in the past and such refugia have likely shaped diversity patterns at a macroevolutionary scale for many reptiles and amphibians (Hewitt 1996, 2008; Schneider and Moritz 1999; Beheregaray 2008; Byrne et al. 2008; Carnaval et al. 2009; Moussalli et al. 2009; Noble et al. 2018; Leaché et al. 2019). Refugia where ectotherms have persisted during climate change can often be characterised as heterogeneous landscapes, in terms of geography, that provide both shelter and an opportunity for the persistence of microclimatic conditions that differ from the surrounding area. For example, local gorges where small water bodies remain can retain humidity and buffer temperatures, providing refuge for amphibian and reptile populations during past periods of aridification in the southern hemisphere (Byrne et al. 2008). Linking the study of past demography with habitat suitability over time can therefore yield important insights on the location and characteristics of regions where populations may potentially persist during contemporary changes in climate.

The role of climate in shaping demographic history

There are now ample examples that demonstrate how changes in climate may have considerable consequences for contemporary ectotherm populations, but a more detailed view on past population dynamics can help to understand how these proximate causes ultimately shape long-term demographic change. For example, it is important to study how climate-induced variation in traits such as thermal regulation, reproduction and development dovetail with demographic changes or stasis during Pleistocene periods of climatic instability. By looking at the past, we can evaluate the relative importance of these key traits for population persistence and decline in an empirical context and use these insights to improve models that predict future population responses to climate change (Brown et al. 2016; Waldvogel et al. 2020). However, even though terrestrial ectotherms are among the most well studied animal groups in terms of systematics and taxonomy, studies that have modelled demographic history remain relatively scarce for most amphibians and reptiles.

Herpetologists have to date, largely focused on the distribution and phylogenetic history of closely related species in a (bio)geographic context (Carnaval et al. 2009; Moussalli et al. 2009; Camargo et al. 2010; Pepper et al. 2011; Edwards et al. 2016, 2022). Phylogeographic studies have improved our understanding on the broad scale evolutionary history of many reptilian and amphibian species and have emphasised the importance of climate in shaping the long-term diversity of ectotherms (Dolman and Moritz 2006; Moussalli et al. 2009; Chapple et al. 2011; Moritz et al. 2012; Singhal and Moritz 2013; Melville et al. 2016; Hawlitschek et al. 2017; Potter et al. 2018; Ansari et al. 2019; Dinis et al. 2019; Dufresnes et al. 2020; Leaché et al. 2020; Ledo et al. 2020; Jaynes et al. 2021). For instance, the distribution of phylogenetic diversity across the landscape has been used to identify geographic regions of long-term evolutionary persistence (refugia) and their role in promoting speciation. Such methods are particularly powerful in a comparative framework, when phylogeographic patterns across many species are used to identify regions with a relatively high proportion of unique lineages (endemism; Dolman & Moritz 2006; Moussalli et al. 2009; Fujita et al. 2010; Rosauer et al. 2018).

Phylogeographic inference has been an important tool to study the long-term consequences of climatic variation on ectotherm diversification, but may be less suited to understand the interaction between recent shifts in climatic variables, phenotypic responses and associated changes in demography for specific populations and species. Phylogeographic methods largely depend on nucleotide substitutions, for example fixed differences between populations, and are therefore less accurate when studying more recent changes in population size (Edwards et al. 2016, 2022). However, major changes in climate have occurred since the Pleistocene and have certainly affected many ectotherm populations to varying degrees (Araújo et al. 2008). Understanding to what extent climate dependent fitness traits and changes in climatic variables directly drive demographic change, is an important prerequisite to accurately estimate the resilience of individual populations and species under current models of future change. We will therefore conclude this Review with a brief primer into demographic inference, give an overview of the type of data that is commonly used for terrestrial ectotherms to infer demography, discuss opportunities and challenges of these frequently used approaches and summarise how recent technological advances in sequencing methodology now set the stage for studying demographic history across a broader temporal continuum in many ectotherm groups.

Inferring population dynamics using genome-reduction data

To predict how contemporary changes in climate may affect extant populations, the study of long-term processes that shape phylogeographic diversity needs to be coupled with in-depth analyses that evaluate how more recent (e.g. < 1 MYA) variation in climate have led to demographic change. Traditionally, population parameters such as effective population size, population connectivity and divergence times, were estimated based on a small number of loci and quantified by comparing how a given summary statistic deviated from an equilibrium model (Tollis et al. 2012; Salmona et al. 2019). These estimates could vary substantially due to the widespread variation in coalescent rates between loci (Salmona et al. 2019). The accuracy of demographic parameter estimation has benefited substantially from the introduction of high-throughput sequencing (HTS) with recent models based on thousands of independently evolving loci (Beichman et al. 2018).

With large-scale genomic datasets emerging, many recent demographic studies in ectotherms have largely relied on changes in the site-frequency spectrum (SFS) to model population dynamics. The SFS is the distribution of allele frequencies at polymorphic sites and is calculated for a given population of interest (Salmona et al. 2019; Bourgeois and Warren 2021). Changes in effective population size will influence the expected distribution of allele frequency counts and therefore the overall shape of the SFS (Bourgeois and Warren 2021). For example, under a neutral evolution model, an expanding population has a higher number of low-frequency variants, compared to a population of constant size. In contrast, a population that has recently undergone a bottleneck will have a deficiency in low-frequency variants. Moreover, correlations between the SFS of individual populations can be levied to quantify the degree of shared history (i.e. 2D-SFS or joint-SFS; Salmona et al. 2019). Model based inference (Sousa and Hey 2013) can be employed to compare the observed SFS to an expected SFS (e.g. based on coalescent simulations) and identify a population model that best fits the data. Likelihood-based methods for model comparison, such as Fastsimcoal2 (Excoffier et al. 2013) and dadi (Gutenkunst et al. 2009), are popular but can be computationally taxing when the number of possible models is large and parameter estimation needed. Approximate Bayesian Computation (ABC, Beaumont et al. 2002) provides another framework for model comparison and is a versatile approach that can utilise various kinds of summary-statistics (e.g. Fst). More recent approaches, such as machine learning algorithms like random forest, include training simulations to predict the best model that fits the observed data. Random forest approaches can be used within ABC frameworks and significantly reduce computing effort (Pudlo et al. 2016; Schrider and Kern 2018).

To date, demographic inference in ectotherms has largely focused on methods that evaluate changes in the SFS or other summary-statistics, due to a general lack in genomic resources for most amphibians and reptiles. Genome reduction approaches, such as double-digest RAD-sequencing (ddRAD; Peterson et al. 2012) or sequence-capture (Faircloth et al. 2012; Lemmon et al. 2012; Jones and Good 2016), have provided an effective alternative to generate large-scale datasets of orthologous loci when reference genomes are lacking or when genome sizes are large (as is the case for some amphibian species). RAD-sequencing methods use cut-site specific restriction enzymes and orthologous fragments can be retrieved when the distribution of cut-sites across the genome is relatively similar between populations (Baird et al. 2008; Harvey et al. 2016). Sequence-capture methods target conserved loci of the genome (such as exons or ultra-conserved elements) across close or distantly related taxa (Harvey et al. 2016). Genome reduction approaches yield 100 s to 1000 s of unlinked orthologous loci which, in comparison to traditional sequencing approaches, increases the statistical power to differentiate between models and benefits the accuracy of parameter estimation. For instance, while a few hundred unlinked loci may suffice to differentiate between distinct demographic scenarios, such as population expansion or contraction (Prates et al. 2016; Afonso Silva et al. 2017; Potter et al. 2018), large numbers of loci may be needed for complex multi-population models or when simultaneously quantifying population parameters such as divergence time, population size or gene flow (Portik et al. 2017; Nguyen et al. 2019; Farleigh et al. 2021; Thörn et al. 2021; Wen and Fu 2021). By coupling genome-reduction with model-based inference, demographic studies have been able to test the directionality of colonisation (expansion) into different geographical regions, such as the expansion of populations of the common toad, Bufo bufo, in Sweden (Thörn et al. 2021). Moreover, these studies have been able to quantify the symmetry and amount of gene flow between populations and estimate general changes in population size, as in the study of Wen and Fu (2021), where populations of green odorous frogs, Odorrana margaretae, from western China have come into secondary contact at several points along their distribution after initial isolation. In addition, comparative methods that quantify the degree of synchrony in demographic dynamics between populations have been developed (Xue and Hickerson 2017). This is especially relevant for co-distributed populations that have diversified or persisted under similar climatic or ecological conditions, such as Anolis species found in the Amazonian and Atlantic Forest, for which idiosyncratic responses to common change in climate have been found (Prates et al. 2016). This also reiterates the importance of studying these dynamics at a species- or lineage-specific level. However, notwithstanding their important contribution in advancing our understanding of past population dynamics, it is worthwhile to recognize the limitations of SFS or summary-statistic based inference and discuss how other data types and inference approaches may mitigate some of these challenges.

A genome-wide view on demographic history

While model-based inference using SFS or summary-statistics is well suited to study very recent changes in population history, these approaches generally tend to be less accurate when inferring demographic dynamics over longer time scales (Fig. 2). The inference of older dynamics can be confounded when recent demographic history overrides previous changes in the SFS and thus leads to the saturation of sites in the SFS relative to more ancient processes (Liu and Fu 2015; Lapierre et al. 2017; Patton et al. 2019). To study demographic history over longer time scales, a distinct suite of methods that model the temporal distribution of coalescent histories may be more appropriate. For example, a recent empirical evaluation by Patton et al. (2019) demonstrated how sequentially Markovian coalescent (SMC) approaches are more accurate when inferring demographic patterns between 300 and one hundred thousand generations before present (gbp) whereas SFS based approaches are more reliable up to 30 gbp. In other words, coalescent based methods such as the SMC and allied approaches can complement methods that rely on the SFS alone and represent an important suite of tools that are more useful for studying demographic dynamics in ectotherms across the Pleistocene.

Fig. 2
figure 2

Inferring evolutionary history along the “phylogeographic-demographic” continuum. Data types and inference approaches vary in their suitability for inferring evolutionary history across time. Gradient lines under data types and methods roughly illustrate where each type of molecular marker or method excels. While an approximate timeline is provided, exact boundaries depend on generation time, effective population size, mutation rate, etc. Important to note is that methods based on coalescent based models (marked with * in the figure), such as Relate, MSMC, PSMC and SMC +  + , require whole-genome data as input, and for most of these methods, high quality genomic data and the availability of a good reference genome is required. Finally, the Analyses section illustrates the most common inference outcomes for each of those models. For a more detailed overview of population genetics methods refer to Bourgeois and Warren (2021)

SMC approaches are based on coalescent theory which is a statistical framework that can relate changes in population size to the frequency of coalescent events over time (Kingman 1982; Mather et al. 2020). The rate of coalescence, when two lineages/haplotypes combine to become one ancestral lineage, is inversely correlated to population size under a neutral model since coalescent events are more likely to occur when populations are small. Since recombination breaks linkage between loci, each diploid genome contains many independently evolving tracts and the coalescent time of two alleles within each tract can vary. SMC based methods use a hidden-Markov model (HMM) to work their way across genomes, identify recombination events and record the distribution of coalescent times at a genome-wide scale. For diploid species with recombining genomes, a single genome can already contain a large number of individually evolving tracts and the corresponding coalescent variation between tracts can be used to infer demographic change over time. The Pairwise Sequentially Markovian Coalescent (PSMC; Li & Durbin 2011) approach uses single (unphased) genomes for estimating past demography and has now been widely used in a diverse array of organisms (Mather et al. 2020) for which whole-genome (resequencing) data is available. With only two alleles from a population sampled, the accuracy of inferring recent change is often limited however due to a lack of coalescent events closer to the present (Beichman et al. 2018; Mather et al. 2020). The Multiple Sequence Markovian Coalescent (MSMC/2) partially bypasses this by enabling the inclusion of multiple genomes but requires genomes to be phased (Schiffels and Durbin 2014). While the use of multiple genomes improves the accuracy of inferring size changes in the very recent past, accurate phasing can be challenging in non-model organisms and the method itself is computationally demanding which limits the number of genomes that can be simultaneously analysed. Since the introduction of PSMC and MSMC, mitigating these challenges has been a major area of development. For example, SMC +  + (Terhorst et al. 2017) uses both linkage information (coalescent HMM) as well as the SFS, to accurately model demographic change across a longer time span. Moreover, SMC +  + allows the use of many unphased genomes, limiting the effects of phasing errors, and can estimate recent effective population sizes with higher resolution than MSMC and PSMC (if sufficient samples available; Patton et al. 2019). Other promising approaches still require data to be phased, but can now scale up to thousands of samples (e.g. TSinfer, Kelleher et al. 2019; Relate, Speidel et al. 2019). All the aforementioned methods (SFS-based, ABC and SMC) assume that populations are neutrally evolving, however discerning between natural selection and demographic events can be challenging, as both processes can lead to similar patterns of genetic variation (Li and Durbin 2011; Schrider and Kern 2018; Beichman et al. 2018; Marchi et al. 2021). This may be particularly important for organisms such as amphibians and reptiles that have faced strong selective pressures in a scenario of climate change. Genome-wide datasets are beneficial in such instances because they allow for the exclusion of loci that may be under selection and focus on neutrally evolving loci to infer demographic history. For example, loci in low-recombination regions can be filtered out since they are often undergoing linked selection and exons may be less suited than intergenic regions (Beichman et al. 2018). Notwithstanding known challenges of accurately inferring demographic history due to confounding biological processes (e.g. population structure, selective sweeps, migration after divergence, etc. Schrider and Kern 2018; Beichman et al. 2018; Salmona et al. 2019; Sellinger et al. 2020, 2021; Spence et al. 2018), the use of SMC based methods has taken flight in recent years with the increasing availability of genome-wide datasets and complements our ability to accurately infer demographic history across a broader range of time scales.

For those species where whole-genome data is available, birds and mammals in particular, SMC and allied methods have been widely used to study the demographic consequences of environmental change. For example, SMC approaches have been used to estimate fluctuations in effective population size in relation to glacial cycles throughout the Quaternary (brown bears, Ursus arctos and polar bears, Ursus maritimus: Miller et al. 2012; birds: Nadachowska-Brzyska et al. 2015; Natesh et al. 2020; Eurasian lynx, Lynx lynx: Lucena-Perez et al. 2020; African golden wolves, Canis lupaster: Sarabia et al. 2020; bottlenose dolphins, Tursiops truncatus and Tursiops aduncus: Vijay et al. 2018; humans: Li and Durbin 2011). Contrasting population trajectories can reveal differences in the capacity of species to couple with local environmental change, even among closely related lineages, such as in the case of bottlenose dolphins (Vijay et al. 2018), African golden wolves (Sarabia et al. 2020) and walnut trees (Bai et al. 2018). These idiosyncratic responses can be further investigated to evaluate the role of ecological specialisation in mitigating climatic change, as Natesh et al. (2020) for example observed in their study on two Eurasian owlet species, Athene brama and Glaucidium radiatum, where the population size of species associated to open habitats followed the expansion and contraction of their habitat until the Mid-Holocene, whereas forest adapted species were not affected by climate-induced changes in vegetation. Similarly, geographic history and ecological specialisation have very likely played a role in the demographic history and diversification of Anolis lizards in Cuba, in which idiosyncratic trends in population size changes between ecomorphs and between thermal habitat specialists are likely due to habitat change caused by the varying timing of inundation of lowland areas during the mid-Pleistocene (Kanamori et al. 2022). Moreover, SMC methods have also proven to be highly valuable when studying the role of changing climate in historic population fluctuations of threatened and extinct taxa (Leitwein et al. 2020) where sample size is limited, such as the extinct woolly mammoth, Mammuthus primigenius (Palkopoulou et al. 2015). Studies modelling historical demographic responses to past climate based on genome-wide linkage and coalescent information have demonstrated their potential, but their uptake for quantifying demographic change in ectotherms remains limited to date due to a lack of high-quality reference genomes.

Reptiles and amphibians are among the most species rich groups of vertebrates but the relative number of species with a sequenced and annotated genome likely remains below 1% (Hotaling et al. 2021). While the availability of high-quality genomes is scarce across many vertebrate groups, the lack of genomic resources for reptiles and amphibians is particularly glaring given their extraordinary richness in species number and evolutionary diversity (Card et al. 2023). This scarcity in reference genomes can partially be attributed to the technical challenge of assembling reptilian and amphibian genomes. For example, amphibians tend to have larger genomes than most vertebrates and on average have a higher proportion of repetitive sequences which complicates assembly (Canapa et al. 2016). However, genome size actually varies a lot between amphibians (Liedtke et al. 2018) and, while the assembly of the 32 Gb. axolotl genome has been a major challenge (Smith et al. 2019), some amphibians have genome sizes that are relatively modest (e.g. the 1 Gb. genome of the ornate burrowing frog Platyplectrum ornatum; Lamichhaney et al. 2021). Moreover, the archetypal squamate genome is less than double in size (1.3–2.8 Gb; Pasquesi et al. 2018) of the average avian genome and smaller than most mammalian genomes. Nonetheless, to date, there are still only 59 amphibian and 130 reptilian genomes publicly available in NCBI (https://www.ncbi.nlm.nih.gov/genome last accessed on September 5th, 2023), in comparison to more than 760 birds and 720 mammals, and many remain highly fragmented and/or unannotated.

Powered by technological development and large-scale sequencing initiatives, such as the Earth BioGenome Project, the Genome 10 K consortium, the European Reference Genome Atlas and the Vertebrate Genomes Project, the number of high-quality amphibian and reptilian genomes will soon be a better reflection of the underlying species diversity among terrestrial vertebrates. Long-read sequencing (LRS) platforms, such as Oxford nanopore technologies (ONT) and Pacific biosciences (PacBio), now generate reads that can span some of the most complex genomic regions (Mao and Zhang 2022) and methods to infer chromatin-interaction maps (e.g. Hi-C, Lieberman-Aiden et al. 2009) can be used to construct chromosome models. These approaches offer a cost-efficient way to assemble larger, more heterogeneous and repetitive genomes and can now even be effectively accomplished by a single research group (rather than large genome consortia). For example, recently published chromosome-scale reference genomes for ectotherms include the brown anole, Anolis sagrei (Geneva et al. 2022), the desert horned lizard, Phrynosoma platyrhinos (Koochekian et al. 2022), the western spadefoot toad, Pelobates cultripes (Liedtke et al. 2022), two caecilian species: the Gaboon caecilian, Geotrypetes seraphini and Microcaecilia unicolor (Ovchinnikov et al. 2023) and two lizard species that are extinct-in-the-wild: the Christmas Island blue-tailed skink, Cryptoblepharus egeriae, and Lister’s gecko, Lepidodactylus listeri (Dodge et al. 2023). The increasing adoption of LRS accelerates the generation of reference genomes, which will enable the use of a wider suite of demographic analyses and eventually benefit the accuracy of demographic inference. Increasing read lengths will ease the ability to phase data and reconstruct both haplotypes of the same chromosome in diploid organisms. LRS has the potential to reduce the error associated with statistical phasing and will therefore improve demographic studies that depend on linkage disequilibrium (LD) and recombination estimation. Thus, the simultaneous development of inference methods that model coalescent variation at a genome wide scale, the integration of sequencing technologies that ease the generation of high-quality genomes and phased resequencing data, will allow us to study the role of climate in driving population dynamics in reptiles and amphibians across the Pleistocene in an unprecedented detail. These analyses will complement our understanding of how recent climate-induced changes in population dynamics dovetail with macroevolutionary (phylogeographic) patterns and will ultimately allow us to estimate how climate dependent fitness traits have shaped demographic change during recent changes in climate.

Conclusion and perspective

Climate change will have far reaching consequences for Earth’s biodiversity and the climate change resilience of amphibians and reptiles is of particular concern. In this review, we have synthesized the myriad of ways that environmental change can have a direct impact on terrestrial ectotherm populations and discuss their potential vulnerability in the face of future climate change. Studying how amphibians and reptiles have responded to changing conditions in the past, is a promising avenue to identify how these traits and climatic variation have ultimately shaped demographic history throughout the Pleistocene. However, while the evolutionary consequences of climate change have largely been studied in a phylogeographic context, the number of studies focusing on demographic change remains relatively limited. With an increasing ease to assay genetic variation at a genome-wide scale, we then provided a short primer on the most frequently used methods to generate and utilise genomic data for demographic inference and relate this to empirical work presented thus far. One major limitation that has prevented the uptake of such approaches is the relative lack of genomic resources for many amphibian and reptiles. Given their sensitivity to environmental perturbations, we therefore call for a more balanced focus among vertebrates and encourage the much-needed development of genomic resources for almost all ectotherm groups. This effort will greatly benefit from recent advances in long-read sequencing and even modest sized research groups can now produce high-quality assemblies for many amphibian and reptilian species. By both emphasizing the marked sensitivity of ectotherms to climate change, as well as the need for detailed studies quantifying demographic history, we have aimed to bridge the gap between herpetologists and population geneticists, and spur future studies into the demographic history of species groups that to date have been relatively neglected in comparison to other terrestrial vertebrates.

A high-resolution model of past population dynamics throughout the Pleistocene can then be coupled with recent estimates of climatic variation over time and space. Ecological Niche Modelling and paleoclimate data are now frequently combined to estimate the distribution of suitable habitat over time and are continuously improving with the integration of more sophisticated model prediction algorithms (e.g. Machine Learning). Traditionally, there has been a temporal mismatch between paleoclimate modelling and the time scale where phylogeographic studies excel. Contemporary demographic models are better suited to model population change during the same time span and increase our ability to identify biologically relevant correlations between environmental variables and changes in population dynamics. We argue that ectotherms are particularly suited for such investigations due to their direct physiological dependence on external conditions and sensitivity to environmental perturbations. Simultaneously, such empirically informed models are urgently needed to predict how contemporary populations of amphibians and reptiles will ultimately fare in the rapidly changing environment of the twenty-first century.