DOI: 10.5061/dryad.sf7m0cgb6
title: Conditionally deleterious mutation load accumulates in genomic islands but can be purged with sufficient genotypic redundancy

description: Local adaptation frequently evolves in patches or environments that are
 connected via migration. In these cases, genomic regions that are linked
 to a locally adapted locus experience reduced effective migration rates.
 Via individual-based simulations of a two-patch system, we show that this
 reduced effective migration results in the accumulation of conditionally
 deleterious mutations, but not universally deleterious mutations, adjacent
 to adaptive loci. When there is redundancy in the genetic basis of local
 adaptation (i.e. genotypic redundancy), turnover of locally adapted
 polymorphisms allows conditionally deleterious mutation load to be purged.
 The amount of mutational load that accumulates adjacent to locally adapted
 loci is dependent on redundancy, recombination rate, migration rate,
 population size, strength of selection, and the phenotypic effect size of
 adaptive alleles. Our results highlight the need to be cautious when
 interpreting patterns of local adaptation at the level of phenotype or
 fitness, as the genetic basis of local adaptation can be transient, and
 evolution may confer a degree of maladaptation to non-local environments.
description: We used SLiM (Haller and Messer 2019) to simulate a two-patch
 model with either 1) a single adaptive locus on one chromosome to examine
 the accumulation of conditionally deleterious (CD) load, or 2) up to ten
 adaptive loci (on up to ten chromosomes) with variable effect sizes to
 explore the effects of segregating redundancy (sensu Láruson et al. 2020)
 on the transience of the genetic basis of local adaptation and purging of
 conditionally deleterious load. We used R scripts to
 analyze the data, all of which are included in this submission. We have
 also included intermediate data files, which are derived from raw
 simulation files.
description: # Conditionally deleterious mutation load accumulates in genomic islands
 but can be purged with sufficient genotypic redundancy --- We used SLiM
 (Haller and Messer 2019) to simulate a two-patch model with either 1) a
 single adaptive locus on one chromosome to examine the accumulation of
 conditionally deleterious (CD) load, or 2) up to ten adaptive loci (on up
 to ten chromosomes) with variable effect sizes to explore the effects of
 segregating redundancy (sensu Láruson et al. 2020) on the transience of
 the genetic basis of local adaptation and purging of conditionally
 deleterious load. ## Description of the data and file structure The data
 are all SLiM simulation output files, which can be opened with any text
 editor. Our analyses were based entirely on the *Muts.txt output files
 (i.e. the mutations and their effects) generated by SLiM. The data are
 separated into several files reflective of the iterative stages of the
 project. We conducted simulations with revised parameter sets and
 simulation conditions as we discovered interesting results which lead to
 further questions. There were also three authors working on simulations on
 two different computing clusters. Our data archive consists of several
 tar.gz archive files relating to different parts (or stages) of the study
 (Part 1 through Part 4, as listed below). The directory and file structure
 within each archive file is as follows: Part 1) Accumulation of
 conditionally deleterious load or universally deleterious load on a single
 chromosome with a single adaptive locus, or with no adaptive locus:
 ```bash +---APCD_OneChromosome.tar.gz | +---00_APCD | | +---*a series of
 directories, each containing all the SLiM output files (e.g. *Muts.txt and
 *.trees) for every replicate and sampled generation for each parameter set
 with conditionally deleterious load on a single chromosome with a single
 adaptive locus. For example, the directory
 "APCD_array0_N10000_m0.01_R1e-07_r1e-06_muAP1e-05_muCD1e-08_sCD(-m)_phi0.1" contains the SLiM output files for replicates of every sampled generation with N = 10000, m = 0.01, R = 1e-07, r = 1e-06, muAP = 1e-05, muCD = 1e-08, sCD = -m, and phi = 0.1. +---APCD_OneChromosome_noAP.tar.gz | +---01_noAP | | +---*a series of directories, each containing all the SLiM output files (e.g. *Muts.txt and *.trees) for every replicate and sampled generation for each parameter set with conditionally deleterious load on a single chromosome with no adaptive locus. For example, the directory "APCD_array0_N10000_m0.01_R1e-07_r1e-06_muCD1e-08_sCD(-m)_phi0.1" contains the SLiM output files for replicates of every sampled generation with N = 10000, m = 0.01, R = 1e-07, r = 1e-06, muCD = 1e-08, sCD = -m, and phi = 0.1. +---APCD_OneChromosome_purDel.tar.gz | +---02_purDEL | | +---*a series of directories, each containing all the SLiM output files (e.g. *Muts.txt and *.trees) for every replicate and sampled generation for each parameter set with universally deleterious load on a single chromosome with a single adaptive locus. For example, the directory "APCD_array0_N10000_m0.01_R1e-07_r1e-06_muAP1e-05_muCD1e-08_sCD(-m)_phi0.1" contains the SLiM output files for replicates of every sampled generation with N = 10000, m = 0.01, R = 1e-07, r = 1e-06, muAP = 1e-05, muCD = 1e-08, sCD = -m, and phi = 0.1 (note: muCD and sCD actually refer to parameter values for Universally Deleterious mutations, not Conditionally Deleterious mutations, in this case). +---APCD_OneChromosome_part2.tar.gz | +---00_APCD_jon | | +---*a series of directories, each containing all the SLiM output files (e.g. *Muts.txt and *.trees) for every replicate and sampled generation for each parameter set with conditionally deleterious load on a single chromosome with a single adaptive locus. For example, the directory "APCD_array0_N10000_m0.01_R1e-07_r1e-05_muAP0.0001_muCD1e-08_sCD(-m)_phi0.5" contains the SLiM output files for replicates of every sampled generation with N = 10000, m = 0.01, R = 1e-07, r = 1e-05, muAP = 0.0001, muCD = 1e-08, sCD = -m, and phi = 0.5. ``` Part 2) Accumulation of CD load across ten chromosomes and turnover of adaptive loci, with varying effect size of adaptive mutations (number of adaptive loci constant): ```bash +---nTenThousandOutput_Muts.tar.gz | +---nTenThousandOutput | | +---*no subdirectories, just all the *Muts.txt SLiM output files for all replicates of every parameter combination. For example, the file "APCD10Cr_R=1e-07_r=0.000001_muAP=0.0001_N=10000_m=0.001_phi=0.1_sCD=-0.001_muCD=1e-08_sAP=-0.100.1_Replicate=0_1630247671378_out_Muts.txt" contains the data for every generation sampled for the output of one replicate of the simulations with R = 1e-07, r = 0.000001, muAP = 0.0001, N = 10000, m = 0.001, phi = 0.1, sCD = -0.001, muCD = 1e-08, and sAP = {-0.1, 0 , 0.1}. +---validatedOutput-2022-01-01.tar.gz | +---validatedOutput-2022-01-01 | | +---*no subdirectories, just all the *Muts.txt SLiM output files for all replicates of every parameter combination. For example, the file "APCD10Cr_R=1e-07_r=0.000001_muAP=0.0001_N=10000_m=0.001_phi=0.1_sCD=-0.001_muCD=1e-08_sAP=-0.100.1_Replicate=0_1630247671378_out_Muts.txt" contains the data for every generation sampled for the output of one replicate of the simulations with R = 1e-07, r = 0.000001, muAP = 0.0001, N = 10000, m = 0.001, phi = 0.1, sCD = -0.001, muCD = 1e-08, and sAP = {-0.1, 0 , 0.1}. ``` This data is also archived on the Federated Research Data Repository (a platform for digital research data management and discovery provided by the Digital Research Alliance of Canada) at ; the associated production code is also hosted on Zenodo at . Part 3) Accumulation of CD load across ten chromosomes and turnover of adaptive loci, with varying number of adaptive loci (effect size of adaptive mutations constant): ```bash +---APCD_TenChromosomes_NewRedundancy.tar.gz | +---APCD_TenChromosomes_NewRedundancy | | +---*a series of directories, each containing all the SLiM output files (i.e. *Muts.txt) for every replicate and sampled generation. For example, the directory "APCD_array0_N10000_m0.001_R1e-07_r0.001_muAP0.0001_muCD1e-08_sCD-0.001_phi0.1_sAP0.125_numAP4" contains the SLiM output files for replicates of every sampled generation with N = 10000, m = 0.001, R = 1e-07, r = 0.001, muAP = 0.0001, muCD = 1e-08, sCD = -0.001, phi = 0.1, sAP = {-0.125, 0, 0.0125}, and numAP = 4. ``` Part 4) Dynamics (i.e. turnover) of adaptive loci with no CD mutations: ```bash +---APCD_TenChromosomes_APturnover.tar.gz | +---APCD_TenChromosomes_APturnover | | +---*a series of directories, each containing all the SLiM output files (i.e. *Muts.txt) for every replicate and sampled generation. For example, the directory "APCD_array0_N10000_m0.001_R1e-07_r1e-06_muAP1e-05_muCD0_sCD-0.001_phi0.1_sAP0.05" contains the SLiM output files for replicates of every sampled generation with N = 10000, m = 0.001, R = 1e-07, r = 1e-06, muAP = 1e-05, muCD = 0, sCD = -0.001, phi = 0.1, and sAP = {-0.05, 0, 0.05}. ``` ## Sharing/Access information Links to other publicly accessible locations of the data: A portion of the data is also archived on the Federated Research Data Repository: A portion of the code is also archived on Zenodo: . ## Code/Software For parts 1, 3, and 4 (above), we used the following Python and Bash scripts to create parameter sets, submit jobs, and run the SLiM simulations: SLiM scripts: APCD_partAdditive_1.0.slim (used for part 1, above) APCD_partAdditive_1.0_noAP.slim(used for part 1, above) APCD_partAdditive_1.0_purDEL.slim (used for part 1, above) APCD_10Cr_model_20220622.slim (used for part 3, above) APCD_10Cr_model_20220620.slim (used for part 4, above) Python and Bash scripts: APCD_combine_parameters.py APCD_RUN_0.8.sh scripts_array_prep.sh submit_multiple_jobs To run a set of simulations, first install SLiM 3, then: 1. Set parameter values in the APCD_combine_parameters.py script. The script includes information on parameter details (which are also described in the text of the associated manuscript). Note that the "numAP" parameter is only relevant for the simulations in part 3 (above). 2. Run the script, indicating the number of parameter combinations, to create a set of parameter arrays like this (if there are 40 parameter combinations): python APCD_combine_parameters.py 40 3. In the APCD_RUN_0.8.sh script, modify paths to the appropriate *.slim script, to the log file directory, and to the output directory. 4. In the APCD_RUN_0.8.sh script, choose the number of replicates (or "iterations") for each parameter set (e.g. ITERATION="1" for one replicate) 5. In the scripts_array_prep.sh script, set the for loop to run through all the parameter sets. For 40 parameter combinations, like this: for i in {0..39} 6. Run the scripts_array_prep.sh script to produce a bash script for each set of parameter values. 7. To submit all the simulations, run the submit_multiple_jobs script. If you want the simulations to run in the background (e.g. if you logged into a remote server and you want to shut down your own workstation), do: ./submit_multiple_jobs & \** You can check which jobs are running with ps -ef | grep slim For part 2 (above), the SLiM script and instructions for running simulations are archived on Zenodo: We used R to analyse/plot the simulation results. We have provided the R scripts for the following components of the study: 1. Accumulation of conditionally deleterious load or universally deleterious load on a single chromosome with a single adaptive locus, or with no adaptive locus: One_Chromosome_Load_Sliding_Window.R (this script uses the SLiM output in APCD_OneChromosome.tar.gz, APCD_OneChromosome_noAP.tar.gz, and APCD_OneChromosome_purDel.tar.gz) - creates Figure 3 One_Chromosome_Load_Sliding_Window_2.R (this script uses the SLiM output in APCD_OneChromosome_part2.tar.gz) - creates Figure 4 2. Accumulation of CD load across ten chromosomes and turnover of adaptive loci, with varying effect size of adaptive mutations (number of adaptive loci constant): extract_results_AllOutput.R (this script uses the SLiM output in validatedOutput-2022-01-01.tar.gz to create the intermediate data file results_Spring_2022.txt) sojourn_AllOutput.R (this script uses the SLiM output in validatedOutput-2022-01-01.tar.gz to create the intermediate data file sojourn_sd_results_Spring_2022.txt) Ten_Chromosomes_Load_Sojourn_plot.R (this script uses the intermediate data files sojourn_sd_results_Spring_2022.txt and results_Spring_2022.txt) - creates Figure S3 Ten_Chromosomes_Load_Sliding_Window.R (this script uses the SLiM output in nTenThousandOutput.tar.gz) - creates Figure S1 3. Accumulation of CD load across ten chromosomes and turnover of adaptive loci, with varying number of adaptive loci (effect size of adaptive mutations constant): extract_load_data.R (this script uses the SLiM output in APCD_TenChromosomes_NewRedundancy.tar.gz to create the intermediate data file results_load_2022-10-17.txt) Ten_Chromosomes_load_numAP_plot.R (this script uses the intermediate data file results_load_2022-10-17.txt) - creates Figure 5 4. Dynamics (i.e. turnover) of adaptive loci with no CD mutations: sojourn_sd.R (this script uses the SLiM output in APCD_TenChromosomes_APturnover.tar.gz to create the intermediate data file sojourn_sd_results_Oct-13_2022.txt) Ten_Chromosomes_noCD_Sojourn_plot.R (this script uses the intermediate data file sojourn_sd_results_Oct-13_2022.txt) - creates Figure S2 ### File Details --- #### Details for 'results\_Spring\_2022.txt' * Variables: * 'R', 'r', 'muAP', 'N', 'm', 'phi', 'sCD', 'muCD', and 'sAP' : as described in main text * 'V10' through 'V60' : CD load sampled in generation 100000 through 350000 (every 5000 generations) #### Details for 'sojourn\_sd\_results\_Spring\_2022.txt' * Variables: * 'R', 'r', 'muAP', 'N', 'm', 'phi', 'sCD', 'muCD', and 'sAP' : as described in main text * 'Chr1' through 'Chr10' : the standard deviation, across all sampled generations, in the frequency of the adaptive alleles at each AP locus (i.e. the AP locus on Chromosome 1 through 10) #### Details for 'results\_load\_2022-10-17.txt' * Variables: * 'R', 'r', 'muAP', 'N', 'm', 'phi', 'sCD', 'muCD', 'sAP', and numAP : as described in main text * 'V11' through 'V61' : CD load sampled in generation 100000 through 350000 (every 5000 generations) #### Details for 'sojourn\_sd\_results\_Oct-13\_2022.txt' * Variables: * 'R', 'r', 'muAP', 'N', 'm', 'phi', 'sCD', 'muCD', and 'sAP' : as described in main text * 'Chr1' through 'Chr10' : the standard deviation, across all sampled generations, in the frequency of the adaptive alleles at each AP locus (i.e. the AP locus on Chromosome 1 through 10)