DOI: 10.5061/dryad.s4mw6m9gj
title: Data from: Optimal polyandry in fruit flies

description: The study of polyandry has received increasing scientific attention with
 an emphasis on the fitness benefits and costs that females derive from
 mating with multiple males. There are still gaps in our understanding of
 how polyandry affects female fitness, however, as many previous studies
 compared the fitness outcomes of a single mating vs. two or three matings
 and did not separate the consequences of multiple mating from the costs of
 sexual harassment. We therefore conducted controlled mating trials with
 female fruit flies (Drosophila melanogaster) that could mate at either low
 (every eight days), medium (every four days), or high (every other day)
 rates while controlling for exposure to harassment from males. We found
 that female lifetime fitness was highest under the high followed by the
 medium mating-rate conditions. Moreover, we did not detect reductions in
 lifespan as a consequence of higher rates of polyandry. Our results
 demonstrate that even at realistically high rates, polyandry can lead to
 net fitness benefits for females, which can have major implications for
 sexual selection. Specifically, we discuss the significance of our
 findings as they relate to competition and the evolution of secondary sex
 characteristics in females, and sperm competition amongst males.
description: # Data from: Optimal polyandry in fruit flies
 [https://doi.org/10.5061/dryad.s4mw6m9gj](https://doi.org/10.5061/dryad.s4mw6m9gj) ## Description of the data and file structure ### Raw data and code used to produce figures and analyses for the manuscript: Optimal polyandry in fruit flies All analyses for the main manuscript are in the "main_fitness_analyses.R" and analyses for the supplementary materials can be found in the "supplementary_analyses.R" file. The "treatment" column in all data files refers to whether data represents females in the low, medium, or high mating rate conditions.  ### Files and variables For all files, empty cells in the "notes" column means there were no notes of special interest for that data point.  #### File: glued\_pilot.csv **Description:** data for pilot experiment of glued vs. unglued males ##### Variables * day: day that we collected data (either 1 or 2) * id: ID of female fly * treatment: whether the female got glued or normal males * observer: name of the researcher scoring courtship for that specific trial * seconds_spent_courting: number of seconds the male fly spent courting the female fly * mating_latency: number of seconds elapsed before mating began; NA represents trials where mating did not occur * trial_duration: total duration of trial; default was 900 seconds unless mating occurred; if mating occurred, the trial ended at the start of mating * prop_courtship: proportion of trial duration where the male was courting the female #### File: offspring\_by\_batch.csv **Description:** fitness data divided by batch ##### Variables * replicate: replicate * female_age: female age in days; values represent a range because females were given multiple consecutive days to lay eggs. Excel keeps changing this to day format when I re-open the file so might have to be converted back to numbers. For example 4 - 5 gets changed to 05 - Apr. Tried to disable this from happening but was not able to...  * treatment: mating rate treatment (low, medium, or high rates of mating with multiple males) * vial: vial number which is how we kept track of female ID within treatment * total_offspring: total offspring produced in the vial by the female during the range of days she was in the vial * days: number of days female was in the vial * days_since_mating_opp: days since the females' most recent mating opportunity #### File: r2\_courtship\_trials.csv **Description:** courtship data for replicate 2 ##### Variables * date: date that courtship trial took place * female_age: female age * courtship_trial: courtship trial number  * treatment: mating rate treatment * fem_ID: female ID  * courtship_duration: amount of time, in seconds, that the female was courted by one of the males * courtship_latency: amount of time elapsed before first courtship * mating_latency_trial: trial duration (600 default or until mating occured) * mating_latency_courtship: time between courtship and mating latency * prop_courtship: proportion of trial where the female was courted by at least one male * notes: additional notes #### File: r1\_courtship.csv **Description:** courtship data for replicate 1 ##### Variables * date: date * trial_num: trial number * trial_date: trial date * matings: whether all three treatments were to be mated or just some * female_age: female age in days * treatment: female treatment * vial: vial number (female ID) * trial_start: trial start time * mating_start: mating start time; NA indicates trials where mating could not possibly have happened (ie. the female was assigned to only receive harassment from glued males that day). Blank cells indicate trials where mating could have happened but did not.  * mating_end: mating end time; NA indicates trials where mating could not possibly have happened (ie. the female was assigned to only receive harassment from glued males that day). Blank cells indicate trials where mating could have happened but did not.  * male_type: whether the vial included glued or unglued males * mating_latency: time until mating commenced; blank cells mean there was no mating latency data for the trial, either because flies never got the opportunity to mate or because they were given the chance to mate but did not.  * trial_duration: duration of trial * courtship_bouts: number of courtship bouts per vial * mated?: whether or not a mating occurred * notes: notes  #### File: total\_offspring\_per\_fly.csv **Description:**  ##### Variables * replicate: replicate * treatment: mating rate treatment  * vial: vial number * total_offspring: total lifetime offspring produced by the female fly (female ID = vial number + treatment) * longevity: days lived * status: denoted whether female was dead (2) or alive (1) at the time of analyses * matings: number of times female was mated with throughout her lifetime * mating_rate: number of matings per day over the 32-day mating trial window * days_not_mated: days out of the 32-day mating window that female did not mate (if the female was dead, those days were not included) #### File: offspring\_over\_time.csv **Description:**  ##### Variables * replicate: replicate  * batch: denotes which female vial the offspring came from; for example batch 1 = vials from when females were 4-5 days old * female_age: female age in days * treatment: female treatment * vial: vial number aka female ID * total_offspring: total offspring produced per vial * days: days female lived in the vial * days_since_mating_opp: days since most recent mating opportunity ## Code/software All of the analyses were conducted using R. The packages used and what each package was used for can be found at the beginning of each R script.  ## Access information Other publicly accessible locations of the data: * [https://github.com/janyan33/fly_polyandry](https://github.com/janyan33/fly_polyandry)