DOI: 10.5061/dryad.v1q13
title: Data from: Natural selection and the predictability of evolution in Timema stick insects

description: Predicting evolution remains difficult. We studied the evolution of
 cryptic body coloration and pattern in a stick insect using 25 years of
 field data, experiments, and genomics. We found that evolution is more
 difficult to predict when it involves a balance between multiple selective
 factors and uncertainty in environmental conditions than when it involves
 feedback loops that cause consistent back-and-forth fluctuations.
 Specifically, changes in color-morph frequencies are modestly predictable
 through time (r2 = 0.14) and driven by complex selective regimes and
 yearly fluctuations in climate. In contrast, temporal changes in
 pattern-morph frequencies are highly predictable due to negative
 frequency-dependent selection (r2 = 0.86). For both traits, however,
 natural selection drives evolution around a dynamic equilibrium, providing
 some predictability to the process.
description: Desiccation
 experimentThis compressed
 directory contains two files. 'dessication_trials_2017.csv'
 provides the data for the desiccation experiment. This includes the morph
 type (green vs. grey or red = melanic), weights, and time to death. The
 second file 'commands_melExp.R' provides the R code used to
 analyse the data. This presents some initial exploratory analyses and the
 final analysis used for the paper.timemaMelExp.tar.gzStripe freq. dependence experimentThis compressed directory contains three files related to the experimental test for frequency-dependent selection of stripe (versus no stripe). 'recapture_data.txt' provides the raw data, which includes the number of striped vs. green (unstriped) insects re-captured and the treatment ID (2 = 20% stripe, 8 = 80% stripe). The directory also includes the R code ('commands_freqDep.R') used to fit the Bayesian model (the model itself is in another text file, 'binmod', which is also included).stripe_freq_experiment.tar.gzVCF filtering scriptsThis compressed directory contains two perl scripts that we used to filter the VCF files with the genetic variant data for the FHA population (2011 vs. 2013) and for the between-generation experiment.popGenFilterScripts.tar.gzGenomic change in FHA (2011-2013)This compressed directory contains the allele frequency data ('pEM_fha2011.txt' and 'pEM_fha2013.txt') and associated scripts for the analyses of genomic change (allele frequency change across the genome) for the FHA population between 2011 and 2013. The R script used for the analysis is 'FHA_genomicChangeMelStripy.R'.genomicChangeFHA.tar.gzBetween-generation experiment genomic changeThis compressed directory contains the allele frequency data ('p*') and associated scripts for the analyses of genomic change (allele frequency change across the genome) for the between-generation experiment (the source population for this was OGA). The R script used for the analysis is 'OGAgenomicChangeMelStripy.R'.genomicChangeOGA.tar.gzWithin-generation experiment genomic changeThis compressed directory contains the allele frequency data ('in_p_ecol*', column three gives the maximum likelihood allele frequency estimates) and associated scripts for the analyses of genomic change (allele frequency change across the genome) for the within-generation experiment (the source population for this was FHA). The R script used for the analysis is 'exp_genomicChangeMelStripy.R'.genomicChangeEcol.tar.gzScripts for mel-stripe selection analysisThis compressed directory contains two R scripts used to estimate selection coefficients for FHA (between 2011 and 2013 = 'fhaAbcMel.R') and during a within-generation release-recapture experiment (also at FHA = 'fhaEcolSmel.R'). Additional data (text) files required by these scripts are included ('ecolGbsHost.txt', 'snpids_fha', 'SurvivalGbs.txt', and 'fha2013pheno.txt'). Larger R data workspaces and genetic data files referenced in the scripts have been uploaded individually ('pntest_fha2011.txt', 'pntest_fha2013.txt', 'fhaAbcMel.rdat', 'fhaAbcEcolSMel.rdat').melstripeSelectionFHA.tar.gzGenotype estimates for FHA 2011Matrix of genotype estimates (mean of the posterior with genetoypes coded as 0, 1 or 2, but the mean being non-integer valued) for FHA in 2011. Rows denote SNPs and columns denote individuals. See scripts in melstripeSelectionFHA.tar.gz for details.pntest_fha2011.txt.gzGenotype estiamtes for FHA in 2013Matrix of genotype estimates (mean of the posterior with genetoypes coded as 0, 1 or 2, but the mean being non-integer valued) for FHA in 2013. Rows denote SNPs and columns denote individuals. See scripts in melstripeSelectionFHA.tar.gz for details.pntest_fha2013.txt.gzR workspace for mel-stripe selection inference in FHAThis R workspace contains the results from fhaAbcMel.R, which runs the selection inference for the FHA between 2011 and 2013. It is required by fhaEcolSmel.R.fhaAbcMel.rdatGenetic variant data for mapping colorThis BCF file (binary version of VCF) contains the genetic variant data used for mapping color in Timema cristinae.Tcristinae_FHA.color.bin.bial.noindel.qs20.cov50.mdp295Mdp5900.maf0.01.bcfGenetic variant data for mapping stipre (pattern)This BCF file (binary version of VCF) contains the genetic variant data used for mapping stripe (pattern) in Timema cristinae.Tcristinae_FHA.stripe.bin.bial.noindel.qs20.cov50.mdp295Mdp5360.maf0.01.bcfTraiting mappingThis compressed directory contains the input files (see input) and scripts (see scripts) used for genome-wide association mapping of stripe and color. README files are included in the input and scripts sub-directories.tcr_gwas.tar.gzTime series data and melanistic morph analysisThis compressed directory contains four files relevant for the color (green vs. melanistic) morph time series analysis. The raw data is in 'Tcris_master_27.csv'. The associated R script 'bigMelanisticAnalysis.R' contains the code used to fit the Bayesian models for this data set and includes descriptions of relevant variables in the main data file. The JAGS models referenced in the R script are 'hiermod-refugio' and 'mod-hv'.melTimeSeriesAnalysis.tar.gzTime series data and ARMA analysesThis compressed directory contains the data, models and scripts used for the ARMA model fits of the time series data for Timema cristiane (raw data = Tcris_master_26.csv, note the 2017 data are added to this in the R script), Geospiza fortis (fortis.csv), Geospiza scandens (scandens.csv), Panaxia dominula (data_medionigra.csv), and Biston betuleria (mothdat.csv). Except for the Timema data, these data were obtained from published studies (as described and documented in the paper), but are also included here for completeness. The main R script for fitting the ARMA models is 'predictingEvoAnalyses.R'. It relies on functions defined in 'predictingEvoFuncs.R', which are sourced at the beginning of the 'predictingEvoAnalyses.R' script. The individual JAGS models for the different ARMA models are defined in the 'dp-arma*model' text files, where * denotes the AR and MA lags.ARMAanalyses.tar.gzR workspace for mel-stripe selection experimentThis R workspace contains the results from fhaEcolSmel.R.fhaAbcEcolSMel.rdatScripts and data for the linkage mapThis compressed directory contains a series of perl sciprts and data files that we used to generate the linakge map for Timema cristinae. The specific steps we took, including some annotation/documentation of the scripts we used are in the README file. the offspringGenotype*txt data are included in a separate file.lm2map.tar.gzGenotype data for mapping familiesThis compressed directory contains the genotype data for the three mapping families (A, B, and C). These are required for the mapping scripts we also uploaded.offspringGenDat.tar.gz