Eco-evolutionary feedback reshapes competitive dynamics in an orchard fly system
Data files
Jun 18, 2026 version files 2.09 MB
-
body_mass_2024.Rmd
18.63 KB
-
body_mass.csv
63.87 KB
-
cage_nums.csv
2.76 KB
-
census_2024.Rmd
68.84 KB
-
census_20251219.csv
169.44 KB
-
dev_time_2024.Rmd
11.23 KB
-
dev_time.csv
949.43 KB
-
eff_sizes_q.Rmd
14.86 KB
-
fecundity_2024.Rmd
11.24 KB
-
fecundity.csv
34.78 KB
-
functions.R
54.08 KB
-
ordered_eff_sizes.csv
2.49 KB
-
pupation_2024.Rmd
11.32 KB
-
pupation.csv
28.35 KB
-
README.md
9.53 KB
-
starvation_2024.Rmd
11.36 KB
-
starvation_tolerance.csv
181.91 KB
-
temp_2024.csv
439.94 KB
-
temperature_2024.Rmd
2.54 KB
Jul 11, 2026 version files 2.09 MB
-
body_mass_2024.Rmd
18.63 KB
-
body_mass.csv
63.87 KB
-
cage_nums.csv
2.76 KB
-
census_2024.Rmd
68.84 KB
-
census_20251219.csv
169.44 KB
-
dev_time_2024.Rmd
11.23 KB
-
dev_time.csv
949.43 KB
-
eff_sizes_q.Rmd
22.05 KB
-
fecundity_2024.Rmd
11.24 KB
-
fecundity.csv
34.78 KB
-
functions.R
54.08 KB
-
ordered_eff_sizes.csv
3 KB
-
pupation_2024.Rmd
11.32 KB
-
pupation.csv
28.35 KB
-
README.md
9.53 KB
-
starvation_2024.Rmd
11.36 KB
-
starvation_tolerance.csv
181.91 KB
-
temp_2024.csv
439.94 KB
-
temperature_2024.Rmd
2.54 KB
Abstract
In this study, we conducted an outdoor mesocosm experiment with four pairs of Drosophilid fly species in order to quantify how competitors evolve in response to one another and how this evolution shapes species' subsequent competitive trajectories. To quantify evolution in response to competitors, we established mesocosms in which fly populations grew in monocultures (without competitors present) or in two-species mixtures. In the latter, "full evolution" mesocosms, populations were allowed to freely evolve in response to heterospecific competitors. After 5-10 generations, we measured competition-relevant phenotypes (body mass, egg-to-adult development time, fecundity, pupation location, and starvation tolerance) in each population. This repository therefore contains datasets with each of these phenotypic measurements, as well as the code to reproduce our analyses of competition-induced evolution. Second, to quantify the effects of evolution on species' subsequent competitive trajectories, we established additional "limited evolution" mixture mesocosms in which we allowed species' abundances to change over time in response to competition, but prevented evolution in response to heterospecifics by replacing all eclosed adults in these treatments with eclosed adults from paired monoculture mesocosms. By comparing species' frequencies and abundances in "limited evolution" and "full evolution" mixture mesocosms, we quantify the effects of competition-induced evolution on species' competitive trajectories. This repository therefore contains all census data on frequencies and estimated abundances in mesocosms throughout the experiment, along with code to analyze the population dynamics in these mesocosms. Finally, this repository also contains data and code on basic features of our study (e.g., cage identities, temperatures throughout the experiment) as well as functions required to carry out other parts of the analyses. Our analyses revealed ubiquitous competition-induced evolution across the species and pairs, with strong effects on the competitive population dynamics across each pair. These results suggest that the feedback between competition and evolution may be common and strong enough to maintain species diversity on ecological timescales.
These data were collected during an experiment conducted in the summer and fall of 2024. The experiment examined how Drosophilid species evolve in response to competitors and how this evolution affects competitors' subsequent population dynamics. The data and accompanying code are used to analyze phenotypic evolution in response to competitors across a suite of traits; higher-level patterns in that phenotypic evolution (e.g., character divergence or convergence across competitor species); changes in population dynamics resulting from competitor-induced evolution; and finally, temperature collect over the course of the experiment using iButton sensors. There is also an accompanying R script that contains functions used across the rest of the code. Each data and code file will be described here. The code makes the basic figures used in the associated manuscript, though figure aesthetics were adjusted in Illustrator.
- cage_nums.csv: This dataset contains information on the numbers and treatments of all cages, with columns identifying cage number (num), species pair (pair), treatment (type) and block.
- temp_2024.csv: This dataset contains the temperature data, with columns identifying the date, time, temperature (temp), and iButton replicate.
- body_mass.csv: This dataset contains information on body size (dry mass) of males and females. Observations are of body mass measured on pools of same-sex individuals. Columns identify species, cage, treatment, competitor (self for monoculture), replicate within cage and sex and treatment, sex, number of individuals being measured (num), total mass of the pool (mass), and the average mass per individual (mass/num).
- dev_time.csv: This dataset contains information on development times of individuals. Each observation is the estimated development time of a single individual, measured as the median time between when it was last observed not eclosed and when it was first observed eclosed. The columns identify cage, species pair (pair), block, species, treatment, competitor, replicate, development time in hours (dev_time), and the vial (which is cage and replicate pasted together).
- fecundity.csv: This dataset contains information on fecundity of mated females, measured as the number of eggs laid per day over two-day trials. Columns contain information on species, treatment, competitor, cage, eggs laid on each day (eggs.1 and eggs.2), the number of females in each trial on each day (fem.1 and fem.2), the average number of eggs per female per day on each day (avg.day1 and avg.day2), and the total average eggs per female per day (eggs.per.fem), measured as (avg.day1 + avg.day2)/2. There is also a column that identifies points to be excluded (outlier). There are three points to be excluded. One is not really an outlier, but rather a fecundity trial in which data for the second day was not available and because oviposition rate can vary over the days, this point was excluded. The other two points are outliers in which D. hydei laid no eggs at all over the course of each trial very likely reflecting that individuals were either not reproductive yet (most likely), incorrectly sexed, raised in vials without males for some reason, or for some other reason nonreproductive.
- pupation.csv: This dataset contains information on pupation in density-controlled vials. Each observation is the proportion of individuals in the vial that pupated on the walls of the vial vs. the floor of the medium. The columns contain information on species, cage, replicate, treatment, and competitor, as well as the proportion that pupated on the floor (p.floor) and walls (p.walls).
- starvation_tolerance.csv: This dataset contains information on individuals' starvation tolerance the amount of time they lived with access only to water and no food. Each observation is the first hour an individual was observed to be dead. The columns contain information on cage, pair, block, species, treatment, competitor, and replicate, as well as the female within the replicate vial (female), the female within the vial, the time of death (time.death), comp_pair (which is just competitor and pair pasted together), and the median time between when an individual was last observed to be alive and first observed to be dead.
- ordered_eff_sizes.csv: This dataset contains information on how pairs of competitors traits' evolved from monoculture to mixture. Each observation has two estimates of trait shift (with uncertainty), one for each competitor in a pair. Estimates were calculated from GLM's. The model estimates in this dataset were generated using models and processing throughout several of the Rmarkdown files below. Some of the estimates were just arranged in this spreadsheet for easier plotting. This dataset was used for plotting patterns of trait evolution across competitor species (e.g., character divergence, character convergence, etc.). So that, for example, the bottom right quadrant in the plot always corresponds to character divergence, species 1 in this dataset is always the species with the greater trait value in monoculture. The columns contain information on the identities of species 1 and 2 (sp1 and sp2), the species pair, the assay (unit), the medians and credible intervals (median1, median2, lower1, lower2, upper1, and upper2), the signs of the evolutionary shift between monoculture and mixture for species 1 (sign1) and species 2 (sign2), and columns indicating whether both species shifted significantly (both_shift) or at least one of the two species shifted significantly (one_shift).
- census_20251219.csv: This dataset contains information on population dynamics in all mesocosms. For mixture cages, we have observations of frequencies of each of the two species, quantified by aspirating samples of flies and counting the number of individuals of each species. For both mixtures and monocultures, we have observations of the number of total fly individuals at squares on the cage ceilings. For mixtures, we can combine frequencies, total counts, and calibration factors that relate flies' relative propensity to fly to the cage ceiling to estimate each species' population size. The equation to do this is presented in the methods of the associated manuscript. We can do the same for mixture, where we only need a calibration factor for each species. For this dataset, the columns therefore give information on cage, container (pan, at the beginning of the experiment, or bottle, for most of the experiment), block, type, species, pair, date, the total count of flies across ceiling squares (total.count), the species in the cage (sp1 and sp2, which is NA if monoculture), the number of each species in the frequency sample (n.sp1 and n.sp2, both NA if monoculture), and the calculated frequency (freq). We also have calibration factors, c1 and c2, depending on the species, though note that for monocultures, we use 1/c1 as the equation to go from total.count to estimated population size is simpler. We then also have r1 and r2, where r1 is the ratio of species 1 to species 2 in the cage and r2 is 1/r1. Finally, we have n1.est and n2.est (NA in monoculture), which are the species' estimated population sizes. We also have an additional column, inv.H, which gives the number of hydei invader individuals in the frequency sample of the invaded cage (115).
- temperature_2024.Rmd: In this code, we do a simple summary of temperature data from iButton sensors to look at mean, max, and min temperatures throughout the course of the experiment.
- body_mass_2024.Rmd: In this code, we construct generalized linear mixed effects models (GLMMs) of dry body mass (male and female, separately) for each species, then plot the resulting estimates.
- dev_time_2024.Rmd: In this code, we construct generalized linear mixed effects models (GLMMs) of development time for each species, then plot the resulting estimates.
- fecundity_2024.Rmd: In this code, we construct generalized linear mixed effects models (GLMMs) of fecundity for each species, then plot the resulting estimates.
- pupation_2024.Rmd: In this code, we construct generalized linear mixed effects models (GLMMs) of pupation location for each species, then plot the resulting estimates.
- starvation_2024.Rmd: In this code, we construct generalized linear mixed effects models (GLMMs) of starvation tolerance for each species, then plot the resulting estimates.
- eff_sizes_q.Rmd: In this code, we use the GLMM's constructed in the above five Rmarkdown files to compute evolved phenotypic differences from monoculture to mixture across pairs. We then look at patterns of how these shifted across competitors in a pair, partitioning into character convergence, character divergence, or parallel shifts.
- census_2024.Rmd: In this code, we analyze population dynamics in cages, with the main goal of analyzing how dynamics differ (or do not differ) between full evolution and limited evolution cages. First, we conduct an analysis of species' frequencies in the two types of cages. Then, we conduct an analysis of species estimated abundances in the cages (including monocultures) over time. For both analyses, we use generalized linear models with autocorrelation terms. We also compute integrated differences between monoculture and mixture abundances to estimate effects of competition on abundance.
- functions.R: This code contains several functions used throughout the Rmarkdown documents.
Changes after Jun 18, 2026: Two corrections were made. First, one of the lines connecting error bars in Fig. 3 in the main manuscript was not showing. Second, the points and error bars in that figure were previously computed using the standard deviation pooled across all treatments for a species, rather than for just the monoculture and relevant mixture treatment. The code to make this figure (eff_sizes_q.Rmd) was corrected, fixing both errors. The corresponding csv (ordered_eff_sizes.csv) was also updated.
