DOI: 10.5061/dryad.sqv9s4ngw
title: Data and code for: Decline in offspring quantity but not quality from successive matings in male rainforest <em>Drosophila</em>, with no evidence for genetic divergence in male mating behaviour along climatic and density gradients

description: Fertilisation success is a major component of male fitness, meaning males
 should capitalise on all opportunities for mating. However, other sources
 of variation in fitness mean that males often evolve life histories that
 limit their ability to mate frequently. We quantified mating latency,
 mating duration and offspring production in males of the tropical fly
 Drosophila birchii when presented with up to four females consecutively.
 Males were sourced from isofemale lines from the extremes of two
 elevational gradients (20 – 1100 m), that show substantial differences in
 population density, temperature and humidity. Total offspring sired
 increased with number of matings achieved, demonstrating substantial
 benefits of multiple mating. However, mean numbers of offspring declined
 with each successive mating, and mean mating durations increased, while
 mating latencies remained consistent. We saw no reduced fitness in male
 offspring from later matings, suggesting that declining offspring
 production is not associated with decreasing quality. Although differences
 between gradients were observed in total offspring production, reductions
 in offspring number were as great for males from high density sites as
 those from low density sites, despite expectations that males from high
 density sites would show higher mating investment. We also detected no
 divergence between high and low elevation sites for other traits,
 suggesting little adaptive divergence in mating strategies across this
 species’ entire elevational range. The steep decline in offspring
 production over successive matings may reflect low encounter rates, or
 mating opportunities with females in natural populations of this species,
 even in high density environments, reducing relative investment in sperm
 or ejaculates. This submission includes all male mating data collected for
 this study, along with R code used to run analyses and generate plots
 presented in the associated manuscript.
description: # Data and code for: Decline in offspring quantity but not quality from
 successive matings in male rainforest *Drosophila*, with no evidence for
 genetic divergence in male mating behaviour along elevational and density
 gradients Dataset DOI: [10.5061/dryad.sqv9s4ngw](10.5061/dryad.sqv9s4ngw)
 ## Description of the data and file structure This dataset contains the
 data and code required to replicate all analyses and generate plots
 included in Saxon et al. 2025 (DOI:
 [https://doi.org/10.1093/jeb/voaf110](https://doi.org/10.1093/jeb/voaf110)) "Decline in offspring quantity but not quality from successive matings in male rainforest *Drosophila,* with no evidence for genetic divergence in male mating behaviour along elevational and density gradients". In this paper, we present results of two experiments designed to test whether mating latency and duration, and offspring quantity and quality vary across successive matings by male *Drosophila birchii*. Further, we tested whether there is evidence for adaptation of male reproductive strategies between source populations with different densities. Provided are data on mating traits (latency, duration and number of offspring sired) for each mating of males from two elevation gradients (Mt Edith and Mt Lewis) that were mated up to four times. In addition, data are provided on the number of offspring sired by sons from these successive matings, as a measure of offspring quality.   ### Files and variables #### File: Edith_matings.csv **Description:** Results of experiment I for males sourced from the Mount Edith elevation gradient.  30 males from each of 10 isofemale lines was assayed (total of 300 males). Each male was presented with a virgin female until copulation occurred. Immediately following copulation, the male was moved to a fresh vial and presented with a new female. This process continued with up to four matings allowed for each male within a one-day period, with males given up to two hours to mate with each female. If copulation did not occur within this window, the male was not presented with any further females and the assay ended for that male.  The data file includes identifying information for each male and mating, and the mating traits recorded, as detailed in the variables list below. Where a male was not successful in obtaining a mating, the value for each mating trait is given as NA. ##### Variables * Line: Isofemale line from which male was derived * Altitude: Which end of the elevation gradient (high or low) the isofemale line originated * Male: Number identifying each male from within an isofemale line * Mating: A number between 1 - 4, indicating which of up to 4 successive matings by that male the data relate to * Latency: Time (in minutes) between being presented with a female and copulation beginning * Duration: Time (in minutes) between beginning and end of copulation * Offspring: Number of offspring produced by the mating * Cumulative_offspring: Number of offspring sired by the male across all matings up to and including the current one * Total_offspring: Total number of offspring sired by the male across all matings * Total_matings: Total number of matings achieved by the male #### File: Lewis_matings.csv **Description:** Results of experiment I for males sourced from the Mount Lewis elevation gradient.  10 - 20 males from each of 20 isofemale lines was assayed (total of 285 males).  Each male was presented with a virgin female until copulation occurred. Immediately following copulation, the male was moved to a fresh vial and presented with a new female. This process continued with up to four matings allowed for each male within a one-day period, with males given up to two hours to mate with each female. If copulation did not occur within this window, the male was not presented with any further females and the assay ended for that male.  The data file includes identifying information for each male and mating, and the mating traits recorded, as detailed in the variables list below. Where a male was not successful in obtaining a mating, the value for each mating trait is given as NA. ##### Variables * Line: Isofemale line from which male was derived * Altitude: Which end of the elevation gradient (high or low) the isofemale line originated * Male: Number identifying each male from within an isofemale line * Mating: A number between 1 - 4, indicating which of up to 4 successive matings by that male the data relate to * Latency: Time (in minutes) between being presented with a female and copulation beginning * Duration: Time (in minutes) between beginning and end of copulation * Offspring: Number of offspring produced by the mating * Cumulative_offspring: Number of offspring sired by the male across all matings up to and including the current one * Total_offspring: Total number of offspring sired by the male across all matings * Total_matings: Total number of matings achieved by the male #### File: Sons.csv **Description:** Results of experiment II. For seven of the ten Mount Edith isofemale lines, 10 virgin males (sons) were collected from each of the paternal matings (first to fourth) for males from each isofemale line (total of 280 males).  These were randomly selected from a combination of all offspring of focal males (sires) from that line that had achieved the maximum four matings in Experiment I. Six days post-emergence, each male was placed in a vial with a single virgin female. The pair were left for three days to mate . The male was removed, and each female was left to lay for a further five days. The female was then also removed and all offspring left to emerge.  The fitness of each son was assayed as the total number of offspring produced by this mating. ##### Variables * Line: Isofemale line from which male was derived * Mating:  The mating number (1 - 4) in experiment I from which the male was produced * Offspring: The total number of offspring sired by the male (in a single mating) #### ## Code/software **System requirements** Operating system: Tested on Windows 11 but should run on any operating system running the required software (detailed below). Memory: Standard desktop/laptop sufficient 
 
 **Software** **requirements** Code has been tested using R version:
 4.4.1, run in RStudio (2025.05.1 Build 513) Required R packages (tested
 versions): tidyverse (version 2.0.0) lme4 (version 1.1-36) lmerTest
 (version 3.1-3) splines (version 4.4.1) ggpubr (version 0.6.0) emmeans
 (version 1.10.7) 
 
 **Setup** Save all data files and code files (below) in the same
 directory and ensure this is set as the working directory in R. 
 
 **Code files** Scripts must be run in numerical order. #### 1_Mating
 trait models.R **Description:** Code to run models testing whether male
 mating traits (latency, duration, number of offspring) vary with mating
 number and source elevation in Experiment I.  This includes the code used
 to produce results presented in Table 1 and to make Figure 1 in the
 published paper. #### 2_Total matings models and plots.R
 **Description:** Code to run models testing whether total number of
 matings differs with source elevation in Experiment I. This includes the
 code used to produce results presented in Table 2 of the published paper.
 It also includes code for plotting the relationship of source elevation
 with number of matings, although these plots were not included in the
 published paper. #### 3_Total offspring models and plots.R
 **Description:** Code to run models testing for a relationship between
 number of matings and total offspring, and whether this varies with source
 elevation in Experiment I.  This includes the code used to produce results
 presented in Table 3 and to make Figure 2 in the published paper. ####
 4_Males with four matings.R **Description:** Code to run models testing
 whether number of offspring produced varied across matings among males
 that achieved the maximum four matings in Experiment I.  This includes the
 code used to produce results presented in Table SM1 and to make Figure SM1
 in the published paper. 
 
 #### 5_Fitness of sons across matings.R **Description:** Code to run
 models testing whether number of offspring sired by sons in Experiment II
 varies depending which mating they were produced by in Experiment I.  This
 includes the code used to produce results presented in the text of the
 results section and to make Figure 3 in the published paper. ## Access
 information Data were not derived from any other sources.