Scripts from: Inversions and genomic differentiation after secondary contact: When drift contributes to maintenance, not loss, of differentiation
Data files
Mar 17, 2021 version files 90.04 KB
-
Analyze_WeightedTime.m
2.44 KB
-
Model2_ConsecArray.m
20.67 KB
-
Model2_HalfHalfArray.m
20.80 KB
-
Model4_ConsecArray.m
22.54 KB
-
Model4_HalfHalfArray.m
22.50 KB
-
ReadMeFirst.rtf
1.09 KB
Dec 06, 2025 version files 90.16 KB
-
Analyze_WeightedTime.m
2.44 KB
-
Model2_ConsecArray.m
20.67 KB
-
Model2_HalfHalfArray.m
20.80 KB
-
Model4_ConsecArray.m
22.54 KB
-
Model4_HalfHalfArray.m
22.50 KB
-
README.md
1.21 KB
Abstract
Due to their effects on reducing recombination, chromosomal inversions may play an important role in speciation by establishing and/or maintaining linked blocks of genes causing reproductive isolation (RI) between populations. This view fits empirical data indicating that inversions typically harbor loci involved in RI. However, previous computer simulations of infinite populations with two to four loci involved in RI implied that, even with gene flux as low as 10–8 per gamete, per generation between alternative arrangements, inversions may not have large, qualitative advantages over collinear regions in maintaining population differentiation after secondary contact. Here, we report that finite population sizes can help counteract the homogenizing consequences of gene flux, especially when several fitness-related loci reside within the inversion. In these cases, the persistence time of differentiation after secondary contact can be similar to when gene flux is absent and notably longer than the persistence time without inversions. Thus, despite gene flux, population differentiation may be maintained for up to 100,000 generations, during which time new incompatibilities and/or local adaptations might accumulate and facilitate progress toward speciation. How often these conditions are met in nature remains to be determined.
by Rafajlovic et al. (2021; Evolution).
Data DOI link https://doi.org/10.5061/dryad.v41ns1rvr
Code File Names:
There are four versions of the main code, each version being reserved for a separate model version.
“Model2_ConsecArray.m” simulates Model 2, consecutive array version.
“Model2_HalfHalfArray.m” simulates Model 2, half-half array version.
“Model4_ConsecArray.m” simulates Model 4, consecutive array version.
“Model4_HalfHalfArray.m” simulates Model 4, half-half array version.
Each code has preset parameter values, and they can easily be changed by the user. All parameters are explained in the form of comments in the code files.
Output and data analysis
The main output, as presented in the publication, is the average weighted time of differentiation. To perform this calculation, one can run the following .m file:
“Analyze_WeightedTime.m” (computes the average weighted time of differentiation, based on multiple model realisations).
Code/Software
Matlab
Custom-made codes in Matlab.
Changes after Mar 17, 2021:
The README file has been updated according to the Dryad instructions.
