DOI: 10.5061/dryad.2z34tmpjr
title: Data from: Ecology shapes epistasis in a genotype-phenotype-fitness map for stick insect colour

description: Genetic interactions such as epistasis are widespread in nature and can
 shape evolutionary dynamics. Epistasis occurs due to non-linearity in
 biological systems, which can arise via cellular processes that convert
 genotype to phenotype and via selective processes that connect phenotype
 to fitness. Few studies in nature have connected genotype to phenotype to
 fitness for multiple potentially interacting genetic variants. Thus, the
 causes of epistasis in the wild remain poorly understood. Here, we show
 that epistasis for fitness is an emergent and predictable property of
 non-linear selective processes. We do so by measuring the genetic basis of
 cryptic colouration and survival in a field experiment with stick insects.
 We find that colouration exhibits a largely additive genetic basis, but
 with some effects of epistasis that enhance differentiation between colour
 morphs. In terms of fitness, different combinations of loci affecting
 colouration confer high survival in one host-plant treatment.
 Specifically, non-linear correlational selection for specific combinations
 of colour traits in this treatment drives the emergence of pairwise and
 higher-order epistasis for fitness at loci underlying colour. In turn,
 this results in a rugged fitness landscape for genotypes. In contrast,
 fitness epistasis was dampened in another treatment, where selection was
 weaker. Patterns of epistasis that are shaped by ecologically based
 selection could be common, and central to understanding fitness
 landscapes, the dynamics of evolution, and potentially other complex
 systems.
description: The experimental T. chumash were collected from Cercocarpus sp.
 (Mountain Mahogany, MM) in the vicinity of the locality Horse Flats 5
 (HF5, N 34 15.584, W 118 6.254). Over 700 individuals were collected
 between June 11th and June 13th, 2019. These were kept alive in plastic
 containers and moved to laboratory space where 465 healthy adults were
 chosen for use in the transplant experiment, including photography for
 phenotyping and molecular genotyping. All individuals
 from the transplant experiment were photographed with a digital Nikon 5600
 camera equipped with a macro lens (Nikon AF-S VR Micro-Nikkor 105mm f/2.8G
 IF-ED) and two external flashes (Yongnuo YN560-II speedlights). The images
 were taken with the camera set on manual, an aperture of f/14, a shutter
 speed of 1/200 s, a sensitivity of 100 ISO, and flashes adjusted to
 1/4+0.5 env power in S1 mode in an output angle corresponding to 24-mm
 focal length on full frame (~84° diagonal).DNA sequence data were
 generated by  on an Illumina HiSeq 200 (100 bp, single-end reads) by the
 Genome Sequencing and Analysis Facility at the University of Texas
 (Austin, TX).
description: The following files are included in this data archive:
 <strong>2019_Tchumash_transplant_table.csv</strong> =
 csv text file with data from the release-recapture selection experiment.
 The files includes one row per individual with data on treatment, block,
 survival (binary) and color.
 <strong>selectionGradBayes.R </strong>= R script with
 code for fitting selection gradients with Bayesan methods.
 <strong>bayes_glm</strong> and
 <strong>bayes_hglm</strong> = JAGS models required by
 selectionGradBayes.R. <b>spectra.chumash.zip
 </b>= zip compressed directory with the raw color spectra
 data. <b>2020Tchumash_quantum_catch_epistasis.R
 </b>= R script to make graphs summarizing the spectra
 data. 
 <strong>Tchumash.spectra.epistasis.txt</strong> and
 <strong>Tchumash.list.epistasis.txt</strong> = Text file
 tables required to run 2020Tchumash_quantum_catch_epistasis.R.
   
 <strong>filtered2x_tchum_mel_gbs_2019.vcf.gz</strong> = gzip
 compressed vcf file. This has the variant (SNP) data used in this study.
 This version of the file has been filtered as described in the
 manuscript.   
 <strong>mod_g_epi_tchum.txt</strong>,
 <strong>mod_g_tchum_AC.txt</strong>, 
 <strong>mod_g_tchum_MM.txt</strong>, 
 <strong>mod_g_tchum.txt</strong> = geno format text files for
 gemma. These files contain the genotype data (posterior mean estimates of
 genotypes) used for fitting BSLMMs with gemma. The AC and MM files contain
 only individuals in the AC or MM treatment, respectively. mod_g_tchum.txt
 contains all individuals. mod_g_epi_tchum.txt contains all individuals and
 includes the epsitatic effects (genotype products) for SNPs showing
 evidence of marginal epistasis based on the MAPIT analysis.
   
 <strong>pheno_MM</strong>,
 <strong>pheno_AC</strong>, <strong>pheno_color
 </strong>=  pheno format text files for gemma. pheno_MM and pheno_AC
 contains survival and sex as phenotypes (binary), whereas pheno_color has
 the color data. These are input for the BSLMM fit with gemma.
   
 <strong>pheno_rg_cv.txt</strong> and
 <strong>pheno_gb_cv.txt</strong> = pheno format text files for
 cross-validation with gemma. Here, each color phenotype (RG or GB) has
 been repeated across multiple columns with missing data for subsets of
 individuals.    
 <strong>models.R</strong> = main R script for analyzing
 expected fitness as a function of color-associated SNPs. Various versions
 of this analysis are included.  
 <strong>tchumSnpTable.txt </strong>= text file
 with one row per SNP with columns for LG, scaffold and position. This file
 is required by models.R   
 <strong>cvScript*R </strong>= set of R scripts for
 cross-validation analyses under different conditions, that is based on
 survival or expected fitness as the response and with additive effects
 only, or including dominance or epistasis.
   
 <strong>cvSummary.R</strong> = R script to summarize
 cross-validation analyses.  
 <strong>ld.R</strong> = R script used to summarize
 patterns of LD among color-associated SNPs.
   
 <strong>runMapitColor.R</strong> and
 <strong>runMapitSurv.R</strong> = R scripts used to run the
 MAPIT analyses (tests for marginal epistasis) with color and survival as
 responses.   
 <strong>calcBV.R</strong> = R script used to calculate
 genomic-estimated breeding values for RG and GB color traits with and
 without allowing for epistasis.  
 <strong>pleoitropy.R</strong> = R script used to
 run the core pleiotropy analyses.  
 <strong>nullSims.R</strong> and
 <strong>nullSimsPl.R </strong>= R script used to perform null
 simulations fitting the Bayes model selection/model averaging models to
 sets of random SNPs with or without allowing for pleiotropy.