Original research article

The authors used this protocol in:
Nov 2017

Navigate this Article


Testing for Assortative Mating by Diet in Drosophila melanogaster    

How to cite Favorites Q&A Share your feedback Cited by


Experimental studies of the evolution of reproductive isolation in real time are a powerful way to reveal the way that fundamental processes, such as mate choice, initiate divergence. Mate choice, while frequently described in females, can occur in either sex, and can be affected by the genetics or environment of an individual. Here we describe simple protocols for assessing mating outcomes in fruit flies, which in this context can be used to assess reproductive isolation derived from rearing on different diets over multiple generations.

Keywords: Ecological adaptation, Diet, Assortative mating, Reproductive isolation, Drosophila, Mate choice, Behavioural ecology


Drosophila melanogaster is an important model for studying sexual selection, of which mate choice is a central component. Mate choice can be effected by many different variables such as direct and indirect genetic effects, environment and nutrition. This protocol was implemented in the previously published study (Leftwich et al., 2017). In that study, this assay was combined with microbiome characterization and manipulation to assess the impact of splitting a single population into two isolated groups reared on different diets over multiple generations.

Materials and Reagents

  1. Flystuff Drosophila tube polypropylene (Scientific Laboratory Supplies, Flystuff, catalog number: FLY1318 )
  2. Flystuff Cotton balls (Scientific Laboratory Supplies, Flystuff, catalog number: large for bottles FLY1200 and small for vials FLY1028 )
  3. Fly morgue (Plastic Funnel and Plastic Beaker)
  4. Thin paintbrush
  5. Dissecting needle (Watkins & Doncaster, catalog number: D416 )
  6. Pooter (homemade) (3 ml graduated Pasteur pipette, 6 mm rubber tubing, muslin)
    The plastic pipette is connected to the rubber tubing with muslin acting as a physical barrier between pipette and tube. Individual flies may be collected into the pipette by inhaling gently through the rubber tubing. 
  7. Polystyrene Petri dishes, 90 mm (Fisher Scientific, FisherbrandTM, catalog number: 12654785 )
  8. Filter paper, 90 mm, QL 100 (Fisher Scientific, FisherbrandTM, catalog number: 11566873 )
  9. Parafilm
  10. Drosophila melanogaster – stock lines Oregon-R and Dahomey (Bloomington Stock Center)
  11. Carbon Dioxide, Industrial Grade, BOC, 40-VK
  12. Fly food ingredients (store in a cool, dry place to maximize shelf life, do not keep for more than 12 months)
  13. Active Dried Yeast, 500 g (BakeryBits, catalog number: BB-1606 )
  14. Molasses 
  15. Agar (ForMedium, catalog number: AGA01 )
  16. Cornmeal/Maize Flour
  17. Sugar
  18. Starch (Fisher Scientific, FisherbrandTM, catalog number: S/7960/60 )
  19. Inactivated Brewer's Yeast
  20. Propionic Acid (Sigma-Aldrich, catalog number: 402907 )
  21. Nipagin M (Sigma-Aldrich, catalog number: H3547 )
  22. Ethanol absolute (Thermo Fisher Scientific, catalog number: E/0600DF/C17 )
  23. Red Grape Juice (BTP Drewitt Ltd.)
  24. Sugar yeast agar (SYA) medium (see Recipes)
  25. Cornmeal molasses yeast (CMY) medium (see Recipes)
  26. Starch medium (see Recipes)
  27. Grape juice plates (Purps) (see Recipes)


  1. Flystuff Drosophila Glass Stock Bottle (Scientific Laboratory Supplies, Flystuff, catalog number: FLY1086 )
  2. Sharp scalpel
  3. Flystuff Benchtop Flow Buddy System with Fly Pad and Gun (Scientific Laboratory Supplies, Flystuff, catalog number: FLY1010 )
  4. Stereomicroscope (Leica Microsystems, model: Leica MZ75 )
  5. Watson Marlow Food Dispenser (Watson-Marlow Fluid Technology Group, catalog number: 520Di )
  6. Embryo collection cage Large (Scientific Laboratory Supplies, Flystuff, catalog number: FLY1214 )


  1. R v3.3.2 (R Core Team, 2017)
  2. JMating v1.0 (Carvajal-Rodriguez and Rolan-Alvarez, 2006)


  1. Graphical overview of experimental design (Figure 1)

    Figure 1. Visual abstract of methodology. All flies are maintained as a laboratory population of overlapping generations on SYA media. This population is split in two by grouping flies onto either CMY or Starch diets and maintain these sexually isolated populations with discrete generations. At regular intervals, assortative mating tests are carried out in order to determine the level of reproductive isolation between these populations.

  2. Generation and maintenance of fly stocks on CMY and Starch diets
    1. All experiments and culturing take place in a controlled environment room set to 25 °C, 50% relative humidity on a 12-h:12-h day:night cycle. 
    2. Maintain flies on a standard sugar-yeast-agar medium (SYA, see Recipes) in large population cages.
    3. Split the flies from this starter population into two isolated populations, one reared on CMY media (see Recipes) and the other one reared on starch media (see Recipes) (Figure 1).
    4. Maintain each independent line as a population of 200 females and 200 males in a 200 ml glass bottle, bunged with cotton wool and containing 70 ml of the appropriate diet. 
    5. With each discrete generation, anesthetize a bottle of flies with CO2 and place the flies onto a CO2 pad. 
    6. Using a dissection microscope identify 200 males and 200 females, and transfer them to a fresh vial using a soft paintbrush, excess flies should be discarded by sweeping them into a fly morgue.
    7. Males and females can be identified by a variety of external morphologies. Females have a pointed abdomen, with narrow dark bands on each abdominal segment. Males have a rounded abdomen, with the rearmost segments almost uniformly dark, in addition, complex structures of the genitalia are visible (Figure 2). Males have the additional feature of a short row of bristles known as the sex combs on the fourth segment of the front legs (not shown) (Demerec, 1965).

      Figure 2. Adult morphology of Drosophila melanogaster. Clockwise from top left: Non-wing clipped adult female, Wing clipped adult female, Wing clipped adult male, Non-wing clipped adult female.

    8. Adults are allowed to mate, feed and lay eggs for 48-72 h before being removed, firmly tap the base of the bottle to temporarily stun the adult flies, remove the plug and upturn the bottle over the fly morgue. Again firmly tap the base of the bottle, and the adults will fall into the morgue, repeat this until all adult flies have been removed. Insert the plug back into the bottle and wait for the emergence of new adults (return to Step B5). This allows discrete generations to be recorded. 

  3. Standardized rearing one generation before mating tests
    1. In order to remove any maternal effects or direct influence of nutrition on behavior, flies are put through a single generation of rearing on the same diet and standardized larval densities (Figure 1).
      Note: Isolated populations are maintained separately, and all bottles and vials are clearly labeled with the population origin, dietary treatment and generation number. 
    2. Anesthetize adults from each bottle with CO2, and transfer females to an egg-laying chamber with a Grape Juice Plate (Purp) and activated yeast paste.
    3. Leave the females in the egg-laying chamber for 1 h, after which time re-anesthetize the adults and return them to their original bottles.
    4. Seal the Petri dish containing freshly laid eggs with parafilm and leave for 24 h.
    5. After 24 h, place purp plates under a dissecting microscope, pick 1st instar larvae with a dissecting needle and transfer to glass vials with 8 ml of CMY media.
    6. Maintain the vials at a fixed larval density of 100 larvae per vial (Horváth and Kalinka, 2016).
    7. Monitor the vials daily until larvae emerge and start to pupate on the inner surface of the glass vial above the food media.
    8. Adult eclosion from pupae cases is expected to occur within 3-4 days under the conditions detailed above, at which point virgin males and females can be collected. 

  4. Collection of virgin male and females
    1. In order to collect males and females for crosses, it is important to collect virgin adults (ca. < 6 h post adult eclosion).
    2. In order to ensure virgin adult collection, vials can be cleared of adults first thing in the morning by firmly tapping the base of each vial and upending over a fly morgue (see Step B5), and only those adults which emerge within the 6 h window that follows are used for mating crosses. 
    3. Young, virgin adults are distinctive from older adults as they are very pale with a distinctive dark spot visible beneath the cuticle of the abdomen (the meconium). Adults matching this description may be reliably collected as virgins even in a collection that has not been sorted within the 6 h window (Figure 3).

      Figure 3. Meconium on Virgin Adult Flies. In the early hours after eclosion, there will be visible a dark greenish spot (the meconium, the remains of their last meal before pupating) on the underside of the abdomen of adult flies. Flies that still present with this may be reliably collected as virgins.

    4. Anesthetize vials of emerging adults under CO2 and sort on a CO2 pad under a dissecting microscope into males and females (see Steps B5-B7). 
    5. Put males and females into single-sex vials with 10 adults per vial (8 ml of CMY food per vial).
    6. Mating tests should take place 5-7 days post-eclosion, 24 h prior to this half of the flies will be wing-clipped so that flies may be identified as to background when mixed together in mating crosses (see Figures 1 and 2).
    7. Anesthetize all flies with CO2 (in order to standardize treatment), with half of the flies having the tips of their wings clipped off with a sharp scalpel. Wing clipping has been demonstrated not to affect behavior or mating in multiple studies, but the clipping should be undertaken in a balanced design nonetheless so that half of the CMY population are clipped and half of the Starch population are clipped with equal numbers of males and females. 
    8. After clipping or sham treatment, return all flies to their vials. 

  5. Testing for assortative mating
    1. Mating tests should aim to start within 30 min of ‘lights-on’ according to the day/night cycle to which the flies are acclimated.
    2. Mating tests for reproductive isolation are established in a quartet design with one male and female from the CMY treatment and one male and female from the Starch treatment. One male and one female should be wing-clipped with their identities known (Figure 1). 
    3. Each mating chamber is an empty glass vial save for a strip of filter paper soaked in RO water to provide moisture, and sealed with a cotton wool bung. 
    4. Introduce one male from each treatment into the mating chamber with a pooter, followed by one female from each treatment. 
    5. Monitor the chambers continuously until the first pair of flies copulate, and record the identity of the flies. Remove any mating chambers which do not produce a mated pair within 2 h from the study. 
    6. Any vials containing individuals that died, were immobile, or mated for a period of < 5 min during the course of the experiment should be discarded. 

Data analysis

  1. The total number of flies in each mating pair type should be recorded (Table 1), and can be plotted as a frequency bar chart.

    Table 1. Data for mating pairs of Dahomey flies reared on Starch and CMY diets for 5, 30 and 35 generations

  2. The statistical significance of the frequency of different mating pairs across multiple generations and/or replicate experiments can be calculated with a “mantelhaen.test” function in R (as used in Leftwich et al. [2017]).
  3. Alternatively, the number of observed and total possible (the number of vials where a mating pair was observed + the number of vials where no matings were observed) pairings for each pair type can be calculated for each experimental replicate. This can be calculated using JMating v1.0 to calculate the Index of Pair Isolation (IPSI). IPSI varies from -1 to +1 with +1 denoting total assortative mating and -1 total disassortative mating. A value of 0 would be random mating. The statistical significance of this coefficient can also be calculated in JMating using bootstrapping of 10,000 iterations of resampling.


Dispensing: All media can be dispensed into 200 ml Glass bottles, Drosophila vials or Petri dishes as required using a food pump dispenser.

  1. Sugar yeast agar (SYA) medium
    Added together for 1 L of media
    30 g (3%)
    50 g (5%)
    Brewer's yeast
    100 g (10%)
    1 L ddH2O
    Cook the medium for 10-15 min until it begins to boil
    Allow medium to cool to below 60 °C before adding the preservatives
    Propionic acid
    3 ml (0.3%)
    Nipagin M (10% in Ethanol)
    30 ml (3%)
  2. Cornmeal molasses yeast (CMY) medium
    Added together for 1 L of media
    10 g (1%)
    Cornmeal (maize)
    76 g (7.6%)
    76 g (7.6%)
    Brewer's yeast
    50 g (5%)
    1 L ddH2O
    Cook the medium for 10-15 min until it begins to boil
    Allow medium to cool to below 60 °C before adding the preservatives
    Propionic acid
    2 ml (0.2%)
    Nipagin M (10% in Ethanol)
    4 ml (0.4%)
  3. Starch medium
    Added together for 1 L of media
    10 g (1%)
    30 g (3%)
    Brewer's yeast
    50 g (5%)
    1 L ddH2O
    Cook the medium for 10-15 min until it begins to boil
    Allow medium to cool to below 60 °C before adding the preservatives
    Propionic acid
    5 ml (0.5%)
  4. Grape juice plates
    12.5 g
    Red Grape Juice
    150 g
    275 ml ddH2O
    Cook the medium for 10-15 min until it begins to boil
    Allow medium to cool to below 60 °C before adding the preservatives
    Nipagin M (10% in Ethanol)
    10.5 ml


We would like to thank Leonela Z Carabajal Paladino and Wayne Rostant for providing the images for Figures 1 and 2 respectively. This is a version of the protocol described in Leftwich et al. (2017) which was funded by the Biotechnology and Biological Sciences Research Council Research Grant BB/K000489/1 (to Tracey Chapman, Philip Leftwich and Matt Hutchings).

Competing interests

The authors declare no competing interests or conflicts of interest.


  1. Carvajal-Rodriguez, A. and Rolan-Alvarez, E. (2006). JMATING: a software for the analysis of sexual selection and sexual isolation effects from mating frequency data. BMC Evol Biol 6: 40.
  2. Demerec, M. (1965). Biology of Drosophila. CSHL Press.
  3. Horváth, B. and Kalinka, A. T. (2016). Effects of larval crowding on quantitative variation for development time and viability in Drosophila melanogaster. Ecol Evol 6(23): 8460-8473.
  4. Leftwich, P. T., Clarke, N. V. E., Hutchings, M. I. and Chapman, T. (2017). Gut microbiomes and reproductive isolation in Drosophila. Proc Natl Acad Sci U S A 114(48): 12767-12772.
  5. R Core Team. (2017). R: a language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria.
Please login or register for free to view full text
Copyright: © 2018 The Authors; exclusive licensee Bio-protocol LLC.
How to cite: Leftwich, P. T. and Chapman, T. (2018). Testing for Assortative Mating by Diet in Drosophila melanogaster. Bio-protocol 8(20): e3057. DOI: 10.21769/BioProtoc.3057.

If you have any questions/comments about this protocol, you are highly recommended to post here. We will invite the authors of this protocol as well as some of its users to address your questions/comments. To make it easier for them to help you, you are encouraged to post your data including images for the troubleshooting.

If you have any questions/comments about this protocol, you are highly recommended to post here. We will invite the authors of this protocol as well as some of its users to address your questions/comments. To make it easier for them to help you, you are encouraged to post your data including images for the troubleshooting.

We use cookies on this site to enhance your user experience. By using our website, you are agreeing to allow the storage of cookies on your computer.