DOI: 10.5281/zenodo.8248198
title: Supergenes and maintenance of alternative reproductive tacitcs

description: # Archived outputs from models of alternative reproductive tactics This repository contains outputs from models of the evolution of alternative reproductive tactics, with accompanying code available on github (https://github.com/spflanagan/ARTs).<br> The repository supports a manuscript submitted to Proceedings of the Royal Society B, which is investigating the effects of explicit genetic architecture on evolutionary dynamics of alternative reproductive tactics. The analysis used two separate programs: a baseline analytical model (written in R) and a simulation-based model (written in C++). Outputs from both of these models are archived here. ## Baseline model - `morph_results_Ns.RDS`: An R data file containing a data.frame with the results of the baseline analytical model. It contains 11 columns:<br> - initial_CP = frequency of the courter/parent morph in the initial generation of the model<br> - initial_CN = frequency of the courter/non-parent morph in the initial generation of the model<br> - initial_NP = frequency of the non-courter/parent morph in the initial generation of the model<br> - initial_NN = frequency of the non-courter/non-parent morph in the initial generation of the model<br> - CP = frequency of the courter/parent morph in the final generation of the model<br> - CN = frequency of the courter/non-parent morph in the final generation of the model<br> - NP = frequency of the non-courter/parent morph in the final generation of the model<br> - NN = frequency of the non-courter/non-parent morph in the final generation of the model<br> - r = the relative reproductive investment parameter<br> - c = the sperm competition coefficient<br> - num_sneak = the number of males allowed to sneak fertilisations within a single clutch<br> - `morph_results_10000_equalStart.RDS`: An R data file containing a data.frame with the results of the baseline analytical model after it had been run for 10,000 generations. It contains the same 11 columns as `morph_results_Ns.RDS`. ## Simulation model The simulation model was run with a variety of parameter combinations, which have been summarised in various files and the archived files are provided. ### Raw outputs These results were generated by running the scripts `scripts/101_model-informed-single-locus.sh`, `101_model-informed-single-locus-tradeoffs.sh`, and `102_model-informed-genetics.sh`. Each parameter combination was run multiple times and generated the same sets of files: - `*_parameters.txt`: Outputs the parameter settings for that run in a text file with each parameter on its own line<br> - `*_log.txt`: A text file with the log outputs from the model - will note whether any errors occurred in that run.<br> - `*_traits.txt`: A tab-delimited file containing the trait data for every individual in generation 0 and generation 12000. The columns are:<br> - Gen: generation<br> - Pop: population ID within simulations that started with identical starting conditions<br> - Individual: A numerical index for the individual whose information is output.<br> - Sex: whether the individual is MALE or FEMALE<br> - Courter: A boolean value for whether the individual has the courter trait (1) or the non-courter trait (0). Note that females can carry the courter trait (i.e., have a value of 1 in this column) but do not express the courter trait.<br> - CourtTrait: The actual trait value for the individual, which is the sum of allelic effects at courter QTLs. <br> - Parent: A boolean value for whether the individual has the parent trait (1) or the non-parent trait (0). Note that females can carry the parent trait (i.e., have a value of 1 in this column) but do not express the parent trait.<br> - ParentTrait: The actual trait value for the individual, which is the sum of allelic effects at parent QTLs.<br> - Preference: A boolean value for whether the individual prefers the courting male (1) or non-courting males (0). For the simulation runs here, all individuals have a preference for courters.<br> - PrefTrait: The trait value for the preference trait if the trait has a genetic basis. In all iterations of the model shared here, the preference trait was not genetically inherited.<br> - MateFound: A count of how many mates the individual was able to obtain.<br> - PotRS: The potential reproductive success of the individual, based on their fecundity (which is set by the parameter settings in the model).<br> - LifetimeRS: The realised reproductive success of the individual based on the number of matings and the number of offpsring produced.<br> - Alive: A boolean value tracking whether the individual died or survived to mate. <br> - `*_summary.txt`: A tab-delimited file summarising the final frequencies of various morphs and other demographic parameters for each generation of the model, and for each population (when populations were initiated with identical starting parameters). It contains the following columns:<br> - Generation: Generation number (an integer)<br> - Pop: Numerical population ID. All populations were initiatlised with identical conditions within a single file.<br> - PopSize: The population size (i.e., number of adults)<br> - NumMal: Number of adult males in the population<br> - NumFem: Number of adult females in the population<br> - NumProgeny: The number of progeny produced<br> - ParentThresh: The population-level threshold for the parent trait to switch from parent to non-parent (this is the mean allelic effects in Gen 0).<br> - ParentFreq: Frequency of the parent trait in the population<br> - ParentAEmean: Mean allelic effects of the Parent QTLs<br> - ParentAEsd: Standard deviation in allelic effects of the Parent QTLs<br> - ParentW: Relative fitness of parent males<br> - NonParentW: Relative fitness of non-parent males<br> - CourterThresh: The population-level threshold for the courter trait to switch from courter to non-courter (this is the mean allelic effects in Gen 0).<br> - CourterFreq: Frequency of the courter trait in the population<br> - CourterAEmean: Mean allelic effects of courter QTLs<br> - CourterAEsd: Standard deviation of allelic effects of courter QTLs<br> - CourterW: Relative fitness of courting males<br> - NonCourterW: Relative fitness of non-courting males<br> - FreqNcNp: Frequency of non-courting/non-parent (NN) morph<br> - FreqCNp: Frequency of courting/non-parent (CN) morph<br> - FreqNcP: Frequency of non-courting/parent (NP) morph<br> - Freq CP: Frequency of courting/parent (CP) morph<br> - PrefThresh: The population-level threshold for the preference trait to switch from preferring the courting to non-courting males (not relevant to these simulations)<br> - PrefFreq: Frequency of the preference for the courting male in th epopulation (not relevant to these simulations)<br> - NumRandMate: Number of females that randomly mated (i.e., did not find a partner with the preferred trait) The runs with explicit genetic architectures also have the following files: - `*_qtlinfo.txt`: A tab-delimited file summarising the location of each type of QTL. Each column is a different QTL and each row is a different population. If they are initialised to be identical, the QTL information will be the same for each population. The format of the QTL location information is a the chromosome number as an integer (starting at 0), followed by a decimal, and the following numbers are the location among the marker loci. So, 0.850 refers to a QTL on chromosome 0 at marker location 850 (out of 1000). <br> - `*_allelic-effects.txt`: A tab-delimited file containing the allelic effects for each QTL. These are the additive contributions each QTL makes towards the trait, and these mutate if a mutation occurs at the location of the QTL (which is recorded in the corresponding `*_qtlinfo.txt` file).<br> - `*_markers.txt`: A tab-delimited file summarising the allele frequency at each marker locus.<br> - `*vcf`: A variant call format file for the population in the final generation of the simulations. See standard formats for this type of file online (e.g., https://samtools.github.io/hts-specs/VCFv4.2.pdf)<br> - `*Tajima.D`: The vcftools output format containing Tajima's D statistics, which was generated using the vcf file. See the vcftools manual for more details (https://vcftools.github.io/man_latest.html)<br> - `*LD.geno.ld`: The vcftools output format containing pairwise linkage disequilibrium statistics, which was generated using the vcf file. See the vcftools manual for more details (https://vcftools.github.io/man_latest.html)<br> - `*_gt.csv`: A comma-separated file summarising the genotype information for each individual at all marker loci. It is similar to vcf file format, with the following columns:<br> - Marker: marker ID<br> - Chrom: Chromosome ID or number (starting at 0)<br> - Position: Locaiton on the chromosome (starting at 0)<br> - REF: Reference allele<br> - ALT: Alternative allele<br> - The remaining columns are each individual's genotype <br> - `*_pheno.csv`: A comma-separated file summarising the phenotypes for a population with the following columns:<br> - ID: individual ID<br> - CourtTrait: Whether the individual is a courter (2) or a non-courter (1)<br> - ParentTrait: Whether the individual is a parent (2) or a non-parent (1)<br> - Sex: Whether the individual is a male (MAL) or a female (FEM)<br> - Morph: The morph of the individual (CP = courter/parent, C = courter, P = non-courter/parent, N = non-courter/non-parent; females can have preferences as well but this is not relevant to these datasets) <br> These above outputs, run with various parameter settings, are found in the following `tar.gz` files: - `stochasticity.tar.gz`: Contains the output for the parameter combinations without explicit genetic architectures but including demographic stochasticity, recombination, and mutation. Their file names contain the following labels:<br> - lowDiversity, highDiversity, or highDiversityStrict: indicates the parameter settings used as described in the main text. The 'Strict' case is described in the supplement.<br> - polygyny or monogamy: Specifies if males were allowed to mate with multiple females.<br> - RM: if present, it means that females mated randomly if no suitable males were found<br> - nm: if present, it means that no random mating was permitted if a suitable male was not found<br> - v0: if present, no viability selection was imposed on males<br> - _\d: the final number in the name represents the replicate number that was run with the particular parameter combination<br> - `qtls.tar.gz`: Contains the output for parameter combinations run at high diversity, low diversity, various mating systems, and various genetic parameters. Their file names contain the following labels:<br> - highDiversity or lowDiversity: indicates the parameter settings used as described in the main text.<br> - polygyny or monogamy: Specifies if males were allowed to mate with multiple females. (if this is absent, polygyny is the default)<br> - nm: if present, it means that no random mating was permitted if a suitable male was not found<br> - q\d+: The number of QTLs underlying each trait<br> - c\d+: The number of chromosomes in the simulation<br> - _\d+: the final number in the name represents the replicate number that was run with the particular parameter combination<br> - pop_\d+: For some genomic analyses, the population number from within a replicate is also included. Within a replicate, all populations had identical starting conditions. <br> - `supergene.tar.gz`: Contains the output for parameter combinations run at high diversity, low diversity, various mating systems, and various supergene genetic parameters. Their file names contain the following labels:<br> - highDiversity or lowDiversity: indicates the parameter settings used as described in the main text.<br> - polygyny or monogamy: Specifies if males were allowed to mate with multiple females. (if this is absent, polygyny is the default)<br> - nm: if present, it means that no random mating was permitted if a suitable male was not found<br> - prop\d.\d+: specifies the proportion of a chromosome the supergene stretched across. The options are 0.05,0.25,0.5<br> - q\d+: The number of QTLs underlying each trait<br> - c\d+: The number of chromosomes in the simulation<br> - _\d+: the final number in the name represents the replicate number that was run with the particular parameter combination<br> - pop_\d+: For some genomic analyses, the population number from within a replicate is also included. Within a replicate, all populations had identical starting conditions. <br> ### Summaries The outputs in the zipped files listed above were analysed and summarised in a variety of ways, and those summaries were saved into files for ease of analysis and figure making. - `lowDiv.RDS`, `highDiv.RDS`, and `highDivStrict.RDS` are three R data files that summarise the final frequencies in the simulations witout explicit genetic archictecures (from the `stochastic.tar.gz` file). These files are produced in `docs/102_all-model-outcomes.Rmd`. All three are lists with names reflecting the replicate ID and population, and each list element contains three frequencies, in this order: <br> - frequency of the courter/parent morph in the final generation of the model<br> - frequency of the non-courter/parent morph in the final generation of the model <br> - frequency of the non-courter/non-parent morph in the final generation of the model <br> - `morph_freqs_summary.csv`: A comma-separated file containing the final frequencies of all four morphs for all analysed simulations with explicit genetic architectures (qtls vs supergenes). It contains a header row describing the five columns:<br> - CP = frequency of the courter/parent morph<br> - C = frequency of the courter/non-parent morph<br> - P = frequency of the non-courter/parent morph<br> - NON = frequency of the non-courter/non-parent morph<br> - file = the name and relative path (on my computer) where the results are stored<br> - `selection_gradients.RDS`: An R data file containing a list of data.frames. Each list item contains the name of the trait file it summarises, which captures details on the simulation settings and replicate number. The summary statistics were generated in `docs/101_explicit-genetics-outcomes.Rmd`. Each data.frame contains one row per population for each of generation 0 and generation 12000, with the following columns:<br> - court_cat_b0: intercept of the regression of courter trait values on lifetime reproductive success <br> - court_cat_b0_se: standard error of the intercept of the regression of courter trait values on lifetime reproductive success <br> - court_cat_b0_p: p-value associated with the intercept of the regression of courter trait values on lifetime reproductive success <br> - court_cat_b1: slope of the regression of courter trait values on lifetime reproductive success <br> - court_cat_b1_se: standard error of the slope of the regression of courter trait values on lifetime reproductive success <br> - court_cat_b1_p: p-value associated with the slope of the regression of courter trait values on lifetime reproductive success <br> - parent_cat_b0: intercept of the regression of parent trait values on lifetime reproductive success <br> - parent_cat_b0_se: standard error of the intercept of the regression of parent trait values on lifetime reproductive success <br> - parent_cat_b0_p: p-value associated with the intercept of the regression of parent trait values on lifetime reproductive success <br> - parent_cat_b1: slope of the regression of parent trait values on lifetime reproductive success <br> - parent_cat_b1_se: standard error of the slope of the regression of parent trait values on lifetime reproductive success <br> - parent_cat_b1_p: p-value associated with the slope of the regression of parent trait values on lifetime reproductive success <br> - cp_freq: frequency of the courter/parent morph in the final generation of the model<br> - np_freq: frequency of the non-courter/parent morph in the final generation of the model <br> - cn_freq: frequency of the courter/non-parent morph in the final generation of the model<br> - nn_freq: frequency of the non-courter/non-parent morph in the final generation of the model <br> - gen: which generation the results come from<br> - pop: which identically-initialised population doe the results come from<br> - supergene: A boolean value representing whether the replicate had a supergene (1) or did not (0)<br> - highDiv: Whether the replicate used high-diversity parameter settings (1) or low diversity parameter settings (0)<br> - `fitness_dat.RDS`: An R data file containing a list of data.frames. Each list item is named as the trait file it summarises, which captures the details of the replicate settings. Each data.frame contains one row per population for generation 0 and generation 12000, with the following columns:<br> - cp_muRS: Mean lifetime reproductive success for males of the courter/parent morph<br> - np_muRS: Mean lifetime reproductive success for males of the non-courter/parent morph <br> - cn_muRS: Mean lifetime reproductive success for males of the courter/non-parent morph <br> - nn_muRS: Mean lifetime reproductive success for males of the non-courter/non-parent morph <br> - cp_semRS: standard error of the mean lifetime reproductive success for males of the courter/parent morph <br> - np_semRS: standard error of the mean lifetime reproductive success for males of the non-courter/parent morph <br> - cn_semRS: standard error of the mean lifetime reproductive success for males of the courter/non-parent morph <br> - nn_semRS: standard error of the mean lifetime reproductive success for males of the non-courter/non-parent morph <br> - cp_freq: frequency of the courter/parent morph in the final generation of the model<br> - np_freq: frequency of the non-courter/parent morph in the final generation of the model <br> - cn_freq: frequency of the courter/non-parent morph in the final generation of the model<br> - nn_freq: frequency of the non-courter/non-parent morph in the final generation of the model &nbsp