Skip to main content

Hybridization and the coexistence of species: HZAM-Sym code and data files

Cite this dataset

Irwin, Darren; Schluter, Dolph (2021). Hybridization and the coexistence of species: HZAM-Sym code and data files [Dataset]. Dryad.


It is thought that two species can coexist if they use different resources present in the environment, yet this assumes that species are completely reproductively isolated. We model coexistence outcomes for two sympatric species that are ecologically differentiated but have incomplete reproductive isolation. The consequences of interbreeding depend crucially on hybrid fitness. When hybrid fitness is high, just a small rate of hybridization can lead to collapse of two species into one. Low hybrid fitness can cause population declines, making extinction of one or both species likely. High intrinsic growth rates result in higher reproductive rates when populations are below carrying capacity, reducing the probability of extinction and increasing the probability of stable coexistence at moderate levels of assortative mating and hybrid fitness. Very strong but incomplete assortative mating can induce low hybrid fitness via a mating disadvantage to rare genotypes, and this can stabilize coexistence of two species at high but incomplete levels of assortative mating. Given these results and evidence that it may take many millions of years of divergence before related species become sympatric, we postulate that coexistence of closely-related species is more often limited by insufficient assortative mating than by insufficient ecological differentiation.


This Dryad package contains data files and Julia and R code to run HZAM-Sym (Hybrid Zone with Assortative Mating, Sympatric case) simulations and to generate data figures shown in this paper:

Irwin, D., and D. Schluter. Hybridization and the coexistence of species. bioRxiv.

Note that the first bioRxiv version of the above manuscript was based on only the R code, whereas the second version incorporates results of the same model written in and graphed using Julia.

Please see that second version of the bioRxiv paper for a full description of the model that produced the data.

Usage notes

The files in this package are each described below:

This is the Julia code that can be used to run HZAM-Sym. This Julia version was used to generate the results panels used in the second version of the paper.
This compressed folder (which should be unzipped before use) contains .pdf and .png files of results panels and .jld2 files containing Julia data summarizing results of the simulations run using the Julia version of HZAM-Sym (see above). See the HZAM_Sym_Julia_V1.jl file for explanation.

This is the R code that can be used to run HZAM-Sym and generate the figures used in the paper (using the data files described below).
This compressed folder (which should be unzipped before use) contains 6,762 files containing output from HZAM-Sym simulations. The code in the latter part of the "HZAM-Sym_release_1.0.R" file uses these data files to produce figures in the paper.


Natural Sciences and Engineering Research Council, Award: RGPIN- 2017-03919

Natural Sciences and Engineering Research Council, Award: RGPAS-2017-507830