DOI: 10.5061/dryad.5qfttdzhn
title: The evolution of local adaptation in long-lived species

description: Many species experience heterogeneous environments and adapt genetically
 to local conditions. The extent of such local adaptation depends on a
 balance between divergent selection and gene flow, but also on other
 factors such as phenotypic plasticity or the genetic architecture of
 traits. Here, we explore the role of life history in this process. We
 develop a quantitative genetics model and run individual-based simulations
 to contrast the evolution of local adaptation between short- and
 long-lived species. We show that local adaptation varies with a
 species' life cycle and how this cycle modulates the scheduling of
 selection and dispersal among stages. When a longer generation time is
 associated with more frequent events of selection than dispersal, local
 adaptation is more pronounced in long-lived than in short-lived species.
 Contrastingly, if dispersal occurs more frequently than selection,
 long-lived species evolve weaker local adaptation. Our simulations confirm
 these findings and further show how longevity shapes additive genetic
 variance, effective dispersal between patches, and the genetic response at
 quantitative trait loci. Taken together, our results suggest that the
 effect of longevity on local adaptation depends on the specifics of a
 species' life cycle, potentially explaining why current meta-analyses
 have not consistently detected this effect.
description: # The evolution of local adaptation in long-lived species
 [https://doi.org/10.5061/dryad.5qfttdzhn](https://doi.org/10.5061/dryad.5qfttdzhn) ## Description of the data and file structure The Supplementary Data contain *Nemo-Age* configuration files (that allow to rerun the individual-based simulations), contain simulation data (that are stored at the end of each simulation run), and contain *R* scripts (to analyze the simulation data and re-build the figures of the manuscript). ### Files and variables #### File: ini\_files.zip **Description:** The *Nemo-Age* configuration files (so called ini files; with file extension **.ini**) allow to re-run the individual-based simulations (Cotto et al. 2020; for download and installation of *Nemo-Age* see [here (opens in new window)](https://bitbucket.org/ecoevo/nemo-age-release/src/master/)). There are two kinds of ini files, one kind of ini file with environmental trait contributions being present (folder ***with_env_variance***) and one other kind of ini files without environmental trait contributions (folder ***without_env_variance***). The name of each ini file is indicative of the simulation scenario. Files with the name “*AdultSurv_0.3*” contain simulation data and ini files with adult survival *a22*=0.3. For each level of adult survival, we ran distinct simulations to quantify allele-frequency differentiation at genetic loci (those ini files ending with **_Fst**), to measure additive genetic variance at time of selection (those ini files ending with **_GenVar**), and to estimate genetic and phenotypic divergence (those ini files without a specific ending). **Usage note:** To view and edit the *Nemo-Age* configuration files, you can use standard text editors. #### File: simulation\_data.zip **Description:** The *Nemo-Age* simulation data are divided upon two folders. One folder contains simulation data with environmental trait contributions being present (folder **with_env_variance**) and one other folder contains data with environmental trait contributions being absent (folder **without_env_variance**). For each level of adult survival, we ran distinct simulations to quantify allele frequency differentiation at genetic loci (those folders ending with **_Fst**), to measure additive genetic variance at time of selection (those folders ending with **_GenVar**), and to estimate genetic and phenotypic divergence (those folders without a specific ending). * The entire population at the end of a single simulation run is stored in a *genotype table* (with file extension **.quanti** and **.dat**). The data are stored in a table structure, where each column holds a specific individual property and each row contains all these data for an individual. Each **quanti-file** contains information on the adaptive trait characteristics of each individual, where the most relevant data are: * *pop*: the current individual location (patch=1, or patch=2) * *P1*: the individual phenotpyic value * *G1*: the individual additive genetic (breeding) value * *stage*: the individual stage class (1-juvenile, 2-adult) * *age*: the individual age * *sex*: the individual sex (0-male, 1-female) * More details on the data structure of the quanti-files can be found in the *Nemo-Age* user manual (“chapter 5.3, Quantiative traits - quanti output”). * Each **dat-file** contains information on the neutral genetic markers of each individual in the FSTAT file format: * *loc1-loc20*: the genotypes at 20 neutral genetic loci with allele "01" and "02" in diploid individuals. * *stage*: the individual stage class (1-juvenile, 2-adult) * *age*: the individual age * *sex*: the individual sex (0-male, 1-female) * More details on the data structure of the dat-files can be found in the *Nemo-Age* user manual (“chapter 5.2 Neutral markers - ntrl save genotype”). * The summary data over the time-course of a simulation run are stored in **stat output files** (with file extension **.txt** or **bygen.txt**). The data are stored in a table structure, where each column holds a specific type of summary data and each row contains these data for a specific year. These data have not been used for detailed analyses in the manuscript such that we refer to the *Nemo-Age* user manual (chapter 7, Output Statistics) for more details on the data types. * The simulation logs are stored in **log-files** (with file extension **.log***)* as explained in the *Nemo-Age* user manual (chapter 3 Simulation components – logfile). * In some occasions, we also stored the entire population at the end of a simulation run as **binary files** (folders called *bin*, files with extension **.bin**, **.tar**, or **.bz2**), as detailed in the *Nemo-Age* user manual (chapter 3.2.3 Loading a population from a file, and chapter 4.10 Store data in binary files). * The files **Data**, **Data_env**, and **Data_fst** contain summary statistics on the simulation data. These files were built by help of the *R* scripts in folder "r_scripts.zip" (in this repository) and allow to re-build the plots of the manuscript. The filenames are indicative of the simulation scenario. The number in the curly bracket before the term “dispstage” indicates which stage class is dispersing ({{1}}dispstage – juvenile dispersal; {{2}}dispstage – adult dispersal), the number before the term “selstage” indicates which stage class was exposed to selection ({{1}}selstage – juvenile selection; {{2}}dispstage – adult selection). **Usage note:** To view and analyze the *Nemo-Age* simulation data, you can use standard text editors (files with extension .log, .txt. bygen.txt, .quanti, .dat), spreadsheet editors (e.g.,LibreOffice Calc, MS Excel; files with extension .txt. bygen.txt, .quanti, .dat), or load these files into *R* (files with extension .txt. bygen.txt, .quanti, .dat). The bin files can only be opened by *Nemo-Age* (.bin, .tar, or .bz2). The data files (Data, Data_env, Data_fst) can be loaded into *R* by help of the function *load()* (see also script 2_Figures_Code.R in "r_scripts.zip"). #### File: r\_scripts.zip **Description:** R scripts to analyze the simulation data and to create the figures of the manuscript (directory **r_scripts**). * *1_Plots_Manuscript_Analytic.R* (this R script allows to rebuild Fig. 2 and Fig. 3 of the main text, and Fig. A1 of the Supplementary Appendix) * *2_Additional_functions.R* (R script containing functions to calculate genetic and phenotypic differentiation, genetic and phenotypic variance, effective migration, *F*ST, *F*STQ, covariance of loci and mathematical predictions for the analysis of the *Nemo-Age* output) * *2_Analysis_eValue.R* (R script to analyze genetic and phenotypic differentiation, and genetic and phenotypic variance simulated in *Nemo-Age* with finite heritability) * *2_Analysis_Final.R* (R script to analyze genetic differentiation and genetic variance simulated in *Nemo-Age*) * *2_Analysis_Fst_Fstq.R* (R script to quantify allele frequency differentiation at genetic loci simulated in *Nemo-Age*) - *2_Figures_Code.R* (this R script generates Fig. 4 and 5 from the main text, as well as Fig. B2, B3, B4 and B5 of the Supplementary Appendix) - *2_Visualisation_functions.R* (R script with functions for explorative visualisation of the simulation data obtained from *Nemo-Age*) **Usage note:** To view and analyze the *R* scripts, you can use the software *R*. ## Code/software NEMO-AGE (v0.32.0) ## Access information Other publicly accessible locations of the data: * (none) Data was derived from the following sources: * (none)