DOI: 10.5061/dryad.fttdz090j
title: Demographic feedbacks during evolutionary rescue can slow or speed adaptive evolution

description: Populations declining toward extinction can persist via genetic adaptation
 in a process called evolutionary rescue. Predicting evolutionary rescue
 has applications ranging from conservation biology to medicine, but
 requires understanding and integrating the multiple effects of a stressful
 environmental change on population processes. Here we derive a simple
 expression for how generation time, a key determinant of the rate of
 evolution, varies with population size during evolutionary rescue. Change
 in generation time is quantitatively predicted by comparing how
 intraspecific competition and the source of maladaptation each affect the
 rates of births and deaths in the population. Depending on the difference
 between two parameters quantifying these effects, the model predicts that
 populations may experience substantial changes in their rate of adaptation
 in both positive and negative directions, or adapt consistently despite
 severe stress. These predictions were then tested by comparison to the
 results of individual-based simulations of evolutionary rescue, which
 validated that the tolerable rate of environmental change varied
 considerably as described by analytical results. We discuss how these
 results inform efforts to understand wildlife disease and adaptation to
 climate change, evolution in managed populations, and treatment resistance
 in pathogens.
description: # R code and simulation outputs
 All results in this paper
 are based on simulation. This package includes the simulation code,
 outputs, and the scripts used in analyses and making figures. ##
 Description of the data and file structure The basic algorithm is
 contained in the file QG_full_generalized.R. However, several variants
 were used throughout the paper. Below is a list of the files used in
 preparing each figure. All scripts the analyze simulation data require a
 path set to the location of a directory include the archived outputs,
 which are each identified by name (azure, blue, cerulean, no_genes,
 selection_test, organic). Each of these simulation data directories
 contains a table file which primarily serves to associate the initial
 random number seed with each replicate. For each replicate, a file is
 generated with the allele effects (e.g., azure_effects_0001.txt) and
 another file is produced with the complete genotype of each individual in
 the starting population (e.g., azure_pop_0001.txt). These files are
 human-readable but should not be modified; they are generated by the
 script QG_make_pops.R. Required packages include color pallets (R packages
 wesanderson and viridis) and the doParallel package for running
 simulations in parallel. Figure 1: main_figure_01.R Figure 2:
 main_figure_02.R QG_full_generalized.R QG_make_pops.R Archived folder
 azure (contains all relevant simulation outputs) Figure 3:
 main_figure_03.R QG_full_generalized.R QG_make_pops.R Archived folder
 azure (contains all relevant simulation outputs) Figure 4:
 main_figure_04.R QG_full_generalized.R QG_make_pops.R Archived folder
 azure (contains all relevant simulation outputs) Figure 5:
 main_figure_05.R QG_full_generalized.R QG_make_pops.R Archived folder
 azure (contains all relevant simulation outputs) Figure S1: supp_fig_01.R
 QG_full_generalized.R QG_make_pops.R Archived folder azure (contains all
 relevant simulation outputs) Figure S2: supp_fig_02.R
 QG_full_generalized.R QG_make_pops.R Archived folder azure Archived folder
 blue Archived folder cerulean Figure S3: supp_fig_03.R
 QG_full_generalized.R QG_make_pops.R Archived folder azure (contains all
 relevant simulation outputs) Figure S4: supp_fig_04_main.R
 supp_fig_04_inset.R QG_full_generalized_organic.R QG_make_organic_pops.R
 Archived folder organic (contains all relevant simulation outputs) Figure
 S5: supp_fig_05.R QG_full_generalized.R QG_make_pops.R Archived folder
 azure (contains all relevant simulation outputs) Figure S6: supp_fig_06.R
 QG_full_generalized.R QG_make_pops.R Archived folder azure (contains all
 relevant simulation outputs) Figure S7: supp_fig_07.R
 QG_no_genes_steady_state.R Archived folder no_genes Figure S8:
 supp_fig_08.R QG_no_genes.R Archived folder no_genes Figure S9:
 supp_fig_09.R QG_selection_tester.R Archived folder selection_test Figure
 S10: supp_fig_10.R QG_full_generalized.R QG_make_pops.R Archived folder
 azure (contains all relevant simulation outputs) ## Sharing/Access
 information * n/a ## Code/Software All code described above.