DOI: 10.5061/dryad.mcvdnck7z
title: Data and code from: Assessing the effect of experimental evolution under combined thermal-nutritional stress on larval thermotolerance and thermal plasticity in Drosophila melanogaster

description: Animals commonly face combinations of thermal and nutritional stress in
 nature, which will intensify under climate change. While genetic
 adaptation is necessary to buffer long-term stress, it’s unclear whether
 adaptation to combined stress can occur without compromising viability and
 thermal plasticity. We tested larval thermotolerance and thermal
 plasticity in Drosophila melanogaster selected under different
 temperatures (18°C, 25°C, and 28°C) and diets (standard, diluted, and
 low-protein:high-carbohydrate [P:C]). Basal larval cold tolerance was
 affected by both protein concentration and temperature; larvae evolved
 higher basal cold tolerance on the diluted and low P:C diets at 18°C and
 28°C. Hardening increased cold tolerance for most lines, except those
 selected at 18°C and 28°C on low P:C diets and at 25°C on standard diets.
 Basal larval heat tolerance was affected by selection temperature;
 selection at 25°C increased heat tolerance. An interaction between
 selection temperature, selection diet, and hardening treatment affected
 larval heat tolerance; hardening reduced heat tolerance in most lines,
 except those selected at 25°C on low P:C diets and at 28°C on standard
 diets. Our results suggest that adaptation to combined stress allows basal
 cold tolerance and its plasticity to co-evolve, but not heat tolerance,
 highlighting ectotherm’s vulnerability to long-term climate change.
description: <em>Fly stock – Collection and initiation of experimental
 evolution lines</em> Two hundred female
 <em>D. melanogaster </em>were collected in Duranbah,
 Queensland (28.3° S, 153° E) in 2018 to initiate isofemale lines (Alton
 <em>et al.</em> 2024). Flies were returned to the laboratory
 and were treated with tetracycline to remove
 <em>Wolbachia</em> (Min and Benzer 1997). Two generations
 after tetracycline treatment, five males and five virgin females from each
 line were used to create a mass-bred base population. A large number of
 isofemale lines were used to maximise genetic variation in the founding
 mass-bred population. The base population was maintained under control
 conditions — at 25°C on the standard diet with 12:12 hour light:dark
 cycles (see below) — across 60 bottles each containing approximately
 750–1000 flies, for two generations before the initiation of selection. It
 is worth noting that, because the mass-bred population was maintained for
 only two generations before the selection experiment, it was most likely
 not fully adapted to laboratory conditions and was therefore not at
 equilibrium. This, in turn, may have contributed to linkage disequilibrium
 in the base (starting) population (e.g. Kellermann <em>et
 al.</em> 2015). That said, we believe that the control lines at
 least would have reached equilibrium by the time of the experiments
 described in this study, given laboratory adaptation occurs relatively
 quickly, and is expected to have stabilised by 7–10 generations (Harshman
 and Hoffmann 2000; Hoffmann <em>et al.</em> 2001). Because we
 used laboratory natural selection (rather than directional selection), it
 is also likely that the selected lines had reached equilibrium by the time
 the experiments were conducted (Sgrò and Blows 2004).
 <em>Experimental evolution regimes and selection
 protocol</em> Eggs were collected from the base
 population and were divided among nine combined thermal-nutritional
 selection treatments with five replicate lines per treatment (Alton
 <em>et al.</em> 2024). These treatments consisted of three
 temperatures (18°C, 25°C, and 28°C) and three diets (standard, diluted,
 and low P:C) (Table S1) under a 12:12 light:dark cycle. Only larvae were
 exposed to selection. All diets contained varying amounts of potato flake,
 inactive yeast, agar, and dextrose, with the addition of nipagin and
 propionic acid to prevent bacterial and fungal growth (Holleley
 <em>et al.</em> 2008) (Table S1). The standard diet had a 1:3
 protein-to-carbohydrate (P:C) ratio (yeast 36.36 g/L) and contained 320
 kcal/L; the diluted diet had a 1:3 P:C ratio (yeast 9.09 g/L) and
 contained 80 kcal/L; and the low P:C diet had a 1:12 P:C ratio (yeast 8.18
 g/L) and contained 320 kcal/L (Table S1). These
 selection conditions reflect combinations of thermal and nutritional
 changes that may be expected in the future under climate change; 18°C and
 25°C represent the current average Australian winter and summer
 temperatures respectively (Alton <em>et al.</em> 2024), while
 28°C represents a 3°C increase of the average summer temperature projected
 in twenty years (Australian Academy of Science 2021). The diluted diet and
 the low P:C diet simulate a reduction of protein and varying carbohydrates
 in plant composition projected under climate change (DaMatta <em>et
 al.</em> 2010), and span the range of nutritional contexts
 experienced by developing larvae in rotting fruit (Matavelli <em>et
 al.</em> 2015; Silva-Soares <em>et al.</em> 2017). The
 25°C standard diet selection regime was used as a control and a reference
 point for further analysis. At the start of each
 generation of selection, each selection replicate line was established
 with three bottles containing 200–250 eggs on 70 mL of selection diets to
 equalize density across all selection regimes. Animals were allowed to
 develop on their respective diet and temperatures until adult eclosion. We
 avoided inadvertent selection on development time by collecting all
 eclosing adults over a 5-day period across selection lines (all adults had
 emerged over a 5-day period, even those lines that took the longest to
 develop). Adults from the same replicate line were mixed and separated
 into two bottles containing the standard diet at 25°C for three days to
 allow mating. On the fourth day, adults were transferred to 250 mL
 egg-laying chambers containing 11 mL of egg-laying medium, the standard
 diet with double the concentration of agar of the standard fly diet and a
 layer of autoclaved yeast for acclimation. We doubled the concentration of
 agar to prevent females from embedding their eggs into the food, making
 egg collection easier. After the 24-hour acclimation, fresh medium was
 provided for egg-laying overnight. The eggs were collected the next
 morning to establish the next generation as described above. This means
 that adults were between 5–10 days old at the time of egg collection, and
 we may therefore have inadvertently selected for early life
 fecundity. At the time of the experiment described
 below, generations of selection were as follows: 61 for the 18°C standard
 diet, 51 for the 18°C diluted and low P:C diets, 89 for the 25°C standard
 diet, 75 for the 25°C diluted and low P:C diets, 100 for the 28°C standard
 diet, 81 for the 28°C diluted diet, and 84 for the 28°C low P:C diet. Due
 to logistical limitations, three replicate lines were randomly selected
 from the five set up for each selection regime to perform the experiment
 described below. Prior to the experiment, all lines were placed in common
 garden conditions at 25°C on a standard diet for at least two generations
 to minimise parental effects (De Villemereuil <em>et al.</em>
 2016). <em>Plastic and evolved shifts in larval
 thermotolerance</em> <em>Experimental set
 up</em> After two generations of common garden
 rearing, adults were transferred to laying plates containing egg-laying
 medium and a surface layer of autoclaved yeast to induce oviposition.
 Laying plates were placed at 25°C for 14 hours to allow egg-laying. Eggs
 were collected from laying plates and transferred to vials containing 7.2
 mL of standard diet, at a density of twenty eggs per vial (Agnew
 <em>et al.</em> 2002). Five replicate vials were set up for
 each replicate line per selection regime. First instar larvae (hatched 24
 hours after egg transfer) were exposed to the hardening and acute stress
 treatments. Vials were maintained at 25°C under 12:12 hour light:dark
 cycles throughout the experiment, except when exposing larvae to the
 hardening and acute stress treatments described below. This common garden
 experimental design enabled us to investigate the effects of genetic
 adaptation to combined thermal-nutritional stress on larval
 thermotolerance and thermal plasticity.
 <em>Assessing induced (plastic) and basal
 thermotolerance</em> Larval cold plasticity was
 assessed by subjecting 24-hour-old first instar larvae, reared from
 embryos at 25°C on a standard diet, to a two-hour hardening treatment in a
 0°C water bath, followed by a 24-hour recovery period at 25°C. After
 recovery, these 48-hour-old larvae were exposed to a four-hour acute cold
 shock at 0°C in a water bath and then returned to 25°C under 12:12 hour
 light: dark cycles to complete development. Basal cold tolerance was
 assessed by exposing 48-hour-old larvae, reared from embryos at 25°C on a
 standard diet, to a four-hour acute cold shock at 0°C in a water bath,
 without prior hardening treatment. The larvae were then allowed to
 complete development at 25°C under 12:12 hour light:dark cycles.
 48-hour-old larvae were exposed to the acute cold shock treatment to
 equalise the stage at which larvae were exposed to the acute stress across
 the hardened and basal treatments. Larval heat
 plasticity was assessed by subjecting 24-hour-old first instar larvae,
 again reared from embryos at 25°C on a standard diet, to a one-hour
 hardening treatment in a 35°C water bath, followed by a 24-hour recovery
 period at 25°C. After recovery, these 48-hour-old larvae were exposed to
 an acute heat shock of 39°C for 30 minutes. Those larvae were then allowed
 to develop at 25°C under 12:12 hour light:dark cycles until adult
 eclosion. Basal heat tolerance was assessed by exposing 48-hour-old
 larvae, reared from embryos on the standard diet at 25°C, to an acute heat
 shock treatment of 39°C for 30 minutes without any hardening treatment.
 They were then allowed to complete development at 25°C under 12:12 hour
 light:dark cycles. A control treatment was also
 included, where vials contained larvae that were not exposed to any heat
 or cold stress treatments and were maintained on control food at 25°C
 under 12:12 hour light:dark cycles until adult eclosion.
 The temperatures and durations for both heat and cold shock
 hardening and acute treatments were determined by pilot experiments
 (details in supplementary materials). Throughout these treatments, all
 vials were temporarily sealed with plastic caps and parafilm to prevent
 water leakage. After adult eclosion, larval-adult viability was
 subsequently measured as the ratio of the number of emerged adult flies to
 the initial egg number deposited in the vials.
 <em>Statistical analyses</em> All
 data analyses and visualisations were performed in R (R Core Team 2024).
 The larval-adult viability data from all treatments were fitted with
 generalised linear mixed-effects models with a binomial distribution using
 the <em>lme4 </em>package (Bates <em>et al.</em>
 2015). All model weights were set to the number of eggs deposited per vial
 (20 eggs). To test for the effects of long-term
 selection under combined thermal-nutritional stress on larval-adult
 viability under control (25°C standard diet) conditions, selection
 treatments (combinations of selection temperature and diet) were included
 as a fixed effect, while block (the day that eggs were picked to set up
 the experiment) and replicate line were included as non-nested (crossed)
 random effects to account for variation between blocks or variation among
 replicate lines; these random effects were included to improve model
 accuracy but were not tested for statistical significance (Bates
 <em>et al.</em> 2015). To test for the
 effects of selection on larval basal thermotolerance and thermal
 plasticity, selection temperature, selection diet, hardening treatment
 (hardened and non-hardened), and their three-way interaction were included
 as fixed effects. Block and replicate line were treated as non-nested
 (crossed) random effects to account for any effect of block or variation
 among replicate lines; these random effects were not tested for
 statistical significance (Bates <em>et al.</em> 2015).
 Interactions between the random and fixed effects were also not tested
 because they were not core to our question.
 Significance of the fixed effects was assessed using ANOVA using
 the <em>car </em>package (Fox <em>et al.</em>
 2001), which uses the Wald Chi-square test to generate p-values for the
 fixed effects (Bolker <em>et al.</em> 2009; Rebolledo
 <em>et al.</em> 2023). Post hoc multiple comparisons were
 performed using the <em>emmean</em> package (Lenth 2023) to
 test for significant differences in larval-adult viability across levels
 of each factor. To quantify the amount of variation in the data explained
 by our models, we estimated conditional R<sup>2</sup> values
 which take both fixed and random effects in the model into account
 (Nakagawa <em>et al.</em> 2017) using the
 <em>MuMIn</em> package (Nakagawa and Schielzeth 2013), since
 traditional measures of effect size are not applicable to generalised
 linear mixed models (Nakagawa <em>et al.</em> 2017).
description: # Data and coding files for: **Assessing the effect of experimental
 evolution under combined thermal-nutritional stress on larval
 thermotolerance and thermal plasticity in *Drosophila melanogaster***
 [https://doi.org/10.5061/dryad.mcvdnck7z](https://doi.org/10.5061/dryad.mcvdnck7z) We investigated how long-term adaptation to combined thermal-nutritional stress affects larval thermotoelrance and thermal plasticity. We assessed basal and induced cold and heat tolerance of larvae from nine *D. melanogaster* experimental evolution lines that were forced adapted to combinations of three temperatures (18°C, 25°C and 28°C) and three diets (standard, diluted and low protein:high carbohydrate [low P:C] diets) using laboratory natural selection. ## Description of the data and file structure This repository contains the following data and scripts: * **Viability data** (".csv") * **R markdown scripts** (".Rmd") containing code for data analyses and visualizations * **R markdown in the HTML notebook format** (.nb.html) containing code for data analyses and visualizations, and coding outputs * **Data generated from analyses** (".Rdata") for further analyses and visualizations ### Data Files * **“EEL thermoplasticity.csv”**: Contains all viability data from all thermal shock treatments in all nine selection lines. * **vial_number**: the number of vial * **selection_line**: selection line, a combination of selection treatment and replicate line * **selection_treatment**: selection treatment, a combination of selection temperature and selection diet * **selection_temperature**: selection temperatures (18= 18, 25 = 25°C, 28 = 28°C) * **selection_diet**: selection diets (A = standard diet, B = diluted diet, C = low P:C diet) * **replicate_line**: replicate line number * **treatment**: treatment, a combination of the type of thermal shocks (cold or heat) and hardening treatment (Yes or no) * **treatment_type**: type of thermal shocks (c = cold shock, h = heat shock, control = control) * **hardening**: presence of a hardening treatment (Y = Yes, N = No) * **acute_shock**: presence of an acute thermal shock (Y = Yes, N = No) * **hardening_temperature**: temperature of the hardening treatment (NA = not applicable, 0 = 0°C, 35 = 35°C) * **hardening_hours**: duration of the hardening treatment (NA = not applicatble, 2 = 2 hours, 1 = 1 hour) * **treatment_temperature**: temperature of the acute shock treatment (NA = not applicable, 0 = 0°C, 39 = 39°C) * **treatment_hours**: duration of the acute shock treatment (4 = 4 hours, 0.5 = 0.5 hour) * **replicate vial**: replicate vial number * **block**: block number * **adult_eclosed**: number of eclosed adults in the vial * **female**: number of eclosed female in the vial * **male**: number of eclosed male in the vial * **unknown**: number of gender-unidentified individual in the vial (empty cells means not applicable) * **viability**: number of eclosed adults / number of eggs deposited in the vial (20) * **egg_deposited**: number of eggs deposited in the vial * **comment**: comments * **“Pilot - EEL thermoplasticity_new.csv”**: Contains all viability data from pilot thermal shock treatments in lines selected on standard diets at different temperatures. * **vial_number**: the number of vial * **selection_treatment**: selection treatment, a combination of selection temperature and selection diet * **selection_temperature**: selection temperatures (18= 18, 25 = 25°C, 28 = 28°C) * **selection_diet**: selection diets (A = standard diet, B = diluted diet, C = low P:C diet) * **replicate_line**: replicate line number * **treatment**: treatment, a combination of the type of thermal shock (cold or heat), hardening hours (duration of the hardening treatment) and treatment hours (duration of the acute shock) * **treatment_type**: type of thermal shock (c = cold shock, h = heat shock) * **hardening**: presence of hardening treatment (Y = Yes, N = No) * **hardening_temperature**: temperature of the hardening treatment (NA = not applicable, 0 = 0°C, 35 = 35°C) * **hardening_hours**: duration of the hardening treatment (NA = not applicatble, 2 = 2 hours, 1 = 1 hour) * **treatment_temperature**: temperature of the acute shock treatment (0 = 0°C, 39 = 39°C) * **treatment_hours**: duration of the acute shock treatment (0.25 = 0.25 hour, 0.5 = 0.5 hour, 1 = 1 hour, 2 = 2 hours, 4 = 4 hours, 5 = 5 hours, 6 = 6 hours) * **replicate vial**: replicate vial number * **block**: block number * **adult_eclosed**: number of eclosed adults in the vial * **viability**: number of eclosed adults / number of eggs deposited in the vial (20) * **egg_deposited**: number of eggs deposited in the vial ## Code Scripts (.Rmd) All code files are commented and annotated. * **ANOVA**: * "EEL thermoplasticity analysis (control) sum to zero contrast.Rmd" and "EEL thermoplasticity analysis (control) sum to zero contrast.nb.html" for assessing the effect of selection temperature and selection diets on basal larval-adult viability * "EEL thermoplasticity analysis (heat) sum to zero contrast.Rmd" and "EEL thermoplasticity analysis (heat) sum to zero contrast.nb.html" for assessing the effect of selection temperature and selection diets on basal and induced heat tolerance * "EEL thermoplasticity analysis (cold) sum to zero contrast.Rmd" and "EEL thermoplasticity analysis (cold) sum to zero contrast.nb.html" for assessing the effect of selection temperature and selection diets on basal and induced cold tolerance * "Pilot - EEL thermoplasticity analysis heat (sum to zero contrast).Rmd" and "Pilot - EEL thermoplasticity analysis heat (sum to zero contrast).nb.html" for determining suitable durations for heat hardening and heat shock treatments * "Pilot - EEL thermoplasticity analysis cold (sum to zero contrast).Rmd" and "Pilot - EEL thermoplasticity analysis cold (sum to zero contrast).nb.html" for determining suitable durations for cold hardening and cold shock treatments * **Data visualization**: * "ggplot - cold and control.RMD" and "ggplot - cold and control.nb.html" for figure 1 and 2 * "ggplot - heat.Rmd" and "ggplot - heat.nb.html" for figure 3 and figure S1 * "Pilot ggplot - EEL thermoplasticity analysis cold.Rmd" and "Pilot ggplot - EEL thermoplasticity analysis cold.nb.html" for figure S2 * "Pilot ggplot - EEL thermoplasticity analysis heat.Rmd" and "Pilot ggplot - EEL thermoplasticity analysis heat.nb.html" for figure S3 ### Data Files Generated from Analyses (.Rdata) * Includes: "EEL_ctrlm.Rdata", "EEL_ctrlm_t.Rdata", "EEL_clm2.1.Rdata", and "EEL_hlm1.3.Rdata" * Use of these data is included and annotated in the .Rmd files. #### Code/Software * R is required to run the coding scripts (".Rmd" files). The scripts were created using R version 2024.12.1+563 (RStudio 2024.12.1+563 "Kousa Dogwood" Release). * Microsoft Excel can be used to view ".csv" files.