{'fraction_non_alphanumeric': 0.027814963557935446, 'fraction_numerical': 0.013386880856760375, 'mean_word_length': 4.930608644516319, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Differential responses to thermal variation between fitness metrics

Temperature is a major factor affecting population abundance and individual performance. Net reproductive rate (R0) and intrinsic rate of increase (r) differ in their response to different temperature regimes, and much of the difference is mediated by generation time (Tg). Here, we evaluate the effects of thermal mean and variability on R0, r and Tg, at four population densities in Drosophila melanogaster. The results show that R0, r and Tg present differential responses to thermal variation. Although temperature effects on R0 and Tg are non-linear, r response was negligible. R0 and Tg comprise a generational time scale, while r is at a chronological time scale. Thus, we argue that individuals growing under different thermal environments perform similarly on a chronological scale, but differently on a generational scale.

Temperature is a major factor affecting population abundance and individual performance. Net reproductive rate (R 0 ) and intrinsic rate of increase (r) differ in their response to different temperature regimes, and much of the difference is mediated by generation time (Tg). Here, we evaluate the effects of thermal mean and variability on R 0 , r and Tg, at four population densities in Drosophila melanogaster. The results show that R 0 , r and Tg present differential responses to thermal variation. Although temperature effects on R 0 and Tg are non-linear, r response was negligible. R 0 and Tg comprise a generational time scale, while r is at a chronological time scale. Thus, we argue that individuals growing under different thermal environments perform similarly on a chronological scale, but differently on a generational scale. E nvironmental temperature varies in time and space at different scales and its influence is complex, involving interactions between mechanisms and processes at different levels of ecological organization 1 . Physiology, behavior, population dynamics, and interactions with other species depend, to different degrees, on the thermal environment surrounding the organism 2 . In this context, the effect of temperature on several demographic parameters of ectotherms is well known [2][3][4][5][6] , as well as how their combined effects impact population dynamics and viability (i.e. [7][8][9] ).
The relationship between environmental temperature and performance has been commonly described as a unimodal and asymmetric function, with a gradual increase as temperature reaches a maximum (the optimal temperature, T opt ), and then an abrupt decay beyond this peak 1,2,4,10,11 . Nevertheless, some studies have proposed that the effects of mean temperature and thermal variance may lead to more complex responses in performance curves. In this regard, Estay et al. 11 have suggested that performance could be affected either positively or negatively by temperature, depending on the specific thermal mean. Different measures of performance are available, but demographic parameters deserve special attention. They allow us to establish a direct link between individual performance and population properties, such as viability, equilibrium density 12,13 or the expected pattern of fluctuations 6,11 . The most common demographic parameters used as proxies of fitness or performance are R 0 and r. R 0 is the average number of offspring produced by an individual during its lifetime. The intrinsic rate of natural increase, r, is the rate at which the population increases by time step. As can be observed, the main difference between these two measurements is time scale, generational and chronological, respectively. This difference is contained in a third measurement, the generation time (Tg), which is estimated as the average time between the birth of a female and the birth of her first female offspring. Despite their applicability as measurements of fitness, Pásztor, et al. 14 and Koz owski 15 pointed out that the use of demographic parameters in life history studies needs to be taken with caution, because each parameter must be interpreted in its own context and is constrained by its own assumptions. Thus, these parameters must be used under limited conditions. For instance, R 0 must be used when the state of the trait under study, o, is fixed along an individual's lifetime. Contrarily, r is an accurate measure of fitness when the state of an individual changes from year to year 14 . These restrictions have profound consequences in the design of experiments, the interpretation of results obtained in the laboratory, and their extrapolation to field conditions. In a comprehensive study, Huey and Berrigan 3 showed that net reproductive rate (R 0 ) and intrinsic rate of increase (r) differed in their response to different constant temperature regimes, and that much of this difference was mediated by generation time (Tg). For instance, among ectotherms, the optimal temperature for r is generally higher than that for R 0 . Despite these advances, there are at least two important factors that need to be included in further analyses to increase the accuracy of experimental treatments and to improve the predictive ability of laboratory models. The first factor is the incorporation of thermal variability in laboratory experiments as a way to better mimic field conditions. The importance of mean temperatures is widely recognized, but thermal variability could be a factor as important as average values, and could also be a strong selection force acting on organisms in the wild 2,16,17 . Previous efforts have focused on the effects of temperature and variability through short and repeated exposures to stressful temperatures 2,19 . Thus, the effect of thermal variability over longer periods of time has received less attention (but see 20,21 ). The second factor is population density and its potential interaction with environmental variables, which could generate a combined effect on demographic parameters (see 22 ). Environmental factors such as temperature may influence population parameters in different ways, and the net effect could be mediated by density. According to Royama 22 , temperature could modify population parameters through nonlinear changes in both fecundity and mortality.
We attempt to go beyond current efforts and address the combined impact of mean temperature, thermal variability and population density on demographic parameters of Drosophila melanogaster. This species constitutes a good model to test hypotheses on the impacts of thermal change because its responses to environmental temperature are well known [23][24][25] . To this end, we experimentally investigated the effects of these factors on the fecundity and survival of adult fruit flies during their entire life cycle.

Results
Our experimental results show that mean temperature, variability, and population density all had clear effects on demographic parameters. Values of R 0 showed a decrement with increasing temperature, and this reduction was greater when we incorporated a 65uC in variability ( Figure 1, top panels). The effect of density is also clear: R 0 values were lower at high population density ( Figure 1, top panels). In the case of generation time, a decrease in Tg with increasing temperature was also the pattern, and again the reduction was larger in the scenario of 65uC ( Figure 1, panels C and D). On the other hand, population density caused a slight increment on Tg at both 17uC and 24uC treatments ( Figure 1, panels C and D). Finally, r values increased with temperature, but variability did not have an effect on the magnitude of change (Table 1). Here, the effect of density was quite similar between both treatments, with a clear decrease in the magnitude of r with an increasing density ( Figure 1, panels E and F).
The best model (higher BIC weight) for R 0 included effects of mean temperature (Tm), thermal variability (Tv) and interactions between Tm and Tv, and between population density (D) and Tm (Table 1). This model explained .45% of the variance in the experimental data (Table 1). D and Tm showed a negative relationship with R 0 , which was intensified by variability ( Figure 1, panels A and B). Temperature variability per se showed a complex effect on R 0 . Below a mean temperature of 17uC the effect was negligible or positive (see blue lines in Figure 1B), while at 24uC, the effect was negative (see red lines in Figure 1B).
In the case of Tg, the model with the highest BCI weight included effects of Tm, Tv and interactions between Tm and Tv, and between D and Tm (Table 1 and Supplementary information). This model explained a large proportion of the variance (76%). Tg showed a positive relationship with D, but a negative one with Tm ( Figure 1, panels C and D). On the other hand, thermal variability had an effect on Tg quite similar to the effect on R 0 : below a mean temperature of 20uC the effect was positive, but it was negative above this value (Table 1 and Supplementary information).
Finally, the best models for r showed a different structure from other population parameters. These models only contained interactions between Tm and Tv with D, and explained 49% of the variance (Supplementary information and Table 1). No effect of either Tm or Tv alone was retained in the model ( Table 1). The effect of the interaction between D and Tm was strongly nonlinear as can be seen from the high value of the apparent degrees of freedom ( Figure 1E and F, and Supplementary Information). However, the effect of the interaction between D and Tv was so weak that it was almost undetectable, while removing this term from the model did not improve the results (no changes in BIC, see Table 1). Overall, the relationship between r and D was negative, and positive between r and Tm. Tv had no significant effects on r values according to the best models ( Figure 1E and F, and Supplementary information).

Discussion
Our results show how the complex interaction between mean temperature, thermal variability, and population density determine observed values in demographic parameters. Specifically, our results show that r and R 0 not only respond differently to the average thermal environment, but that the magnitude and directionality of this difference is modulated by thermal variability and population density (Table 1 and Supplementary information).
The response of R 0 is nonlinear due to D and Tm -Tv interactions (see the best model in Table 1). Our model shows that at 17-18uC there is a pivotal point where thermal variability has no effect, but that below and above this value, thermal variability causes falls and rises in fitness, respectively. Individuals or populations living in thermal environments with mean temperature below the pivotal point increase the number of their progeny as thermal variability increases, whereas above this point, the number of progeny decreases with thermal variability.
Regarding Tg, there is also a pivotal point around 20-22uC, depending on density, where variability above and below that point causes rises and falls in performance; a similar pattern with respect to R 0 (Supplementary information). According to the best model (Table 1), the average age of reproduction, Tg, in thermal environments above the pivotal point comes earlier in the lifetime of individuals at higher levels of thermal variability; but below this point it is delayed if variability in temperature increases.
The above results are in line with the predictions of Estay, et al. 11 and Bozinovic, et al. 2 . These authors showed that the inflexion point in the thermal performance curve --slightly below the thermal optimum --is where the expected effect of variability is nil. Considering that the ranges of pivotal points are slightly below the thermal optimum for D. melanogaster 2,25,26 , they could be close to the predicted inflexion point in the thermal performance curve 11 .
The results concerning r were surprising. According to the best model, the effect of thermal variability is negligible, despite the strong non-linear effect of density. This suggests that changes in R 0 and Tg caused by thermal variability cancel each other out, resulting in a similar daily rate of increase under either scenario of variability. Considering that r is a measure of the mean rate of increase at a chronological scale and that r < Ln(R 0 )/Tg, the best model suggests that D. melanogaster individuals with similar r values could show larger (shorter) Tg and more (less) numerous progeny, depending on the stability of the thermal environment. The endresult is that individuals growing under different thermal environments, in terms of variability, could perform similarly at a chronological scale, but differently at a generational scale. That is, reinforcing the conclusions of Pásztor, et al. 14 and Koz owski 15 about the different uses of each parameter and their interpretation.
Nevertheless, this last statement is contrary to results obtained in previous studies or the theoretical explanations for the interplay between these three parameters 11,26 . It has been suggested that in stochastic environments species tend to maximize r to take advant-www.nature.com/scientificreports SCIENTIFIC REPORTS | 4 : 5349 | DOI: 10.1038/srep05349 age of short, unpredictable opportunities for reproduction. Due to this, it is expected that species follow the least expensive route to fitness maximization, and theory predicts that a reduction in average age of reproduction is more efficient than producing more offspring 27,28 . The reason behind this difference with theoretical predictions could lie in our experimental design, the restricted range of temperatures used, or our assumption of linearity in evaluating temperature effects.
New questions arise from our results, such as what are the expected changes at an evolutionary scale in a variable thermal scenario? In this regard, and despite having neither direct evidence of individual plastic responses nor heritability of this trait, we may speculate that, considering the genetic homogeneity of this Drosophila strain, an important part of the observed response could be linked to phenotypic plasticity. However, this assumption should be taken with caution until new evidence is available, supported by adequate experiments.
Evolutionary biology and theoretical demography have provided insights into the potential effects of environmental variability on individual fitness and population dynamics, respectively 29 . The main message is that physiological performance and population dynamics in variable environments may be substantially different compared to those obtained from experiments or models that assume constant environments 2,11,30-34 .

Methods
We used Oregon RC strain fruit flies from a laboratory stock that was reared at 24uC in 250 mL bottles with 30 mL of Burdick 35 culture medium. The aim of this study was to analyze the interaction between population density and environment temperature, and its effects over fitness. Species-specific response to temperature has been widely addressed in the literature 18,36,37 . This strain of D. melanogaster was cultured for several generations under laboratory conditions, and it was selected to describe the effects of the factors of interest (population density and environmental temperature) over fitness without strong influence of genetic variability. After CO 2 anesthesia, newly emerged adults were collected from the stock, and were immediately sexed and acclimated for 15 days in 47 mL sterilized glass vials in their respective treatment (see below) on a 12 L: 12 D photoperiod regime. During the acclimation period, males and females were kept in different vials to avoid reproduction. R 0 estimates may be biased because the reproductive peak in Drosophila happens during the first days after hatching. However, Dillon et al. 38 showed that this peak occurs during the first three days and thereafter oviposition is stabilized. The total number of eggs during the entire peak was less than 100 at 25uC and 50 at 18uC 38 . Considering this information, it is difficult to think that missing this peak in fecundity could affect an R 0 estimation     26 . In addition, the same thermal treatments have been used in previous studies 2 . We prepared five glass vials (cohorts) with 11 g of culture medium per density and thermal treatment with the same number of virgin females and males (sex ratio 151). Photoperiod regime was 12 L: 12 D. Every three days, the vials were checked to determine the number of dead flies and to replace the culture medium until complete mortality of the cohort. To estimate fecundity, we counted the number of eggs (hatched and non-hatched) from the removed medium. In some cases, when we removed the medium from some vials, larvae and buried eggs could be seen in the medium. For this reason, and in order to ensure an accurate estimation of fecundity, we completely disaggregated the medium to count all eggs.
Statistical analysis. A Lotka life table (sensu Carey 39 ) was constructed for each replicate to estimate net reproductive rate per generation (R 0 ), generation time or average age of reproduction (Tg), and intrinsic rate of increase (r) using standard procedures (described by Carey 12 ). Specifically, we constructed the life table for each cohort by using fecundity (m x ) and the proportion of the surviving individuals at stage x (l x ) from the original number of individuals. Thus, we estimated R 0 , r and Tg as R 0 5 P l x m x , by Tg 5 P 3 l x m x /R 0 , and r < Ln(R 0 )/Tg. This last equation is an approximation of r, the intrinsic rate of natural increase, that works acceptably when R 0 < 1 or when Tg shows little variation 40 . These three variables were analyzed separately to obtain the effect of thermal regime on each life-history trait.
To obtain the global response of each variable to density, mean temperature, and variability, we performed a nonparametric regression analysis using a generalized additive model (GAM) incorporating population density (D), mean temperature (Tm), and thermal variability (Tv) as predictors. We chose to use GAM because this method does not make a-priori assumptions about the shape of the relationship between the variables of interest, which is key in our evaluation of the effect of population density. Moreover, the main difference between GAMs and linear models is that linear functions of the variables in GAM are replaced by unknown smooth functions, giving additional flexibility to the modeling process 42 . Considering our experimental design and to avoid over-parameterization, we used linear predictors for mean temperature (Tm) and thermal variability (Tv); however, for population density a partial cubic spline function was used, since it is well known that densitydependence functions exhibit nonlinear forms 22 . The complexity of the curve (the number of degrees of freedom) and the smoothing terms were determined by penalized regression splines and generalized cross-validation (GCV [41][42][43][44] ) to avoid overfitting 43 . Also, we permitted shrinkage of the smoothers. This technique allows for extra penalty to be added in the model, and if the penalty is high enough, it will shrink all smoothing coefficients to zero. In simple words, the effect of the variable is removed from the model (a procedure similar to the stepwise variable selection) 43 .
Regarding the response variables, for R 0 and Tg we used Gaussian error distribution with natural logarithm as the link function during the model fitting process, while for r we used the identity function as link. Several models with and without interactions between predictor variables were evaluated. Models were fitted in the R environment (R Development Core Team, 2013. R: A language and environment for statistical computing) using packages stats and mgcv 42 , and ranked according to the Bayesian Information Criterion (BIC or Schwarz Criterion 45 ). For clarity, BIC weights were also included in the results. BIC weights are the probability of each model being the best, given the set of models.