DOI: 10.5061/dryad.2547d7wzp
title: Data from: Mating environments mediate the evolution of behavioral isolation during ecological speciation

description: The evolution of behavioral isolation is often the first step towards
 speciation. While past studies show that behavioral isolation will
 sometimes evolve as a by-product of divergent ecological selection, we
 lack a more nuanced understanding of factors that may promote or hamper
 its evolution. The environment in which mating occurs may be important in
 mediating whether behavioral isolation evolves for two reasons. Ecological
 speciation could occur as a direct outcome of different sexual
 interactions being favored in different mating environments.
 Alternatively, mating environments may vary in the constraint they impose
 on traits underlying mating interactions, such that populations evolving
 in a ‘constraining’ mating environment would be less likely to evolve
 behavioral isolation than populations evolving in a less constraining
 mating environment. In the latter, mating environment is not the direct
 cause of behavioral isolation but rather permits its evolution only if
 other drivers are present. We test these ideas with a set of 28
 experimental fly populations, each of which evolved under one of two
 mating environments and one of two larval environments. Counter to the
 prediction of ecological speciation by mating environment, behavioral
 isolation was not maximal between populations evolved in different mating
 environments. Nonetheless, mating environment was an important factor as
 behavioral isolation evolved among populations from one mating environment
 but not among populations from the other. Though one mating environment
 was conducive to the evolution of behavioral isolation, it was not
 sufficient: assortative mating only evolved between populations adapting
 to different larval environments within that mating environment,
 indicating a role for ecological speciation. Intriguingly, the mating
 environment that promoted behavioral isolation is characterized by less
 sexual conflict compared to the other mating environment. Our results
 suggest that mating environments plays a key role in mediating ecological
 speciation via other axes of divergent selection.
description: Data collection is described in the associated manuscript by
 Barerra et al. (2024) in Evolution Letters.
description: # Mating environments mediate the evolution of behavioral isolation during
 ecological speciation Data
 collection is described in the associated paper: Barerra et al. (2024) in
 Evolution Letters. There were three assays (experiments) performed. R code
 and accompanying data files are provided separately for each. Files with
 'RawData' in the name are not called by the R script, but are
 provided for completeness as they include additional information not
 included in processed data files. ## Description of the data and file
 structure **assay1_RawData**\ Rows are individual replicate mating trials.
 Columns are as follows:\ A-D: Mating environments (simple vs. complex) and
 larval environments (salt vs corn) of first (cols A and B) and second
 (cols C and D) populations in a given mating trial pair.\ E-H: color (R =
 red, G= Green) of males and females from the first and second population\
 I: indicates whether the male and female from a given population were the
 same or different color.\ J: ordinal categories of the day a given trial
 was performed.\ K: ordinal categories of the time of day a given trial was
 performed.\ L-O: number of matings observed involving Corn females (C_f),
 Corn males (C_m), Salt females (S_f) and Salt males (S_m).\ P: Total
 number of matings observed.\ Q: cage replicate number (categorical
 variable)\ R: categorical variable indicating person that observed that
 cage\ S & T: Full identities of populations 1 and 2 including larval
 and matings environments from cols A-D as well as replicate population
 number of each (7 populations for each combination of larval and mating
 environment). **assay1_Y_corn_as_reference**\ Rows are average number of
 matings among replicate cages of the indicated type. Averages are
 calculated across the various replicate corn populations tested with a
 given salt population. Columns are:\ A-B: the mating environment (simple
 vs complex) of the salt and of the corn populations used in a given type
 of pairing. \ C: the replicate population number of the corn population
 (categorical, 1 to 7)\ The average number of matings of each of the four
 combinations of males and females; labels as in assay1_RawData\ Y:
 continuous, the index of assortative mating calculated from the mating
 combinations. **assay1_Y_salt_as_reference**\ Same as
 assay1_Y_corn_as_reference except averages are calculated across the
 various replicate salt populations tested with a given corn population.
 **assay1_Y_corn_as_reference_colour**\ Same as assay1_Y_corn_as_reference
 except each particular combination of two populations is split depending
 on whether males and females from a given population were coloured the
 same or had different colours (as indicated in col. E).
 **assay2_RawData**\ Rows are replicate mating trials between a given
 combination of two populations. All populations were from the complex
 mating environment.\ A: the combination of populations where 1SC =
 population 1 from salt complex, 1CC = pop 1 from corn complex; others
 follow the same labeling convention;\ B: the larval environments (salt vs
 corn) of the two populations in a given replicate\ C: whether the pair
 tested involved a combination within a given larval environment (i.e. both
 salt or both corn), or between (i.e. one salt and one corn).\ D:
 replicates were performed across 9 blocks (days, first digit) and within
 four temporal blocks during a day (number after the decimal). \ E: cage
 ID\ F: observer for a given cage\ G indicates whether the males and
 females from a given population are the same or different colour; col H
 appends to this the colour of the females from the population listed first
 in col A\ I: total number of matings observed\ J-M, am = assortative
 matings, dm = disassortative matings; so J is the number of pop 1 females
 mating with pop 1 males, K is the number of pop 2 females mating with pop
 2 males, and L and M are the number of pop 1 females with pop 2 males and
 vice versa. **assay2_Y_No_Colour**\ Rows are average number of matings
 among replicate cages of the indicated type. \ A-C: as in cols A-C of
 assay2_RawData\ D-G: as in cols J-M of assay2_RawData except numbers are
 averages across all replicates of a given type. **assay2_Y**\ Same as
 assay2_Y_No_Colour except each particular combination of two populations
 is split depending on whether males and females from a given population
 were coloured the same or had different colours (as indicated in col. C).
 **assay3_data**\ Each row is a replicate female-choice mating trial (one
 female with one homospecific and one heterospecific male).\ A: whether the
 outcome (i.e. the mating mating) was assortative (female mated with her
 homospecific male) or disassortative (female mated with the heterospecific
 male).\ B: whether the heterospecific male was from the same (within_trt)
 or the other (among_trt) larval environment.\ C: ordinal variable for the
 day the trial was performed.\ D: population ID of the female used in the
 trial\ E: larval environment for the female\ F: concatenating cols D and E
 (all females were from the complex mating environment) and adding the
 replicate population number; 1CC is population 1 of corn complex, on so
 on\ G: population ID of the male the female mated with\ H: larval
 environment of the male the female mated with\ I: concatenating cols G and
 H (males were from the complex mating environment) and adding the
 replicate population number for the male the female mated with; 1CC is
 population 1 of corn complex, on so on\ J: colour marking of the mated
 male\ K: order of trials within a given day (ordinal variable) ##
 **Code/Software** Code is script for R version 4.2.3.