Data and code from: Longitudinal and cross-sectional selection on flowering traits in a self-incompatible annual
Data files
Sep 15, 2026 version files 1.73 MB
-
Leventhal_et_al_2026.zip
1.67 MB
-
README.md
61.73 KB
Abstract
Net selection on a trait reflects the association of phenotype with fitness across an entire life cycle. This longitudinal selection estimate can be viewed as the summation of selection episodes across time, each characterized by a cross-sectional estimate. Selection may be consistent in direction and strength across episodes for some traits, fluctuating in others, and for some, concentrated in a single intense event. While selection on plant reproductive traits is predicted to be stronger through male fitness than female fitness, male fitness remains less studied. We investigated how selection on flowering traits in Brassica rapa varies across a season by measuring male reproductive fitness in four experimental populations. To estimate longitudinal and cross-sectional selection, we introduced plants at successive intervals within a single reproductive season. We genotyped over 3000 plants and calculated selection on flowering time, duration, and total flowers. Cross-sectional analyses revealed directional selection was common, but patterns were masked by longitudinal estimates. Manipulation of spatial arrangement within populations was further revealed to significantly impact pollen movement. Our experiment demonstrates that breeding timing and spatial aggregation interact to create complex evolutionary dynamics.
Dataset DOI: 10.5061/dryad.tdz08kqdr
Experimental context
This dataset accompanies Leventhal et al. (2026, Evolution) and can be found zipped in this repository as Leventhal_et_al_2026.zip. We established four experimental populations of Brassica rapa — a self-incompatible annual in the Brassicaceae — at the University of Toronto's Koffler Scientific Reserve (44°1'N, 079°32'W) in summer 2011, using seeds bulk-collected from a naturalized population in Eastern Quebec in 2009. Populations were planted in two spatial arrangements (uniform and clumped, two populations per type) and at two time points (experimental run 1: July–August; experimental run 2: August–October). The four populations are referred to by plot name throughout the data files: B30 (run 1, uniform spacing) and Comp (run 1, clumped spacing), and Track (run 2, uniform spacing) and FarWest/Fwest (run 2, clumped spacing).
We recorded open flower counts approximately every 2–3 days for each of 854 perfect-flowered pollen-donor plants across the season. To estimate male fitness, we deployed successive batches of male-sterile "gene trap" plants as standardized pollen recipients at 3–5 day intervals throughout the season (7 batches in run 1, 8 in run 2). After the season, we germinated seeds from 180 gene trap plants, grew 1,970 offspring, and genotyped all plants (pollen donors, gene traps, and offspring) at 10 B. rapa microsatellite loci. We used MasterBayes to assign proportional paternity via Bayesian MCMC and estimate selection gradients (β) on flowering time, flowering duration, and total flower number — both cross-sectionally (within each gene trap interval) and longitudinally (across the full season).
All analyses were conducted in R. Scripts move from data-raw → data-intermediate files → model outputs and figures in data and tables folders
Repository structure
Slices_in_time.Rproj RStudio project file; open this first so relative paths resolve correctly.
data-raw/ Original, unmodified data files (read-only).
data-intermediate/ Processed data objects derived from data-raw/.
genetic_data/ Processed genotype data (BrapaG_[Pop].csv).
pedigree_data/ Pedigree assignments and related files.
phenotype_data/ Cleaned and merged phenotype datasets (BrapaP_[Pop].csv).
data/ Final analysis-ready datasets and model output CSVs.
betas_longitudinal_no_subsampling/ MCMC chain outputs for longitudinal selection models (no proportional subsampling).
output_betas_all_models/ Direct selection gradient estimates for all cross-sectional and full-season models.
pedigree_assignment/ Parentage assignment results by population.
scripts/ R scripts for data processing, model fitting, and figure generation.
R/ Reusable helper functions for data cleaning.
tables/ Output tables used in the manuscript (model summaries, effect sizes).
Data files
data-raw/
b30phenZerosJune7-2013.csv and compphenZerosJune7-2013.csv
Daily open flower counts for each plant in the B30 and Comp populations (experimental run 1, July–August). Each row is one plant. Zeros indicate no open flowers on that day.
| Variable | Description |
|---|---|
f.178, f.181, ... f.241 |
Number of open flowers observed on that Julian day. Observations recorded approximately every 3 days from day 178 to day 241. |
sd |
Flowering start date (Julian day); first day with ≥1 open flower. |
ed |
Flowering end date (Julian day); last day with ≥1 open flower. |
dur |
Flowering duration (days); ed − sd. |
pos |
Plant position ID within the plot. |
fwphenZerosJune7-2013.csv and tkphenZerosJune7-2013.csv
Daily open flower counts for each plant in the FarWest and Track populations (experimental run 2, August–October). Plants in run 2 were started in the greenhouse and transplanted to the field just before first flower.
| Variable | Description |
|---|---|
pos |
Plant position ID within the plot. |
d228, d230, ... d286 |
Number of open flowers observed on that Julian day. Observations recorded approximately every 2 days from day 228 to day 286. |
sd |
Flowering start date (Julian day), including plants that began flowering in the greenhouse before being placed in the field. |
sd_field |
Flowering start date (Julian day) from the point of field placement; for plants that flowered only in the greenhouse before transplanting, this is their first field flowering date. |
clump_coord.csv and even_coord.csv
Spatial coordinates for plants in the clumped and uniform (even) spatial arrangements, respectively. Each population was laid out as a hexagonal grid with 4 m sides. In the uniform arrangement, nearest neighbors were 0.5 m apart. In the clumped arrangement, plants were grouped in six small hexagons with nearest neighbors 0.17 m apart and small hexagons 2.7 m apart.
| Variable | Description |
|---|---|
plt_pos |
Plant position ID. |
X |
X coordinate (meters). |
Y |
Y coordinate (meters). |
note |
Optional field notes. |
slices_beta_distributions.csv
Lookup table specifying which population × time-batch × spatial-model combinations were run. Used by the main model-fitting script to loop over all conditions.
| Variable | Description |
|---|---|
Group |
Subset of individuals included (e.g., All). |
Plot |
Population (B30, Comp, Fwest, Track). |
Space |
Distance metric used in the mating model (e.g., Euclidian). |
Batch |
Time window identifier (see batch codes below). |
PollinatorVisitationDatafiles/
Raw pollinator observation data collected across all four populations and the R script used to process and visualize these observations (pollinator_code.R)
Key variables in the CSV files:
| Variable | Description |
|---|---|
Site |
Plot name. |
DOY |
Day of year. |
Date |
Calendar date. |
Batch |
Interval of time in which pollinators were counted. |
Total plts observed |
Total number of plants that were observed for those counts. |
Total pollinator visits |
Total number of pollinator visits overall. |
Total pollinator visits to fert plants |
Total number of pollinator visits to the non-gene-trap plants. |
Total pollinator visits to male sterile plants |
Total number of pollinator visits to the male sterile (i.e., gene-trap) plants. |
Max wind speed / Ave wind speed |
Wind conditions. |
Temp |
Mean temperature on the day of observation. |
Note |
Free-text field notes. |
The CSV files also contain pollinator codes that indicate the following pollinator categories:
| Pollinator abbreviation | Pollinator full type |
|---|---|
BMB |
Bumblebee |
BSY |
Big syrphid fly |
BUT |
Butterfly |
HSF |
House fly |
HYB |
Honey bee |
LBB |
Large black bee |
MGB |
Medium green bee |
MSY |
Medium syrphid fly |
SBB |
Small black bee |
SGB |
Small green bee |
SSY |
Small syrphid fly |
UBB |
Unknown black bee |
USY |
Unknown syrphid fly |
WAS |
Wasp |
data/betas_longitudinal_no_subsampling/
MCMC chain outputs for longitudinal (full-season) selection models run without proportional subsampling across gene trap intervals. Each chain file (_ch1_, _ch2_, _ch3_) is one of three independent MCMC chains run with different starting conditions. Combined chain files (combined_chains_[pop].csv) merge the three chains after confirming convergence via the Gelman–Rubin diagnostic.
File naming convention: _ch[chain#]_[Group]_[Plot]_[Space]_[Batch]_.csv
Variables in combined_chains_[pop].csv:
| Variable | Description |
|---|---|
Mean |
Posterior mean of the selection gradient. |
SD |
Posterior standard deviation. |
Naive SE |
Naive standard error of the posterior mean. |
Time-series SE |
Time-series standard error (accounts for MCMC autocorrelation). |
| Row names | Selection gradient parameter (see parameter descriptions below). |
Variables in convergence diagnostic files (Point est., Upper C.I.): Gelman–Rubin diagnostic values; models with values between 0.9 and 1.1 across all three chains were considered converged.
data/output_betas_all_models/
Direct selection gradient estimates for all cross-sectional and full-season models across all four populations. Prior to model fitting, all three traits were converted to z-scores by subtracting within-population means and dividing by within-population standard deviations.
File naming convention:
direct_All_[Pop]_[Space]_bZ.csv— selection estimated across all individuals in a population (full season, longitudinal).direct_Batch_[Pop]_b[Batch].csv— selection estimated within a single gene trap interval (cross-sectional).direct_selection_estiamtes_all_95CI.csv— compiled output from all models with posterior means and 95% credible intervals.
Variables in model output files:
| Variable | Description |
|---|---|
Mean |
Posterior mean of the selection gradient. |
SD |
Posterior standard deviation. |
Naive SE |
Naive standard error of the posterior mean. |
Time-series SE |
Time-series standard error (accounts for MCMC autocorrelation). |
2.5% |
Lower bound of the 95% credible interval. |
97.5% |
Upper bound of the 95% credible interval. |
row_names |
Selection gradient parameter (see below). |
batch |
Time batch identifier (bA–bQ; bZ = full season). |
Plot |
Population (B30, Comp, Fwest, Track). |
selection |
Type of selection estimated (direct_all). |
csv_title |
Source file name. |
Selection gradient parameters:
| Parameter | Description |
|---|---|
z.ft.S |
Standardized directional selection gradient on flowering time (day of first flower). Positive values indicate later-flowering plants sired more offspring. |
z.dur.S |
Standardized directional selection gradient on flowering duration. Positive values indicate longer-blooming plants sired more offspring. |
z.sd.S |
Standardized directional selection gradient on flowering start date; used in longitudinal models. |
The convergence/ subdirectory contains Gelman–Rubin convergence diagnostics for all models.
data/pedigree_assignment/
Parentage assignment results from MasterBayes for each population (pedigee_bZ_[pop].csv).
| Variable | Description |
|---|---|
P.1 |
Offspring ID. |
P.2 |
Mother–batch identifier. |
P.3 |
Assigned pollen donor plant ID (position within plot). |
prob |
Posterior probability of the parentage assignment (0–1). |
Batch codes
Gene trap batches divide the flowering season into discrete intervals, each corresponding to one rotation of male-sterile pollen-recipient plants. Some batch letters are skipped (bF, bH, bJ, bL) because those intervals were not genotyped and are excluded from analysis. bZ denotes the full-season longitudinal model.
Experimental run 1 — B30 and Comp (July–August):
| Batch code | Gene trap interval | Dates |
|---|---|---|
| bA | 1.1 | 4–7 July |
| bB | 1.2 | 11–14 July |
| bB2 | 1.3 | 14–21 July |
| bC | 1.4 | 21–25 July |
| bD | 1.5 | 25–28 July |
| bD2 | 1.6 | 28 July – 1 Aug |
| bE | 1.7 | 1–11 Aug |
Experimental run 2 — FarWest and Track (August–October):
| Batch code | Gene trap interval | Dates |
|---|---|---|
| bG | 2.1 | 16–20 Aug |
| bI | 2.2 | 24–28 Aug |
| bK | 2.3 | 1–5 Sept |
| bM | 2.4 | 9–13 Sept |
| bN | 2.5 | 17–21 Sept |
| bO | 2.6 | 25–29 Sept |
| bP | 2.7 | 3–7 Oct |
| bQ | 2.8 | 7–13 Oct |
Note: bG is present in Track but not FarWest because the MCMC model for FarWest bG did not reach convergence and was excluded from analysis.
Table descriptions
The tables folder in this repository contains tables with useful information and statistics for the dataset. You can find the descriptions of each table below:
| Table name | Description | Note | ||
|---|---|---|---|---|
| all_selection_estimats_dir_and_indirect.csv | Selection estimates (both longitudinal and directional) for all plots considering both direct (multivariate) and indirect (univariate) models | Direct selection models are the leftmost, while indirect selection models are the rightmost (also labeled) | ||
| convergence_tables_formatted.xlxs | Convergence information from the MCMC models | Includes outputs from the direct (multivariate) and indirect (univariate) models | ||
| correlations_cross sectional_.csv | Correlations within each cross section per plot of pairwise trait combinations | |||
| correlations_longitudinal.csv | Correlations of each trait within a plot across longitudinal time | |||
| dir_indirect_selection_total_flowers.csv | Direct and indirect selection estimates for total flowers for each cross section | Shape is the pch in ggplot | ||
| linear_and_quadratic_model_table.csv | Results from both linear and quadratic selection estimates longitudinally across all plots. | Fit_Type column indicates if quadratic or linear models better explain the shape of the data with a model comparison test. | ||
| trait_means_.csv | Mean trait value for each of the three traits by plot | unique_dads_per_genetrap.csv | Number of unique dads per genetrap plant as determined by the absolute paternity assignment |
data-intermediate/
Processed data derived from data-raw/, used as inputs to model-fitting scripts. Do not edit these files directly; re-run scripts/prep_raw_data.R to regenerate.
genetic data/BrapaG_[Pop].csv
Processed microsatellite genotype data for each population (B30, Comp, Fwest, Track). Each row is one plant (pollen donor, gene trap, or offspring).
| Variable | Description |
|---|---|
id |
Plant position ID. |
A10A8a, A10A8b |
Allele 1 and allele 2 at locus A10A8. |
A10D9a, A10D9b |
Alleles at locus A10D9. |
A12E5a, A12E5b |
Alleles at locus A12E5. |
B19a, B19b |
Alleles at locus B19. |
B33a, B33b |
Alleles at locus B33. |
B37a, B37b |
Alleles at locus B37. |
B422a, B422b |
Alleles at locus B422. |
B5a, B5b |
Alleles at locus B5. |
B7a, B7b |
Alleles at locus B7. |
R2A5a, R2A5b |
Alleles at locus R2A5. |
sex |
Plant sex class (male = pollen donor; female = gene trap/offspring). |
phenotype data/BrapaP_[Pop].csv
Cleaned phenotype and spatial data for each population, merged and ready for model fitting.
| Variable | Description |
|---|---|
id |
Plant position ID. |
offspring |
Whether the plant is an offspring (1) or pollen donor/gene trap (0). |
terr |
Territory or sub-plot identifier. |
timevar |
Batch code indicating which gene trap interval the plant was active in. |
X |
X coordinate (meters). |
Y |
Y coordinate (meters). |
ft |
Flowering time (Julian day of first flower). |
dur |
Flowering duration (days). |
tot_flwrs |
Total flower count across the season. |
sex |
Plant sex class. |
pedigree_data/total_sired_offspring_per_father.csv
Total number of offspring sired by each pollen donor plant across the full season (all parentage assignments included regardless of posterior probability threshold).
| Variable | Description |
|---|---|
P.3 |
Pollen donor plant position ID. |
Count |
Total number of offspring assigned to this plant. |
pedigree_data/total_sired_offspring_per_father_20_percent_threshold.csv
Same as above, but filtered to include only parentage assignments with posterior probability ≥ 0.20.
R scripts
All scripts are in scripts/ unless otherwise noted.
| Script | Purpose | Key inputs | Key outputs |
|---|---|---|---|
R/conversion_functions.R |
Helper functions for data type conversion and cleaning; sourced by other scripts. Not run directly. | — | — |
scripts/prep_raw_data.R |
Reads raw phenology CSVs and genotype data; cleans and merges into population-level objects; also contains MasterBayes model setup code. | data-raw/[pop]phenZeros*.csv, data-raw/[clump/even]_coord.csv |
data-intermediate/genetic data/BrapaG_[Pop].csv, data-intermediate/phenotype data/BrapaP_[Pop].csv |
scripts/run_models.R |
Runs three independent MCMC chains via MCMCped() for full-season parentage analysis; writes raw chain output CSVs. |
data-intermediate/genetic data/BrapaG_[Pop].csv, data-intermediate/phenotype data/BrapaP_[Pop].csv |
data/betas_longitudinal_no_subsampling/_ch[1-3]_All_[Pop]_Euclidian_bZ_.csv |
scripts/slices_all_chain_distribution_code.R |
Main analysis loop; iterates over all population × batch combinations from the lookup table; runs MasterBayes cross-sectional and longitudinal models; writes direct selection gradient estimates. | data-raw/slices_beta_distributions.csv, data-intermediate/genetic data/BrapaG_[Pop].csv, data-intermediate/phenotype data/BrapaP_[Pop].csv |
data/output_betas_all_models/direct_*.csv, chain output CSVs |
scripts/convergence_csv_creation.R |
Reads MCMC chain files and compiles Gelman–Rubin convergence diagnostics for all models. | data/betas_longitudinal_no_subsampling/_ch*.csv, data/output_betas_all_models/convergence/ |
tables/convergence_table_formatted.xlsx |
scripts/correlations_and_figs.R |
Calculates inter-trait correlations within and across populations; generates correlation plots. | data-intermediate/phenotype data/BrapaP_[Pop].csv |
tables/correlations_longitudinal.csv, tables/correlations_cross sectional.csv |
scripts/direct_vs_indirect_selection_figures.R |
Compiles direct and indirect selection estimates from model output files; generates summary tables and figures. | data/output_betas_all_models/direct_*.csv |
tables/all_selection_estimats_dir_and_indirect.csv, tables/dir_indirect_selection_total_flowers.csv |
scripts/make_figures.R |
Generates main manuscript figures: Figure 3 (selection gradients over time) and Figure 4 (distance decay of pollen movement). | data/output_betas_all_models/direct_selection_estiamtes_all_95CI.csv, R/conversion_functions.R |
PDF figures for manuscript |
scripts/make_distance_decay_figs.R |
Generates distance decay coefficient figures (data/output_betas_all_models/figs/distance_decay_overall_plot_95CI*.pdf). |
data/output_betas_all_models/direct_*.csv |
data/output_betas_all_models/figs/distance_decay_overall_plot_95CI.pdf, data/output_betas_all_models/figs/distance_decay_overall_plot_95CI_with_cutoff.pdf |
scripts/make_conflicting_selection_figure_code.R |
Generates Figure 1 (conceptual diagram of counter-balancing, punctuated, and steady selection patterns). | None (illustrative diagram) | Figure 1 PDF |
scripts/make_pedigree_space_visual_plots.R |
Spatial visualization of parentage assignments; plots sire–offspring distances within plots. | data/pedigree_assignment/pedigee_bZ_[pop].csv, data-raw/[clump/even]_coord.csv |
Spatial parentage plots (PDF) |
scripts/space_plots.R |
Creates field layout diagrams (Figure 2) and flowering phenology curves showing open flower counts across the season. | data-raw/[pop]phenZeros*.csv, data-raw/[clump/even]_coord.csv |
Figure 2 and phenology plots |
scripts/useful_means.R |
Calculates within-population trait means; generates trait correlation plots. | data-intermediate/phenotype data/BrapaP_[Pop].csv |
tables/trait_means.csv, correlation figures |
scripts/categorical_space_analysis.R |
Analyzes within-hexagon vs. between-hexagon mating rates in the clumped populations (Comp and FarWest). | data/pedigree_assignment/pedigee_bZ_[pop].csv, data-raw/clump_coord.csv |
Summary statistics (printed/saved) |
scripts/exploratory_paternity_with_pedigrees_scripts.R |
Exploratory parentage analyses and visualization. Not used in final manuscript. | data/pedigree_assignment/pedigee_bZ_[pop].csv |
Exploratory figures |
scripts/pollinator_code.R |
Processes and visualizes pollinator observation data. | data-raw/PollinatorVisitationDatafiles/*_editedForTimeSlices2.csv |
Pollinator summary figures |
scripts/selection_figures.Rmd |
Early R Markdown version of selection figure code; superseded by make_figures.R. Retained for reference. |
data/output_betas_all_models/direct_*.csv |
HTML/PDF report |
data-raw/PollinatorVisitationDatafiles/pollinator_code.R |
Duplicate/earlier version of pollinator analysis code; see scripts/pollinator_code.R. |
data-raw/PollinatorVisitationDatafiles/*_editedForTimeSlices2.csv |
Pollinator summary figures |
data/output_betas_all_models/linear_and_quadratic_models_for_cross_secitonal_selection.R |
Fits linear and quadratic models to the cross-sectional selection gradient time series; compares model fits. | data/output_betas_all_models/direct_selection_estiamtes_all_95CI.csv |
tables/linear_and_quadratic_model_table.csv |
Complete file index
The following table lists every file in this dataset. Files marked as [intermediate] are derived outputs that can be regenerated by the corresponding script; files marked [output] are analysis results; files marked [raw] are original unmodified data.
| File path | Description |
|---|---|
Slices_in_time.Rproj |
RStudio project file; open this to set the working directory correctly. |
README_Leventhal_2026.md |
This README file. |
| data-raw/ | |
data-raw/b30phenZerosJune7-2013.csv |
[raw] Daily open flower counts for B30 population (run 1, uniform). |
data-raw/compphenZerosJune7-2013.csv |
[raw] Daily open flower counts for Comp population (run 1, clumped). |
data-raw/fwphenZerosJune7-2013.csv |
[raw] Daily open flower counts for FarWest population (run 2, clumped). |
data-raw/tkphenZerosJune7-2013.csv |
[raw] Daily open flower counts for Track population (run 2, uniform). |
data-raw/clump_coord.csv |
[raw] Spatial coordinates for plants in the clumped arrangement (Comp and FarWest). |
data-raw/even_coord.csv |
[raw] Spatial coordinates for plants in the uniform arrangement (B30 and Track). |
data-raw/slices_beta_distributions.csv |
[raw] Lookup table of population × batch × spatial-model combinations for the model-fitting loop. |
data-raw/PollinatorVisitationDatafiles/PollinatorObservation_Comp&B30_editedForTimeSlices2.csv |
[raw] Pollinator observation counts for Comp and B30 populations. |
data-raw/PollinatorVisitationDatafiles/PollinatorObservation_FarWest&Track_editedForTimeSlices2.csv |
[raw] Pollinator observation counts for FarWest and Track populations. |
data-raw/PollinatorVisitationDatafiles/pollinator_code.R |
Early version of pollinator analysis script (see also scripts/pollinator_code.R). |
| data-intermediate/ | |
data-intermediate/genetic data/BrapaG_B30.csv |
[intermediate] Processed microsatellite genotypes for B30. |
data-intermediate/genetic data/BrapaG_Comp.csv |
[intermediate] Processed microsatellite genotypes for Comp. |
data-intermediate/genetic data/BrapaG_Fwest.csv |
[intermediate] Processed microsatellite genotypes for FarWest. |
data-intermediate/genetic data/BrapaG_Track.csv |
[intermediate] Processed microsatellite genotypes for Track. |
data-intermediate/phenotype data/BrapaP_B30.csv |
[intermediate] Cleaned phenotype and spatial data for B30. |
data-intermediate/phenotype data/BrapaP_Comp.csv |
[intermediate] Cleaned phenotype and spatial data for Comp. |
data-intermediate/phenotype data/BrapaP_Fwest.csv |
[intermediate] Cleaned phenotype and spatial data for FarWest. |
data-intermediate/phenotype data/BrapaP_Track.csv |
[intermediate] Cleaned phenotype and spatial data for Track. |
data-intermediate/pedigree_data/total_sired_offspring_per_father.csv |
[intermediate] Total offspring sired per pollen donor (all parentage assignments). |
data-intermediate/pedigree_data/total_sired_offspring_per_father_20_percent_threshold.csv |
[intermediate] Total offspring sired per pollen donor, filtered to ≥20% posterior probability. |
| data/betas_longitudinal_no_subsampling/ | |
data/betas_longitudinal_no_subsampling/_ch1_All_B30_Euclidian_bZ_.csv |
[output] MCMC chain 1, full-season model, B30. |
data/betas_longitudinal_no_subsampling/_ch2_All_B30_Euclidian_bZ_.csv |
[output] MCMC chain 2, full-season model, B30. |
data/betas_longitudinal_no_subsampling/_ch3_All_B30_Euclidian_bZ_.csv |
[output] MCMC chain 3, full-season model, B30. |
data/betas_longitudinal_no_subsampling/_ch1_All_Comp_Euclidian_bZ_.csv |
[output] MCMC chain 1, full-season model, Comp. |
data/betas_longitudinal_no_subsampling/_ch2_All_Comp_Euclidian_bZ_.csv |
[output] MCMC chain 2, full-season model, Comp. |
data/betas_longitudinal_no_subsampling/_ch3_All_Comp_Euclidian_bZ_.csv |
[output] MCMC chain 3, full-season model, Comp. |
data/betas_longitudinal_no_subsampling/_ch1_All_Fwest_Euclidian_bZ_.csv |
[output] MCMC chain 1, full-season model, FarWest. |
data/betas_longitudinal_no_subsampling/_ch2_All_Fwest_Euclidian_bZ_.csv |
[output] MCMC chain 2, full-season model, FarWest. |
data/betas_longitudinal_no_subsampling/_ch3_All_Fwest_Euclidian_bZ_.csv |
[output] MCMC chain 3, full-season model, FarWest. |
data/betas_longitudinal_no_subsampling/_ch1_All_Track_Euclidian_bZ_.csv |
[output] MCMC chain 1, full-season model, Track. |
data/betas_longitudinal_no_subsampling/_ch2_All_Track_Euclidian_bZ_.csv |
[output] MCMC chain 2, full-season model, Track. |
data/betas_longitudinal_no_subsampling/_ch3_All_Track_Euclidian_bZ_.csv |
[output] MCMC chain 3, full-season model, Track. |
data/betas_longitudinal_no_subsampling/combined_chains_b30.csv |
[output] Combined (merged) MCMC chains for B30 longitudinal model. |
data/betas_longitudinal_no_subsampling/combined_chains_Tracl.csv |
[output] Combined MCMC chains for Track longitudinal model. Note: filename contains a typo ("Tracl" not "Track"). |
data/betas_longitudinal_no_subsampling/withandwithoutsubsamplingtable.xlsx |
[output] Comparison of longitudinal selection gradient estimates with vs. without proportional subsampling across gene trap intervals; corresponds to Table S4 in the manuscript. |
| data/output_betas_all_models/ | |
data/output_betas_all_models/direct_All_B30_bZ.csv |
[output] Full-season direct selection gradients for B30. |
data/output_betas_all_models/direct_All_B30_Euclidean_bZ.csv |
[output] Full-season direct selection gradients for B30, Euclidean distance model. |
data/output_betas_all_models/direct_All_Comp_bZ.csv |
[output] Full-season direct selection gradients for Comp. |
data/output_betas_all_models/direct_All_Comp_Euclidean_bZ.csv |
[output] Full-season direct selection gradients for Comp, Euclidean distance model. |
data/output_betas_all_models/direct_All_Fwest_bZ.csv |
[output] Full-season direct selection gradients for FarWest. |
data/output_betas_all_models/direct_All_Fwest_Euclidean_bZ.csv |
[output] Full-season direct selection gradients for FarWest, Euclidean distance model. |
data/output_betas_all_models/direct_All_Track_bZ.csv |
[output] Full-season direct selection gradients for Track. |
data/output_betas_all_models/direct_Batch_B30_Euclidean_bA.csv |
[output] Cross-sectional direct selection gradients, B30, batch bA, Euclidean distance model. |
data/output_betas_all_models/direct_Batch_B30_bA.csv |
[output] Cross-sectional direct selection gradients, B30, batch bA. |
data/output_betas_all_models/direct_Batch_B30_bB.csv |
[output] Cross-sectional direct selection gradients, B30, batch bB. |
data/output_betas_all_models/direct_Batch_B30_bB2.csv |
[output] Cross-sectional direct selection gradients, B30, batch bB2. |
data/output_betas_all_models/direct_Batch_B30_bC.csv |
[output] Cross-sectional direct selection gradients, B30, batch bC. |
data/output_betas_all_models/direct_Batch_B30_bD.csv |
[output] Cross-sectional direct selection gradients, B30, batch bD. |
data/output_betas_all_models/direct_Batch_B30_bD2.csv |
[output] Cross-sectional direct selection gradients, B30, batch bD2. |
data/output_betas_all_models/direct_Batch_B30_bE.csv |
[output] Cross-sectional direct selection gradients, B30, batch bE. |
data/output_betas_all_models/direct_Batch_Comp_bA.csv |
[output] Cross-sectional direct selection gradients, Comp, batch bA. |
data/output_betas_all_models/direct_Batch_Comp_bB.csv |
[output] Cross-sectional direct selection gradients, Comp, batch bB. |
data/output_betas_all_models/direct_Batch_Comp_bB2.csv |
[output] Cross-sectional direct selection gradients, Comp, batch bB2. |
data/output_betas_all_models/direct_Batch_Comp_bC.csv |
[output] Cross-sectional direct selection gradients, Comp, batch bC. |
data/output_betas_all_models/direct_Batch_Comp_bD.csv |
[output] Cross-sectional direct selection gradients, Comp, batch bD. |
data/output_betas_all_models/direct_Batch_Comp_bD2.csv |
[output] Cross-sectional direct selection gradients, Comp, batch bD2. |
data/output_betas_all_models/direct_Batch_Comp_bE.csv |
[output] Cross-sectional direct selection gradients, Comp, batch bE. |
data/output_betas_all_models/direct_Batch_Fwest_bI.csv |
[output] Cross-sectional direct selection gradients, FarWest, batch bI. |
data/output_betas_all_models/direct_Batch_Fwest_bK.csv |
[output] Cross-sectional direct selection gradients, FarWest, batch bK. |
data/output_betas_all_models/direct_Batch_Fwest_bM.csv |
[output] Cross-sectional direct selection gradients, FarWest, batch bM. |
data/output_betas_all_models/direct_Batch_Fwest_bN.csv |
[output] Cross-sectional direct selection gradients, FarWest, batch bN. |
data/output_betas_all_models/direct_Batch_Fwest_bO.csv |
[output] Cross-sectional direct selection gradients, FarWest, batch bO. |
data/output_betas_all_models/direct_Batch_Fwest_bP.csv |
[output] Cross-sectional direct selection gradients, FarWest, batch bP. |
data/output_betas_all_models/direct_Batch_Fwest_bQ.csv |
[output] Cross-sectional direct selection gradients, FarWest, batch bQ. |
data/output_betas_all_models/direct_Batch_Track_bG.csv |
[output] Cross-sectional direct selection gradients, Track, batch bG. |
data/output_betas_all_models/direct_Batch_Track_bI.csv |
[output] Cross-sectional direct selection gradients, Track, batch bI. |
data/output_betas_all_models/direct_Batch_Track_bK.csv |
[output] Cross-sectional direct selection gradients, Track, batch bK. |
data/output_betas_all_models/direct_Batch_Track_bM.csv |
[output] Cross-sectional direct selection gradients, Track, batch bM. |
data/output_betas_all_models/direct_Batch_Track_bN.csv |
[output] Cross-sectional direct selection gradients, Track, batch bN. |
data/output_betas_all_models/direct_Batch_Track_bO.csv |
[output] Cross-sectional direct selection gradients, Track, batch bO. |
data/output_betas_all_models/direct_Batch_Track_bP.csv |
[output] Cross-sectional direct selection gradients, Track, batch bP. |
data/output_betas_all_models/direct_Batch_Track_bQ.csv |
[output] Cross-sectional direct selection gradients, Track, batch bQ. |
data/output_betas_all_models/direct_selection_estiamtes_all_95CI.csv |
[output] Compiled selection gradient estimates from all models with 95% credible intervals. Note: filename contains a typo ("estiamtes"). |
data/output_betas_all_models/convergence/direct_All_B30_bZ.csv |
[output] Gelman–Rubin convergence diagnostics for B30 full-season model. |
data/output_betas_all_models/convergence/indirect_sd_All_B30_bZ.csv |
[output] Gelman–Rubin diagnostics for B30 indirect selection model (flowering start date). |
data/output_betas_all_models/convergence/indirect_tf_All_B30_bZ.csv |
[output] Gelman–Rubin diagnostics for B30 indirect selection model (total flowers). |
data/output_betas_all_models/linear_and_quadratic_models_for_cross_secitonal_selection.R |
R script that fits linear and quadratic models to the cross-sectional selection time series. |
data/output_betas_all_models/plots/plot_B30_X.DS.pdf |
[output] Plot of distance decay coefficient over time, B30 (PDF). |
data/output_betas_all_models/plots/plot_B30_X.DS.png |
[output] Plot of distance decay coefficient over time, B30 (PNG). |
data/output_betas_all_models/plots/plot_B30_z.dur.S.pdf |
[output] Selection gradient on flowering duration over time, B30 (PDF). |
data/output_betas_all_models/plots/plot_B30_z.dur.S.png |
[output] Selection gradient on flowering duration over time, B30 (PNG). |
data/output_betas_all_models/plots/plot_B30_z.ft.S.pdf |
[output] Selection gradient on flowering time over time, B30 (PDF). |
data/output_betas_all_models/plots/plot_B30_z.ft.S.png |
[output] Selection gradient on flowering time over time, B30 (PNG). |
data/output_betas_all_models/plots/plot_B30_z.tot_flwrs.S.pdf |
[output] Selection gradient on total flowers over time, B30 (PDF). |
data/output_betas_all_models/plots/plot_B30_z.tot_flwrs.S.png |
[output] Selection gradient on total flowers over time, B30 (PNG). |
data/output_betas_all_models/plots/plot_Comp_X.DS.pdf |
[output] Plot of distance decay coefficient over time, Comp (PDF). |
data/output_betas_all_models/plots/plot_Comp_X.DS.png |
[output] Plot of distance decay coefficient over time, Comp (PNG). |
data/output_betas_all_models/plots/plot_Comp_z.dur.S.pdf |
[output] Selection gradient on flowering duration over time, Comp (PDF). |
data/output_betas_all_models/plots/plot_Comp_z.dur.S.png |
[output] Selection gradient on flowering duration over time, Comp (PNG). |
data/output_betas_all_models/plots/plot_Comp_z.ft.S.pdf |
[output] Selection gradient on flowering time over time, Comp (PDF). |
data/output_betas_all_models/plots/plot_Comp_z.ft.S.png |
[output] Selection gradient on flowering time over time, Comp (PNG). |
data/output_betas_all_models/plots/plot_Comp_z.tot_flwrs.S.pdf |
[output] Selection gradient on total flowers over time, Comp (PDF). |
data/output_betas_all_models/plots/plot_Comp_z.tot_flwrs.S.png |
[output] Selection gradient on total flowers over time, Comp (PNG). |
data/output_betas_all_models/plots/plot_Fwest_X.DS.pdf |
[output] Plot of distance decay coefficient over time, FarWest (PDF). |
data/output_betas_all_models/plots/plot_Fwest_X.DS.png |
[output] Plot of distance decay coefficient over time, FarWest (PNG). |
data/output_betas_all_models/plots/plot_Fwest_z.dur.S.pdf |
[output] Selection gradient on flowering duration over time, FarWest (PDF). |
data/output_betas_all_models/plots/plot_Fwest_z.dur.S.png |
[output] Selection gradient on flowering duration over time, FarWest (PNG). |
data/output_betas_all_models/plots/plot_Fwest_z.ft.S.pdf |
[output] Selection gradient on flowering time over time, FarWest (PDF). |
data/output_betas_all_models/plots/plot_Fwest_z.ft.S.png |
[output] Selection gradient on flowering time over time, FarWest (PNG). |
data/output_betas_all_models/plots/plot_Fwest_z.tot_flwrs.S.pdf |
[output] Selection gradient on total flowers over time, FarWest (PDF). |
data/output_betas_all_models/plots/plot_Fwest_z.tot_flwrs.S.png |
[output] Selection gradient on total flowers over time, FarWest (PNG). |
data/output_betas_all_models/plots/plot_Track_X.DS.pdf |
[output] Plot of distance decay coefficient over time, Track (PDF). |
data/output_betas_all_models/plots/plot_Track_X.DS.png |
[output] Plot of distance decay coefficient over time, Track (PNG). |
data/output_betas_all_models/plots/plot_Track_z.dur.S.pdf |
[output] Selection gradient on flowering duration over time, Track (PDF). |
data/output_betas_all_models/plots/plot_Track_z.dur.S.png |
[output] Selection gradient on flowering duration over time, Track (PNG). |
data/output_betas_all_models/plots/plot_Track_z.ft.S.pdf |
[output] Selection gradient on flowering time over time, Track (PDF). |
data/output_betas_all_models/plots/plot_Track_z.ft.S.png |
[output] Selection gradient on flowering time over time, Track (PNG). |
data/output_betas_all_models/plots/plot_Track_z.tot_flwrs.S.pdf |
[output] Selection gradient on total flowers over time, Track (PDF). |
data/output_betas_all_models/plots/plot_Track_z.tot_flwrs.S.png |
[output] Selection gradient on total flowers over time, Track (PNG). |
data/output_betas_all_models/figs/distance_decay_overall_plot_95CI.pdf |
[output] Distance decay of pollen movement across all populations (PDF). |
data/output_betas_all_models/figs/distance_decay_overall_plot_95CI_with_cutoff.pdf |
[output] Distance decay plot with distance cutoff shown (PDF). |
| data/pedigree_assignment/ | |
data/pedigree_assignment/pedigee_bZ_b30.csv |
[output] Parentage assignments for B30, full season. |
data/pedigree_assignment/pedigee_bZ_comp.csv |
[output] Parentage assignments for Comp, full season. |
data/pedigree_assignment/pedigee_bZ_fwest.csv |
[output] Parentage assignments for FarWest, full season. |
data/pedigree_assignment/pedigee_bZ_track.csv |
[output] Parentage assignments for Track, full season. |
| tables/ | |
tables/all_selection_estimats_dir_and_indirect.csv |
[output] Compiled direct and indirect selection estimates for all plots and batches. |
tables/convergence_table_formatted.xlsx |
[output] Formatted Gelman–Rubin convergence diagnostics table. |
tables/correlations_cross sectional.csv |
[output] Pairwise trait correlations within each cross-sectional interval per population. |
tables/correlations_longitudinal.csv |
[output] Pairwise trait correlations within each population across the full season. |
tables/dir_indirect_selection_total_flowers.csv |
[output] Direct and indirect selection estimates for total flowers per cross-sectional interval. |
tables/linear_and_quadratic_model_table.csv |
[output] Linear and quadratic model fits to cross-sectional selection gradient time series. |
tables/trait_means.csv |
[output] Within-population mean values for flowering time, total flowers, and duration. |
tables/unique_dads_per_genetrap.csv |
[output] Number of unique pollen donors siring offspring per gene trap plant per batch, per population. Columns: Var1 (plant ID), Var2 (batch code), Freq (number of unique sires), plot. |
| scripts/ | |
scripts/prep_raw_data.R |
Cleans raw phenology and genotype data; generates data-intermediate/ files. |
scripts/run_models.R |
Runs MCMC chains for full-season parentage models. |
scripts/slices_all_chain_distribution_code.R |
Main model loop for all cross-sectional and longitudinal selection analyses. |
scripts/convergence_csv_creation.R |
Compiles Gelman–Rubin convergence diagnostics from chain files. |
scripts/correlations_and_figs.R |
Calculates inter-trait correlations and generates correlation figures. |
scripts/direct_vs_indirect_selection_figures.R |
Compiles direct vs. indirect selection estimates and generates summary figures. |
scripts/make_figures.R |
Generates main manuscript figures (Figures 3 and 4). |
scripts/make_distance_decay_figs.R |
Generates distance decay coefficient figures. |
scripts/make_conflicting_selection_figure_code.R |
Generates Figure 1 (conceptual diagram). |
scripts/make_pedigree_space_visual_plots.R |
Spatial visualization of parentage assignments. |
scripts/space_plots.R |
Field layout diagrams (Figure 2) and phenology curves. |
scripts/useful_means.R |
Calculates trait means by population. |
scripts/categorical_space_analysis.R |
Within- vs. between-hexagon mating analysis for clumped populations. |
scripts/exploratory_paternity_with_pedigrees_scripts.R |
Exploratory parentage analyses (not in final manuscript). |
scripts/pollinator_code.R |
Processes and visualizes pollinator observation data. |
scripts/selection_figures.Rmd |
Early R Markdown version of selection figure code (superseded). |
R/conversion_functions.R |
Helper functions for data cleaning and conversion; sourced by other scripts. |
Code/Software
All analyses were conducted in R 4.5.2. Key packages: MasterBayes (v2.58) for Bayesian parentage analysis and selection gradient estimation; coda for MCMC convergence diagnostics; dplyr, tidyr, ggplot2 for data processing and visualization.
