DOI: 10.5061/dryad.xgxd254sf
title: Ectotherm size- and age-at-maturity in a warmer, variable, and resource-poor world

description: This dataset supports a study investigating how nutritional quality and
 thermal variability jointly affect individual growth and maturation in
 Daphnia magna. It includes the full R implementation of a Dynamic Energy
 Budget (DEB) model parameterised for D. magna, in which the average
 temperature, the amplitude of thermal fluctuations, and both the quantity
 and quality of food can be modified by the user. The dataset also contains
 empirical measurements from standardized growth experiments conducted
 under multiple combinations of temperature regimes (varying means and
 amplitudes), food quantity, and nutritional quality. The DEB model
 predicts age and size at maturity across several environmental scenarios.
 Experimental data were used to validate model accuracy and
 parameterization under different thermal and trophic conditions. Model
 scripts include complete annotation, flexible parameter settings, and
 tools for simulating growth trajectories and extracting key life-history
 metrics. These data provide a robust framework for exploring how energetic
 constraints modulate population responses to environmental change, and
 offer a reproducible tool for predicting life-history outcomes under
 different ecological scenarios, including thermal stress and food
 limitation.
description: # Ectotherm size- and age-at-maturity in a warmer, variable, and
 resource-poor world
 [https://doi.org/10.5061/dryad.xgxd254sf](https://doi.org/10.5061/dryad.xgxd254sf) ## Description of the data and file structure Experimental data were obtained through laboratory experiments involving multiple crossed factors: temperature (20 or 28°C), temperature variance (no variance or ±5°C around the mean temperature), nutritional quality (high or low), and food quantity (0.4 or 3 mgC/L) on *Daphnia magna*. The mass of the organisms was measured using a precision microbalance, while their size and the number of eggs were determined under a stereomicroscope. For the theoretical part, the model is based on the principles of the Dynamic Energy Budget (DEB) theory. ### Files and variables #### File: script.zip **Description:** Two repositories are present. First, there is the repository DEB_model, which contains three scripts involving the bioenergetic model we established in R. To run the model, two scripts are required: **DEB_reserve_source.R** and **DEB_reserve_run.R**. You can open **DEB_reserve_run.R** and set your working directory where all scripts are located before the *source* command (with the *setwd* command by replacing ??? by your directory, or manually by clicking in Session, Set working directory, Choose Directory), or you can open both scripts, run the **DEB_reserve_source.R** script in its entirety first, and then use the **DEB_reserve_run** script to generate the data and figures. Initially, run the script as is. Afterward, you can modify the model parameters to adjust quality, quantity, temperature, or variance (see the script for the corresponding values). The **DEB_reserve_run_figure_2** is a version of the model configured to realize Figure 2 directly, as it requires slight modifications of the model. To work, this script also requires loading **DEB_reserve_source.R** first, or just set your working directory where all scripts are located before the *source* command (with the *setwd* command by replacing ??? by your directory, or manually by clicking in Session, Set working directory, Choose Directory). */!\ An automatic command has been placed at the beginning of each section (Figure 2 - Variance (line 15), Quantity (line 546), and Quality (line 1139)) to clean your environment automatically, and load again the* ***DEB_reserve_source.R*** *automatically, but you need to set your working directory. /!\\* #### The second repository data_script contains one script called **data_script.R**, which is the script used to realize statistical analysis, figures, and every data treatment using experimental data. The use of this script requires using the datasets provided in the data folder. The script is divided into several sections: Data – loads the datasets and adds variables to them for easier use later in the script. Figure 2 / TPCs – builds each panel of Figure 2 from the paper (note that this requires running the model beforehand and saving the model outputs into specific datasets according to the parameters used). Bootstrap – used to estimate the confidence intervals of the experimental data presented in Extended Table 1 (to be modified depending on the parameter of interest). Figure 3 + Extended Figure 3 + Heatmaps – generates these figures. Since Figure 3 requires multiple model runs, a pre-saved dataset containing the necessary model outputs (fig3_RMSE.txt) is available in the data folder. Figure 4 – constructs Figure 4 of the paper. This also requires running the model under different parameter settings and saving each run as a dataset. Since Figure 4 also requires multiple model runs, multiple pre-saved datasets containing the necessary model outputs (**fig4_combined.txt, fig4_quality.txt, fig4_quantity.txt** and **fig4_variance.txt**) are available in the data folder. Stats – contains the various statistical analyses performed throughout the paper. #### File: data.zip **Description:** **TSR_var** and **Tsr_var_low** txt files contain the experimental data we obtained from our experiments, which were used to validate our model. The following columns of these files correspond to: * **boite** and **puit**: Locations where the organisms were stored in the laboratory. * **masse**: The mass of the organism (µg). * **clone**: The clone of *Daphnia magna* used. * **quality**: The quality of the food (Y = mix of *Chlamydomonas/Cryptomonas*; S = mix of *Synechococcus/Chlamydomonas*). * **temperature**: The temperature of the experiment. * **period**: The temperature variance (cst = 0°C; var = ±5°C around the mean). * **treatment**: A combination of temperature and temperature variance. * **pot**: The pot (replicate) where the organism was placed. * **name**: The name given to the individual. * **time**: The time required to reach maturity (in hours). * **size**: The size of the individual (in µm). * **fecundity**: The number of eggs produced by the individual. * **aire**: The area of the individual (not measured here, so = 0). * **quantity**: The quantity of food (mgC/L). The **fig3_RMSE.txt** is a pre-saved file that compiles both the experimental data and the model predictions (which require numerous runs) used to generate Figure 3. It saves you from having to rerun the model across all incremental levels. The following columns correspond to: * **masse**: The mass of the organism (µg). * **day**: The time required to reach maturity (in days). * **growth_rate**: The somatic growth rate of an individual, calculated using equation 13 in the MS text (in day ^-1^). * **treat**: Name of the treatment applied to the individual, combining temperature (20 or 28), food quality (Y or S), thermal variance (cst or var), and food quantity (0.4 or 3). * **approach**: Was used to construct the dataset to distinguish experimental data (observed) from predicted data. Not useful here * **temp**: The temperature of the experiment. * **quality**: The quality of the food (Y = mix of *Chlamydomonas/Cryptomonas*; S = mix of *Synechococcus/Chlamydomonas)*. * **period**: The temperature variance (cst = 0°C; var = ±5°C around the mean). * **quantity**: The quantity of food (mgC/L). * **masse_predicted**: The mass predicted by the model for the corresponding treatment (treat). * **day_predicted**: The time required to reach maturity (in days) predicted by the model for the corresponding treatment (treat). * **gr_predicted**: The growth rate predicted by the model for the corresponding treatment (treat). The **fig4_combined.txt, fig4_quality.txt, fig4_quantity.txt** and **fig4_variance.txt** are pre-saved files that compile model predictions (which require several runs with different parameterization) used to generate each panel of Figure 4. It saves you from having to rerun the model across all incremental levels. The Following columns correspond to: * Temp.mean: The simulated mean temperature used in the model (°C) * Temp.amp: The simulated thermal amplitude used in the model (°C) * mass.repro: The mass predicted by the model * age.repro: The time required to reach maturity (in days) predicted by the model * growth_rate: The growth rate predicted by the model ## Code/software To use the data, you need R version 4.1.2. The following packages are used: library(deSolve) - v.1.35 library(ggplot2) - v.3.4.0 library(dplyr) - v.1.0.10 library(cowplot) - v.1.1.1 library(DescTools) - v.0.99.48 library(ggnewscale) - v.0.4.9 library(tidyverse) - v.1.3.2 library(plot3D) - v.1.4 library(gridExtra) - v.2.3 library(doBy) - v.4.6.16 library(readr) - v.2.1.3 library(segmented) - v.1.6-1 library(ggthemes) - v.4.2.4 library(scales) - v.1.2.1 library(tidyr) - v.1.3.0 library(car) - v.3.1-1 library(lmtest) - v.0.9-40 library(nlstools) - v.2.0-0 library(sicegar) - v.0.2.4 library(outliers) - v.0.15 library(investr) - v.1.4.2 library(rstatix) - v.0.7.2 library(RColorBrewer) - v.1.1-3 library(ggpmisc) - v.0.5.1 library(ggpubr) - v.0.6.0 library(ggpattern) - v.1.0.1 library(emmeans) - v.1.8.7 library(akima) - v.0.6-3.4 library(svglite) - v.2.1.1 library(patchwork) - v.1.2.0 library(mgcv) - v.1.8-42