Epigenetic variation can promote adaptation by smoothing rugged fitness landscapes
Data files
Nov 20, 2025 version files 2.05 MB
-
CreatingLandscapes_HoC.R
2.23 KB
-
CreatingLandscapes_Main.R
2.66 KB
-
MainText_Code.zip
25.84 KB
-
MainText_Data.zip
545.54 KB
-
README.md
13.58 KB
-
Supplementary_Code.zip
37.01 KB
-
Supplementary_Data.zip
1.41 MB
-
WFmodel.R
9.09 KB
Abstract
Heritable non-genetic phenotypic variation-broadly, epigenetics can potentially influence evolutionary outcomes as direct targets of selection or through interactions with genetic variation. While their evolutionary benefits in generating phenotypic diversity in changing environments are well-characterized, there has been relatively little consideration of how the joint influence of epigenetic changes and mutations would affect traversal of multi-peak adaptive landscapes. Here, we discover general principles for how epigenetics, by generating an epigenetic quasispecies (clusters of semi-stable phenotypes mapped to a single genotype), tends to improve adaptive outcomes of an asexual population on rugged fitness landscapes even in a constant environment. In particular, rapid epigenetic changes tend to smooth out suboptimal fitness peaks through incorporating fitness contributions of epimutations, allowing access to better adaptive outcomes. Remarkably, the average impact of epigenetics is more strongly influenced by an approximate balance between switching rates rather than the absolute rate at which switching occurs. These findings demonstrate that epigenetic changes can be influential even without having strong heritability and have a striking, yet generally invisible, beneficial role in shaping a population's adaptive trajectory.
Dataset DOI: 10.5061/dryad.wdbrv162z
Description of the data and file structure
This repository contains code and data for the manuscript titled "Epigenetic variation can promote adaptation by smoothing rugged fitness landscapes", published in Proceedings of the Royal Society B, DOI: 10.1098/rspb.2025.2619
The central tenet of this work is analyzing how epigenetic switching affects adaptation on fitness landscapes. This analysis has two critical aspects -
First. generating landscapes which vary significantly in their ruggedness. We use two approaches to do this:
1. Creating correlated fitness landscapes with a tunable degree of epistasis. The script to do this is "CreatingLandscapes_Main.R"
2. Creating uncorrelated fitness landscapes following the house of cards (HoC) model. The script to do this is - "CreatingLandscapes_HoC.R"
The focus of this work has been on genotypes with 5 loci. However, the landscapes with more loci can be easily generated by changing the parameter L in either scripts mentioned above. The degree of ruggedness of the landscape (another critical feature in the work) can also be tuned by changing the strength of epistatic interactions in either script.
The second critical feature of this work, simulating adaptation with epigenetic changes. To do this, we use a Wright-Fisher (WF) model modified to include epigenetic effects and transitions. The script for simulations following this model is "WFmodel.R"
The outline of our analysis follows as such :
a) using one of the two ways to generate a large number of fitness landscapes, and
b) analyzing those landscapes using the WF model.
The exact landscapes used in our work are -
1. Correlated landscapes - "LandscapesAll.csv" included in MainText_Data.zip. This file contains a set of 1000 fitness landscapes generated using the epistatic model, and we use this set for all analyses linked to this model.
2. HoC model - "HoC_SetOfAllLandscapes.csv" included in Supplementary_Data.zip. This file contains a set of 1000 fitness landscapes generated using the HoC model, and we use this set for all analyses linked to this model.
In both datasets, each column denotes one landscape - specifically, the set of fitness values for all 32 genotypes in that landscape.
The specific data generated and used for our analysis are included in the MainText_Data.zip and Supplementary_Data.zip folders, respectively, based on whether the dataset is used for figures in the main or supplementary text. The file names correspond to the figure they were used to make in the paper. For example, "Npeaks_vs_Rank_1A.csv" in the MainText_Data.zip folder refers to the data used to generate Fig. 1A.
All scripts to generate and analyze the data and make figures are included in the MainText_Code.zip and Supplementary_Code.zip folders, respectively, based on whether the code is used for figures in the main or supplementary text. For example, "EffectiveLandscapes_FigS6.R" in the Supplementary_Code.zip folder refers to the script used for generating, analyzing, and making the plot associated with Fig S6 in the Supplementary Material.
A central component of your analysis is comparing the effect of adaptation with and without epigenetic changes. For the instances where epigenetic changes are allowed, they are denoted by "epi". For the instances where adaptation is mediated by genetic changes alone, they are denoted by "gen". All data generated is dimensionless.
More details on the data files and the data enclosed are listed below:
| File Name | Folder | Details |
|---|---|---|
| Npeaks_vs_Rank_1A.csv | MainText_Data | Mean Rank (mean) +/- 95% CI (upper, lower) as a function of number of peaks (npeaks) for adaptation with (epi) and without (gen) epigenetic changes. |
| Heterogeneity_outcomes_1B.csv | MainText_Data | Mean rank (mean) with (rank_epi) and without (rank_gen) epigenetic switching for 5-peaked landscapes. "col" column refers to color used for plotting. |
| Rank_Improvement_Fig2.csv | MainText_Data | The average improvement in rank (delrank) as a function of effective number of peaks (epinumpeaks5) for 5-peaked landscapes. |
| Mu_vs_Rank_4A.csv | MainText_Data | Mean Rank (mean) +/- 95% CI (upper, lower) as a function of mutation rate (mu) for adaptation with (epi) and without (gen) epigenetic changes. |
| EpigeneticRates_Diagonal_4B.csv | MainText_Data | Mean Rank (mean) +/- 95% CI (upper, lower) as a function of epigenetic switching rate ON (RateOn) and OFF (RateOff). Data also included for Mean Fitness +/- 95% CI. |
| EpigeneticRates_HeatMap_4C.csv | MainText_Data | Mean Rank (mean) +/- 95% CI (upper, lower) as a function of epigenetic switching rate ON (RateOn) and OFF (RateOff). "col" column refers to color used for plotting. |
| EpigeneticRates_Diagonal_S10.csv | Supplementary_Data | same as EpigeneticRates_Diagonal_4B.csv |
| EpigeneticRates_HeatMap_S11.csv | Supplementary_Data | same as EpigeneticRates_HeatMap_4C.csv |
| Epigeneticrates_NewRatio_S9.csv | Supplementary_Data | same as EpigeneticRates_Diagonal_4B.csv |
| Heterogeneity_4peaks_S4A.csv | Supplementary_Data | same as Heterogeneity_outcomes_1B.csv but for 4-peaked landscapes |
| Heterogeneity_6peaks_S4B.csv | Supplementary_Data | same as Heterogeneity_outcomes_1B.csv but for 6-peaked landscapes |
| Heterogeneity_EffectiveLands_S6.csv | Supplementary_Data | Mean rank with (rank_epi) epigenetic switching and mean rank on effective landscapes (rank_gen) for 5-peaked landscapes |
| Heterogeneity_EffectiveLands_HoC_S13C.csv | Supplementary_Data | same as Heterogeneity_EffectiveLands_S6.csv, but for 5-peaked landscapes following the house of cards model |
| Mu_vs_ProbGlobal_S8.csv | Supplementary_Data | Mean Rank (mean) +/- 95% CI (upper, lower) as a function of mutation rate (mu) for adaptation with (epi) and without (gen) epigenetic changes. Data also included for Mean Fitness +/- 95% CI. |
| Npeaks_vs_ProbGlobal_S3.csv | Supplementary_Data | Mean Rank (mean) +/- 95% CI (upper, lower) as a function of number of peaks (npeaks) for adaptation with (epi) and without (gen) epigenetic changes. Data also included for Mean Fitness +/- 95% CI. |
| Npeaks_vs_Rank_HoC_S13A.csv | Supplementary_Data | same as Npeaks_vs_Rank_1A.csv but for landscapes constructed via the House of Cards model |
| RankImprovement_HoC_S13B.csv | Supplementary_Data | same as Rank_Improvement_Fig2.csv but following the HoC model |
| RankOfPeakRemoved_S5B.csv | Supplementary_Data | Number of landscapes for which the peak with rank = {1,2,3,4,5} was removed, in that order |
| Valleys_Delta_s_5peaked_S7.csv | Supplementary_Data | Characterizing fitness valleys for landscapes where epigenetic switching is not allowed (delta_gen, s_gen) and landscapes where epigenetic switching is allowed (delta_epi, s_epi). Please refer to the manuscript Fig. S7 for a detailed description of what the parameters "delta" and "s" signify. |
| dfe_epi_HoC_S12B.csv | Supplementary_Data | A list containing all fitness effects of all epigenetic changes in our House of Cards model. |
| dfe_epi_epist_S12A.csv | Supplementary_Data | A list containing all fitness effects of all epigenetic changes in our epistatic model. |
Files and variables
File: CreatingLandscapes_HoC.R
Description: The R script used to generate fitness landscapes following the house of cards model.
File: CreatingLandscapes_Main.R
Description: The R script used to generate fitness landscapes following the epistatic model.
File: WFmodel.R
Description: The R script used to simulate adaptation across fitness landscapes, incorporating epigenetic switching.
File: MainText_Code.zip
Description: The figure-specific R scripts used to generate figures in the main text.
File: Supplementary_Code.zip
Description: The figure-specific R scripts used to generate figures in the supplementary material.
File: Supplementary_Data.zip
Description: The data files used to generate the figures in the supplementary material.
File: MainText_Data.zip
Description: The data files used to generate the figures in the main text.
Code/software
All scripts are based on R (version 4.2.3), and use the following packages: stringr; MASS; doParallel; ggplot2; flock; foreach; reshape2; dplyr; tidyr; broom; scales
Access information
Other publicly accessible locations of the data:
