# Interactions between the developmental and adult social environments mediate group dynamics and offspring traits in Drosophila melanogaster

## Abstract

Developmental conditions can strongly influence adult phenotypes and social interactions, which in turn affect key evolutionary processes such as sexual selection and sexual conflict. While the implications of social interactions in phenotypically mixed populations at the individual level are increasingly well known, how these effects influence the fate of groups remains poorly understood, which limits our understanding of the broader ecological implications. To address this problem we manipulated adult phenotypes and social composition in Drosophila melanogaster – by experimentally manipulating the larval density of the group-members – and measured a range of group-level outcomes across the lifespan of groups. Adult groups composed of exclusively low larval-density individuals showed high courtship levels, and low early reproductive rates, group growth rates, offspring mass and offspring eclosion success, relative to high larval-density or mixed larval-density groups. Furthermore, high larval-density groups had lower survival. Offspring mass increased with time, but at a reduced rate in groups when male group members (but not females) were from a mixture of larval-densities; peak reproductive rates were also earlier in these groups. Our results suggest that that variation in developmental conditions experienced by adult group members can modify the reproductive output of groups.

## Introduction

In natural populations, varying availability of resources in the environment generate variation in phenotypes between individuals, who then interact in social groups1, 2. The pool of resources acquired by organisms is often referred to as the organism’s condition3, and all traits are expected to depend on the allocation of resources4, 5. Resource allocation modulates the expression of male and female sexually-selected traits that in turn influence key evolutionary processes such as sexual conflict and sexual selection3, 6,7,8,9,10,11. These processes can potentially influence speciation and extinction rates and thus shape biodiversity12,13,14,15,16,17.

Resource acquisition and competition experienced during the developmental stage are known to modulate the social interactions of individuals with their potential mates and rivals in adulthood, both in laboratory and field populations6, 11, 18,19,20. In insects, the developmental environment influences adult body size21,22,23,24, which tends to positively correlate with female fecundity (i.e. large females produce more eggs than small females) and male competiveness25. Large individuals tend to have large reproductive organs, high courtship activity (in males), high mating frequency, and high reproductive output compared to small individuals6, 7, 21,22,23, 26,27,28,29,30,31. Thus, adult body size is expected to be under fecundity selection in females and sexual selection in males7, 25, 30, 32,33,34.

Most studies on the developmental environment have focused on the plastic responses of focal individuals (e.g. refs 6 and 35), and only recently have studies in Drosophila melanogaster begun to investigate the dynamics within mixed-phenotype social groups7, 11, 36. In D. melanogaster, high larval density, a key ecological factor (e.g. refs 18, 23 and 24), generally results in smaller body-size adults: males that are less competitive with rivals, and females that produce fewer offspring6, 7, 21, 22. However, the magnitude of these larval density effects on adult reproduction can be mitigated in mixed-phenotype social groups7, 36. Males direct their courtship efforts preferentially to large females in mixed female size environments, which in turn reduces the fecundity advantages of large over small females36. Moreover, variation in female body size can affect male siring success whereby large males sire a higher proportion of offspring than small males when females are large, but this effect is lost when females vary in body size7.

Despite these observations, it is not straightforward to infer the broad ecological impacts of the interactions amongst phenotypically distinct individuals at the group-level, because the consequences of social interactions within groups are not fully understood (e.g. ref. 37). Key questions remain unanswered: for example, we do not know whether interactions between ecological factors (e.g. larval density, nutrition) and social environments influence the survival and reproductive output of groups and populations. Neither do we understand whether any potential effects are transferred onto subsequent generations, which could further influence group productivity and persistence. This is unfortunate because ecological and social conditions are known to influence important physiological and behavioural processes, including modulation of pathogen transmission and immune responses (e.g. refs 38,39,40,41), mating behaviour and reproductive output (e.g. refs 42 and 43), and offspring quality (e.g. refs 44,45,46). Consequently, the interaction between developmental environments and adult social environments could shape the dynamics between individuals within groups or populations, and influence the likelihood of populations persisting, expanding, or going extinct. Hence, understanding how ecological and social factors interact to modulate group and population fitness not only advances our knowledge of key evolutionary processes, but also has implications for applied biology. For example, factors influencing group productivity and survival are key to species management programs such as for the conservation of endangered populations, and important for the control of agricultural pest species and disease vectors47, 48.

Here, we investigate how environmental and social factors influence group-level traits. We first manipulated the ecological environment during development of the fruit fly D. melanogaster by changing the larval density, which resulted in differences in the body size in both sexes. We then experimentally combined adults from different larval density developmental environments (i.e. flies of different adult body size), to create adult social environments that varied in the composition of male or female, or both sexes, phenotypes. We measured courtship behaviour levels, reproductive output and survival of these groups, as well as effects on offspring eclosion success and offspring body size. Our study allowed us to gain insight into how ecological and social environments at the larval and adult stages, respectively, interact and how this interaction translates into group-level responses. To our knowledge, this is the first study to explore effects of developmental and social environments at the group-level.

## Predictions

Our predictions were:

1. 1.

If males adopt fixed strategies based on their own developmental environment, groups with large males (from low density larval environments) will tend to have higher courtship levels because large males are more sexually active than small males;

2. 2.

If females adopt fixed reproductive strategies based on their own developmental environment, groups with large females (from low density larval environments) will tend to have higher offspring production because female body size is positively correlated with female productivity. Moreover, large females should have more resources to expend on provisioning eggs, which might benefit offspring.

3. 3.

However, if male and female reproductive traits respond to changes in the phenotype of their social rivals and mates over and above the strategies set by their own developmental environment, then we will expect to see deviations from the patterns predicted above.

## Material and Methods

### Fly stocks and culture

We used wild-type inbred OregonR stock of D. melanogaster from Bloomington Drosophila Stock Centre and kindly provided to us by Greg Neely’s Lab at the University of Sydney. The stock was maintained in populations (>5,000 individuals) in cages with overlapping generations for >10 generations. All fly stocks were maintained and all experiments conducted, at 25 °C on a 14:10 light:dark cycle in a controlled humidified room (humidity = 68%) and fed with standard sugar-yeast-maize-molasses medium with excess live yeast granules (see Supplementary Information for recipe).

### Larval density manipulation and adult body size

Following the protocol of Clancy and Kennington49, we collected eggs from population cages and manipulated larval density of flies in the following way: for the high larval density treatment (small body size adults) we placed ~50 larvae/mL of food (~200 larvae per 34 ml vial containing ~4 mL fly food); for the low larval density treatment (large body size) we placed ~4 larvae/mL of food (~40 larvae in per 34 ml vial containing ~10 mL fly food). A similar approach has been extensively used to create significant differences in the average body size of males and females6, 7, 21. We used these categorical variations in body size to manipulate our group social composition (see Fig. 1). Virgin flies of both sexes were collected within 8 hours of eclosion and kept in vials of same-sex and same-larval manipulation groups of 15–20 individuals for 2–5 days prior to experiments. We used >50 vials per treatment to rear flies. Flies form these vials were pooled within each larval density treatment, before being randomly allocated to each adult group treatment. This methodology reduced the likelihood of placing individuals that had been reared in the same vials in the same treatments.

### Experimental design

We created groups with ‘Equal’ (E) or ‘Unequal’ (U) phenotypes of male (M), female (F), or both (Fig. 1). The design was based on Morimoto et al.7. Briefly, replicate groups containing 4 flies of each sex were placed in vials (i.e. 1 group of 8 flies per vial), and flies were allowed to interact continuously throughout their lifespan. Groups were transferred to fresh vials with standard maize-molasses food and yeast ad libitum in discrete time intervals (i.e. days 3, 6, 9, 13, 16, 19, 23, 27, 35, 40, 45 and 50) throughout their lifespan. We assembled 17 replicate groups per treatment, in five treatments (see Fig. 1):

1. 1.

Groups with equal-sized males and equal-sized females in which males and females experienced high larval density (small adult body size) (EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{high}})}$$);

2. 2.

Groups with equal-sized males and equal-sized females, in which males and females experienced low larval density (large adult body size) (EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$);

3. 3.

Groups with phenotypically equal-sized males but unequal-sized females, in which all 4 males experienced low larval density, 2 females experienced high and 2 females experienced low larval density (EM/UF);

4. 4.

Groups with phenotypically unequal-sized males but equal-sized females, in which 2 males experienced high larval density and 2 males experienced low larval density, all 4 females experienced low larval density (UM/EF);

5. 5.

Groups with phenotypically unequal-sized males and unequal-sized females (UM/UF).

### Courtship

Courtship levels in groups were assessed based on the sum of the number of male courtship behaviours towards females (e.g. chasing, wing-extension, attempting copulation50) that were observed every 15 min for 1 h. These observations were taken on the mornings of days before groups were transferred to fresh vials (see above). This allowed us to estimate the courtship levels of the group over time. After the behavioural observations of courtship, we transferred the groups to vials with fresh standard maize-molasses food and yeast ad libitum until the next vial replacement.

### Survival

We scored deaths and calculated the number of males and females alive in each group at each time interval used for the behavioural and reproductive measurements. Group survival was defined as the survival of the 4 adult females in the group, in which case males, if still alive, were discarded.

### Offspring number

After fly removal, we stored all interaction vials for 13–15 days, until all the adult offspring had emerged. We scored the number of eclosing offspring produced in each vial and calculated the rate of offspring production and total offspring production of each group. We also scored the number of non-emerging pupae to measure eclosion failure. We scored courtship and offspring for the first 35 days, by which time females had stopped producing any viable eggs (i.e. no more offspring). From this point on we only scored survival.

### Offspring mass

We randomly sampled ~25 female and ~25 male offspring per group per day (N total  = 1,458) and measured their wet body mass on a fine scale Sartorius® with precision of 0.001 g.

### Data analysis

#### Larval density effects on body size

We used one-way ANOVA after checking for the normality of the data to evaluate the effects of larval density on male and female body sizes.

### Courtship

To analyse courtship we used a Generalized Linear Model (GLM) with a Poisson distribution and accounted for overdispersion of the data using a quasi extension. The model included the linear and quadratic effects of time, treatment and their interactions. As individuals died, they were not replaced and thus the number of individuals contributing to group fitness and survival declined. To control for this, we included covariates in the models to account for the number of females and males in the group at the time of the courtship activity measurements. We also included vial to control for pseudoreplication. p-values are given from F-tests. We used Student-Newman-Keuls (‘SNK’) post-hoc test to determine differences in mean courtship levels between groups.

### Survival

We tested for differences in survival of the group by fitting a Cox proportional hazards model using the ‘coxph’ function of the ‘survival’ package in R51; p-values are given from the χ2 test.

### Offspring production

To analyse offspring production, we fitted a general linear model with a normal error distribution on the full dataset that included – in addition to the variables described above – the interactions between the linear and quadratic effect of time and treatment (i.e. Time*Group and Time2*Group). This allowed us to compare how the slope and the peak reproductive success of groups differ depending on the phenotype composition of males and females in the group. For the group total offspring production, we used SNK post-hoc test to check for differences between treatments. We checked for the normality and the homogeneity of variances (df = 4, Bartlett’s K-squared = 2.695, p = 0.610) of the data for the general linear model.

### Group fitness

We estimated group growth rates by calculating r, an index obtained from the age-specific offspring production and survival, and which its estimates better represent fitness than lifetime offspring production in D. melanogaster (see refs 33, 52 and 53) (see Supplementary Information for details). Higher r estimates represent higher fitness and vice-versa33, 52, 53. We calculated r from each group (see Supplementary Information), and tested differences between treatments with a non-parametric Kruskal-Wallis Rank Sum Test (with p-values reported form a $${\chi }^{2}$$ test) followed by a Student-Newman-Keuls (SNK) post-hoc test to assign differences in means.

The timing of reproduction has a large impact on population growth rates. We therefore investigated whether social and developmental environments interact to alter age-specific group reproductive rates. To do this, we fitted general linear models for each treatment individually, which included linear and quadratic effects of time while controlling for the number of females and males in the group as described above. When the quadratic effect of time was statistically significant, we calculated the peak reproductive success of the group with the derivative of the quadratic model as follows:

$$F(x)=\alpha {x}^{2}+\beta x+\gamma$$
(1)

where α and β are the quadratic and linear coefficients of the linear model, respectively, after controlling for confounding covariates and x is our time intervals. We then took a derivative of eq. (1)

$$\frac{\partial F(x)}{\partial x}=2\alpha x+\beta$$
(2)

where $$\frac{\partial F(x)}{\partial x}$$ is the first derivative of eq. (1) in time. If α < 0, then solving eq. (2) for $$\frac{\partial F(x)}{\partial x}=0$$ defines the point in which eq. (1) is maximised – i.e. it defines the day when the rate of offspring production peaked.

We also investigated whether the variance in group total reproductive success was affected by our treatments using the ‘leveneTest’ function of the ‘car’ package in R54, 55, which allowed us to test for homogeneity of variance between our treatments. We calculated Pearson’s correlation to investigate whether overall harassment levels correlated with overall reproductive success.

### Pupal eclosion

To analyse the proportion of non-emergent pupae, we used a generalized linear model with a Binomial distribution corrected for overdispersion with the quasi extension, with treatment as the main factor while controlling for the total number of pupae in the group (i.e. adult offspring (emergent pupae) + non-emergent pupae). Courtship level was also included as a covariate in the model to investigate whether courtship levels affected eclosion failure; p-values are given from F-tests. We used the SNK post-hoc test to test for differences in the mean non-emergent pupae between our treatments.

### Offspring body mass

To test for effects on offspring body mass we used a general linear model with a normal distribution of errors. The independent variables in the model were treatment, sex of the offspring and their interaction, vial, courtship, the density of offspring per vial and the linear and quadratic effects of time and their interaction with treatment. We Boxcox transformed offspring mass (i.e. mass^0.5) to fit the normality assumption. We used the SNK post-hoc test to test for differences in mean offspring body mass between our treatments.

All independent variables in our models were established a priori and thus no model simplification was applied. Figures are of non-transformed (raw) data plotted with the package ‘ggplot2’56. Thick lines in figures were created with function “loess”, available within the ‘ggplot2’ package56 (see Supplementary Information for details). All analyses were performed in R version 3. 2. 254.

## Results

### Larval development manipulation and body size

Males and females from high and low larval density treatments had significantly different body sizes (Male: F1,68 = 18.336, p < 0.001; Female: F1,74 = 14.725, p < 0.001) whereby individuals from high larval density had smaller body size than individuals from low larval density treatments (Fig. S1) [Sex: Treatment: Mean ± SE; Male: Low larval density: 0.658 ± 0.010, High larval density: 0.588 ± 0.012; Female: Low larval density: 0.792 ± 0.013, High larval density: 0.719 ± 0.013]. The variance in body size was not affected by our larval manipulation in either males (Fvar36,33 = 0.806, p = 0.526) or females (Fvar36,39 = 1.006, p = 0.979).

### Group survival

Treatment had a significant effect on survival (Treatment: χ2 4 = 20.660, p < 0.001). Groups in which both males and females experienced high larval density (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{high}})}$$) had significantly lower survival than groups in which both males and females experienced low larval density (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$), suggesting that high larval density can shorten group lifespan. There was no difference in survival between UM/EF, EM/UF and UM/UF treatments relative to EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$ (Fig. 2a).

### Courtship levels

Groups in which both males and females experienced low larval density (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$) had significantly higher courtship behaviour counts than all other groups which did not significantly differ from one another (F4,527 = 4.962, p < 0.001, Fig. 2b). There was no evidence for a linear nor a quadratic effect of time (Time: F1,531 = 1.468, p = 0.226, Time2: F1,526 = 0.871, p = 0.351, Table S1).

### Pupae eclosion

Treatment had a significant effect on the proportion of non-emergent pupae (F4,489 = 8.395, p < 0.001; see Table S2). Groups in which both males and females experienced low larval density (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$) had significantly more non-emergent pupae than treatments EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{high}})}$$, UM/EF, UM/UF, and a non-significant trend in the same direction for EM/UF (Fig. 2c). This effect was above and beyond the effects of offspring density in each vial, since the contribution of offspring density within vials was accounted for in the statistical model (F1, 492 = 31.624, p < 0.001). In addition, these effects were independent of courtship levels because there was no significant correlation between courtship levels and pupae eclosion (F1, 486 = 0.715, p = 0.398, Table S2).

### Total offspring production

Treatment had a significant effect on total offspring production (F4,75 = 4.017, p = 0.005, Table S3). A post-hoc analysis revealed that groups in which males and females experienced high larval density (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{high}})}$$) produced significantly fewer offspring than UM/EF groups, and all other groups were intermediate and not significantly different from one another (Fig. 3a).

### Group fitness, r

We calculated r, an age-specific offspring production index often used as a proxy for group fitness (see e.g. refs 33, 53 and 57). Treatment had a significant effect on estimates of r (Treatment: $${\chi }_{4}^{2}$$ = 23.191, p < 0.001) whereby groups composed of males and females from low larval density developmental environment (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$) had significantly lower fitness estimates (i.e. lower estimates of r [see Methods]) than other treatments (Fig. 3b).

### Offspring production rate

Time had a significant negative linear and quadratic effect on the rate of offspring production of the groups (Time: F1, 607 = 714.652, p < 0.001; Time2: F1, 607 = 11.354, p < 0.001, Fig. 3c, Table S3), which was expected since females reduce (and eventually stop) producing eggs through time. There was no significant interaction between linear Time and Group (F4, 607 = 1.238, p = 0.293). However, we found a significant quadratic interaction, Time2*Group, on offspring production (F4,607 = 4.540, p = 0.001, Fig. 3c), suggesting that the peak reproductive success differed between groups. Relative comparison between treatments revealed that this effect was mainly driven by groups where males and females were small (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{high}})}$$), in which the estimates of the concavity of the curve did not reach statistical significance (Time2: t-value = 0.462, p = 0.645). This pattern suggests that EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{high}})}$$ reached maximum reproductive success between days 0–3, after which reproduction declined linearly (Fig. 3c). The number of males and females in the group at the time of the measurement was significantly positively correlated with the rate of offspring production (see also Table S3 and Fig. S3 for cumulative offspring production).

We then used eqs (1) and (2) to calculate the peak of the rate of offspring production in our groups. For groups with males from low larval density environments (EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$ and EM/UF) the estimates of peak reproductive success laid in between days 6–9 of group survival, whereas groups with mixed male phenotypes (i.e. UM/EF and UM/UF) reached peak reproductive success at around days 9–13. For groups with males and females from high larval density developmental environments (EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{high}})}$$) the peak reproductive success was the earliest among our treatments (0–3 days) (Fig. 3c, see Table S4).

### Offspring body mass

Group had a significant effect on offspring weight (F4,329 = 7.042, p < 0.001). Post-hoc analysis revealed that this effect is caused by a reduction in offspring weight in groups composed of all large male and female individuals (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$) compared to all other treatments (Fig. 4, Table S5). There was a linear and a quadratic effect of Time (Time: F1,329 = 162.326, p < 0.001; Time2: F1,329 = 157.184, p < 0.001) suggesting that offspring body mass increased after the first day of egg-laying and plateaued after ~9–13 days after the beginning of the experiment. There was a significant interaction of Group*Time and Time2 (Group*Time: F1,329 = 6.979, p < 0.001; Group*Time 2 : F1,329 = 3.332, p = 0.010), which showed that the increase in offspring body mass differed between groups (Fig. S4; Table S5). Comparison of the slopes of offspring body mass on time revealed that the slope of UM/UF and the UM/EF groups increased at a slower rate than EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$, although this effect was not found for EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{high}})}$$ and EM/UF groups. These data indicate that in groups with mixed male phenotypes the body mass of offspring increases a slower rate over time. Courtship levels were not correlated with offspring body mass (F1,329 = 1.389, p = 0.239), suggesting that the reduction in offspring body mass was not driven by group courtship levels. The interaction Sex*Treatment was not significant (Sex*Treatment: F4,329 = 1.395, p = 0.235).

## Discussion

The data presented here show that phenotypically homogeneous groups where individuals of both sexes experienced high larval density (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{high}})}$$) had high early reproductive rates (see r) and offspring eclosion success, but group survival was lower relative to other treatments. When both males and females experienced low larval density (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$), groups had low early reproductive rates (see r), produced offspring with lower body mass and lower eclosion success, which were rescued in groups consisting of mixed phenotypes. In groups where males, but not females, were phenotypically mixed, there was a delayed peak in reproduction and reduced rates of increasing offspring body mass. Overall, these results suggest far-reaching effects of the interaction between developmental and social environments on offspring and group-level traits. Below, we discuss the main findings of our study in more detail.

### Courtship levels and trans-generational effects

We found that groups composed of males and females from the low larval density developmental environment (large body size phenotype) had higher courtship levels (Fig. 2b) and produced offspring with lower body mass (Fig. 4). Moreover, we showed that the presence of some individuals from high larval density (i.e. phenotypically mixed groups) was sufficient to lower courtship levels and increase offspring body mass. These results contrast with predictions 1 and 2 in which we would expect courtship to be higher in all groups consisting of males from the low larval density developmental environment (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$ and EM/UF) (prediction 1), and offspring body mass to be significantly higher in all groups consisting of females also from the low larval density environment (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$ and UM/EF) (prediction 2). Thus, the data suggest prediction 3 to be true: the social and developmental environments interact to shape courtship activity and offspring traits. There are several possible explanations for our findings. Female phenotypic variation may trigger male adaptive choice, whereby males direct their courtship efforts towards large and more attractive females36, 58. Previously, Long et al.36 have shown that the decrease in courtship effort towards small females is greater than the increase in courtship effort towards large females. Thus, the female phenotypic variation in our experiment could have trigger male adaptive response and led to a reduction on the average courtship level of the group. Moreover, female phenotypic variation may also increase the uncertainty of females in assessing the level of intra-sexual competition for resources, which may trigger female responses to increase investment in their progeny in order to guarantee their offspring’s success in the next generation of unpredictable competition. In parallel, male phenotypic variation is also likely to have influenced group dynamics. In groups consisted of mixed male phenotypes, large males (from low larval density) might have perceived weaker intra-sexual competition (due to the presence of small males), and therefore may decrease their courtship investment to allocate resources in ejaculate and offspring health. Furthermore, the larval manipulation could have signalled the level of intra-sexual competition that individuals were likely to face in adulthood19, 20 which in turn could have altered male and female offspring resource allocation 59, 60 and life-history strategies33. Scrutinising these hypotheses lies beyond the scope of this paper, but remains an important topic of research for future studies.

We also found that offspring body mass increased with group age and plateaued at ~9–13 days of group survival, which was approximately coincident with peak reproductive success (except for EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{high}})}$$, see discussion below) (Fig. S4). Although the significance of this pattern is unclear, differential female offspring allocation and male accessory gland maturation could have influenced offspring body mass60,61,62. In Daphnia magna, maternal age is positively associated with offspring size63. On the other hand, female age delays development and is negatively associated with egg size and hatchability in Collosobruschus maculatus 64. In D. melanogaster, the quantity of seminal fluid and the size of male accessory gland increase with male age62, which could alter male ejaculate investment and account, at least partly, for the increased offspring body mass with increased population age. Moreover, theory suggests that maternal investment in offspring might increase with age65 although evidences of this effect in D. melanogaster are still lacking. More studies are needed to investigate the significance of the increase in offspring body mass as the population aged.

### Group reproductive output and fitness

If the developmental environment was the sole factor determining group fitness, we would have observed higher group fitness for groups consisting of females reared at low density (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$ and UM/EF) (prediction 2) because these females are larger and more fecund. However, our results suggest that groups consisting of males and females from low larval density developmental environments (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{low}})}$$) had lower estimates of group fitness r, which was fully rescued in phenotypically mixed groups of either (or both) sex(es). (Fig. 3a and b). These findings corroborate prediction 3, and shows that the interaction between the developmental and social environments shapes group fitness (see ‘Predictions’). We also showed that the peak reproductive success for groups composed of males from low larval density was earlier (6–9 day of survival) than for groups with mixed male phenotypes (9–13 day of survival). Social and developmental environments can potentially modulate group reproductive success and fitness by altering female reproductive investment as a response to social context as well as male ejaculate investment based on competition levels or accessory gland maturation, or both62, 66. We also found that groups consisting of males and females from high larval density (i.e. EM/$${{\rm{E}}}_{{\rm{F}}}^{({\rm{high}})}$$) had the earliest peak reproductive success amongst our treatments (0–3 days of group survival), and group reproduction rate became a negative linear function in time (Fig 3c). This pattern might arise from possible differences in life-history strategies at the individual level caused by social interactions, whereby males from high larval density environments, when surrounded by rivals with the same background experiences of stressful developmental environment, adopted a strategy to invest heavily on current reproduction at the expense of survival and future reproduction5, 33, 67. Future studies should investigate the relationship between larval density and male maturation as well as individuals’ strategies (as opposed to groups’ responses) adopted in different social contexts.

### Group survival

Groups that consisted of males and females from high larval density environments (small body size) died faster than other treatments (Fig. 2a), corroborating previous findings that small individuals have shorter lifespan26, 68. Phenotypically mixed groups of either males or females, or both, showed similar survival to groups consisted of individuals from low larval density environments, which supports our prediction 3 that social and developmental environments also interact to shape group survival (see discussion above). Had the developmental environment been the sole factor affecting group survival, we might expect groups consisted of males from low larval density environment to die more rapidly because of the higher costs incurred by the elevated courtship activity of these males (prediction 1). Instead, group survival was likely to have been influenced by a myriad of traits of an individual (e.g. female reproductive output) and the interaction between traits among individuals (e.g. female post-mating responses to male seminal fluid proteins) and therefore, further studies are required to fully comprehend the survival patterns observed here. Interestingly, however, Adler et al.69 recently showed that the developmental and social environments modulate somatic deterioration of males neriid fly Telostylinus angusticollis, whereby somatic deterioration is significantly elevated for high condition males in social groups to the point in which high condition males did not outlive low condition males. Together, our results and the results of Adler et al.69 open a new avenue for future research on the interaction between ecological and social factors affecting group survival.

### Interactions between development and social environments

The plastic responses of different phenotypes to the interactions with their surrounding environment are crucial for the success of individuals in nature70. This plasticity may allow individuals to survive and persist in new environments when facing unprecedented challenges, which may in turn influence group-level success71, 72. These patterns are revealed in our data whereby plastic responses to social and developmental environments modulates group survival and trans-generational effects in eclosion success and body mass, which might influence long-term group persistence in challenging environments. Plastic responses to developmental and social environments can shape mating and non-mating behaviour of individuals, affecting the distribution, the quality, and the availability of mates and rivals in the group7, 73,74,75. As a result, plastic responses to the developmental and social environments can modulate the operation of sexual selection in groups, which in turn can shape group survival, growth and speciation patterns7, 72, 76,77,78. This study found that courtship levels, reproduction and fitness of groups are determined by plastic responses to social and developmental environments, which lend support to the idea that plastic responses to the surrounding environmental conditions can modulate sexual and reproductive behaviours and ultimately influence key evolutionary processes. For example, by influencing courtship levels, the developmental and social environments likely affect the operation of sexual selection and sexual conflict. High levels of courtship can harm females, and thus represents a potential source of conflict between the sexes. Specifically, D. melanogaster populations where females experience high courtship have lower survival and reproductive success, thus potentially reducing their fitness (e.g. refs 12, 36, 58, 79 and 80). Both theoretical and empirical work have suggested that high sexual conflict could influence the potential for populations to undergo speciation or go extinct (e.g. refs 78, 81,82,83). Therefore, developmental conditions may lead to a cascade of effects via social interactions and behaviour that modulates sexual conflict and affects the success or failure of populations in the long-term. More work is needed to disentangle precisely how ecological and social conditions mediate sexual conflict, and what this means for group-level metrics. Nonetheless, future ecological and evolutionary studies should acknowledge the implications of multi-level interactions between the early-life experiences (e.g. larval density, larval nutrition), and the social context of competing adults, in order to fully comprehend processes such as sexual selection and sexual conflict.

## Conclusion

In conclusion, our results show important effects of the developmental and social environments on group fitness in D. melanogaster and add to the growing body of research on environmentally-mediated trans-generational effects. All species face challenges in their developmental environment (i.e. physical or nutritional constraints), and in most species individuals are required to interact during their lifetime both for survival and reproduction. Thus, the patterns revealed here could potentially be widespread, and future studies should expand and test our results and predictions in different species across the animal kingdom. Important questions still remain, such as (1) What are the individual level responses to the interactions between developmental and social environments? (2) What are the mechanisms by which individuals discriminate rivals and mates from similar or different developmental environment? (3) What are the molecular mechanisms by which the developmental and social environments interact and lead to the trans-generational effects observed in this study? (4) What are the long-term fitness consequences for the offspring for having lower body mass? (5) For how many generations do the trans-generational effects of the development and social environment persist? The answer to these questions will advance our understanding of the evolutionary and ecological processes affected by the structure, composition and social dynamics of groups and populations.

## References

1. 1.

Svanbäck, R. & Bolnick, D. I. Intraspecific competition drives increased resource use diversity within a natural population. Proceedings of the Royal Society of London B: Biological Sciences 274, 839–844 (2007).

2. 2.

Bolnick, D. I., Svanbäck, R., Araújo, M. S. & Persson, L. Comparative support for the niche variation hypothesis that more generalized populations also are more heterogeneous. Proceedings of the National Academy of Sciences 104, 10075–10079 (2007).

3. 3.

Rowe, L. & Houle, D. The lek paradox and the capture of genetic variance by condition dependent traits. Proceedings of the Royal Society B-Biological Sciences 263, 1415–1421, doi:10.1098/Rspb.1996.0207 (1996).

4. 4.

Boggs, C. L. Understanding insect life histories and senescence through a resource allocation lens. Funct. Ecol. 23, 27–37 (2009).

5. 5.

Stearns, S. C. Trade-offs in life-history evolution. Funct. Ecol. 3, 259–268 (1989).

6. 6.

Wigby, S., Perry, J. C., Kim, Y. H. & Sirot, L. K. Developmental environment mediates male seminal protein investment in Drosophila melanogaster. Funct. Ecol. 30, 410–419 (2015).

7. 7.

Morimoto, J., Pizzari, T. & Wigby, S. Developmental environment effects on sexual selection in male and female Drosophila melanogaster. PLoS One 11, e0154468, doi:10.1371/journal.pone.0154468 (2016).

8. 8.

Janicke, T., David, P. & Chapuis, E. Environment-dependent sexual selection: Bateman’s parameters under varying levels of food availability. American Naturalist 185, 756–768, doi:10.1086/681128 (2015).

9. 9.

Fricke, C., Bretman, A. & Chapman, T. Female nutritional status determines the magnitude and sign of responses to a male ejaculate signal in Drosophila melanogaster. J. Evol. Biol 23, 157–165, doi:10.1111/j.1420-9101.2009.01882.x (2010).

10. 10.

Mason, J. S., Rostant, W. G. & Chapman, T. Resource limitation and responses to rivals in males of the fruit fly Drosophila melanogaster. J. Evol. Biol. (2016).

11. 11.

Zikovitz, A. E. & Agrawal, A. F. The condition dependency of fitness in males and females: the fitness consequences of juvenile diet assessed in environments differing in key adult resources. Evolution 67, 2849–2860, doi:10.1111/evo.12170 (2013).

12. 12.

Arnqvist, G. & Rowe, L. Sexual Conflict. Princeton University Press (2005).

13. 13.

Lumley, A. J. et al. Sexual selection protects against extinction. Nature 522, 470–473 (2015).

14. 14.

Lorch, P. D., Proulx, S., Rowe, L. & Day, T. Condition-dependent sexual selection can accelerate adaptation. Evol. Ecol. Res. 5, 867–881 (2003).

15. 15.

Rankin, D. J., Dieckmann, U. & Kokko, H. Sexual conflict and the tragedy of the commons. The American Naturalist 177, 780–791 (2011).

16. 16.

Kokko, H. & Brooks, R. Sexy to die for? Sexual selection and the risk of extinction. Annales Zoologici Fennici, 207–219 (2003).

17. 17.

Van Doorn, G., Noest, A. & Hogeweg, P. Sympatric speciation and extinction driven by environment dependent sexual selection. Proceedings of the Royal Society of London B: Biological Sciences 265, 1915–1919 (1998).

18. 18.

Atkinson, W. A field investigation of larval competition in domestic Drosophila. The Journal of Animal Ecology, 91–102 (1979).

19. 19.

Lemaitre, J. F., Ramm, S. A., Hurst, J. L. & Stockley, P. Social cues of sperm competition influence accessory reproductive gland size in a promiscuous mammal. Proceedings of the Royal Society B-Biological Sciences 278, 1171–1176, doi:10.1098/rspb.2010.1828 (2011).

20. 20.

Gage, M. J. Continuous variation in reproductive strategy as an adaptive response to population density in the moth Plodia interpunctella. Proceedings of the Royal Society B-Biological Sciences 261, 25–30 (1995).

21. 21.

Amitin, E. G. & Pitnick, S. Influence of developmental environment on male- and female-mediated sperm precedence in Drosophila melanogaster. J. Evol. Biol. 20, 381–391, doi:10.1111/J.1420-9101.2006.01184.X (2007).

22. 22.

Pitnick, S. & Garcia-Gonzalez, F. Harm to females increases with male body size in Drosophila melanogaster. Proceedings of the Royal Society B-Biological Sciences 269, 1821–1828, doi:10.1098/Rspb.2002.2090 (2002).

23. 23.

Lyimo, E., Takken, W. & Koella, J. Effect of rearing temperature and larval density on larval survival, age at pupation and adult size of Anopheles gambiae. Entomologia experimentalis et applicata 63, 265–271 (1992).

24. 24.

Credland, P. F., Dick, K. M. & Wright, A. W. Relationships between larval density, adult size and egg production in the cowpea seed beetle. Callosobruchus maculatus. Ecol. Entomol. 11, 41–50, doi:10.1111/j.1365-2311.1986.tb00278.x (1986).

25. 25.

Bonduriansky, R. The evolution of male mate choice in insects: a synthesis of ideas and evidence. Biol. Rev. Camb. Philos. Soc. 76, 305–339 (2001).

26. 26.

Partridge, L., Ewing, A. & Chandler, A. Male size and mating success in Drosophila melanogaster - the roles of male and female behavior. Anim. Behav. 35, 555–562, doi:10.1016/S0003-3472(87)80281-6 (1987).

27. 27.

Lüpold, S., Manier, M. K., Ala-Honkola, O., Belote, J. M. & Pitnick, S. Male Drosophila melanogaster adjust ejaculate size based on female mating status, fecundity, and age. Behav. Ecol. arq193 (2010).

28. 28.

Parker, G. A. & Pizzari, T. Sperm competition and ejaculate economics. Biological Reviews 85, 897–934, doi:10.1111/J.1469-185x.2010.00140.X (2010).

29. 29.

Chapman, R. F. The insects: structure and function. (Cambridge university press, 1998).

30. 30.

Honek, A. Intraspecific Variation in Body Size and Fecundity in Insects - a General Relationship. Oikos 66, 483–492, doi:10.2307/3544943 (1993).

31. 31.

Shine, R. et al. Body size enhances mating success in male garter snakes. Anim. Behav. 59, F4–F11 (2000).

32. 32.

Roff, D. A. Life history evolution. Vol. 7 (Sinauer Associates Sunderland, 2002).

33. 33.

Stearns, S. C. The evolution of life histories. Vol. 249 (Oxford University Press Oxford, 1992).

34. 34.

Clutton-Brock, T. Sexual selection in females. Anim. Behav. 77, 3–11 (2009).

35. 35.

McGraw, L. A. et al. Larval rearing environment affects several post-copulatory traits in Drosophila melanogaster. Biol. Lett 3, 607–610, doi:10.1098/Rsbl.2007.0334 (2007).

36. 36.

Long, T. A. F., Pischedda, A., Stewart, A. D. & Rice, W. R. A Cost of Sexual Attractiveness to High-Fitness Females. PLoS Biol. 7, e1000254, doi:10.1371/journal.pbio.1000254 (2009).

37. 37.

Wey, T., Blumstein, D. T., Shen, W. & Jordán, F. Social network analysis of animal behaviour: a promising tool for the study of sociality. Anim. Behav. 75, 333–344 (2008).

38. 38.

Demas, G. E., Johnson, C. & Polacek, K. M. Social interactions differentially affect reproductive and immune responses of Siberian hamsters. Physiol. Behav. 83, 73–79 (2004).

39. 39.

Bartolomucci, A. Social stress, immune functions and disease in rodents. Front. Neuroendocrinol. 28, 28–49 (2007).

40. 40.

Martin, L. B., Navara, K. J., Weil, Z. M. & Nelson, R. J. Immunological memory is compromised by food restriction in deer mice Peromyscus maniculatus. American Journal of Physiology-Regulatory, Integrative and Comparative Physiology 292, R316–R320 (2007).

41. 41.

Yee, J. R. & Prendergast, B. J. Sex-specific social regulation of inflammatory responses and sickness behaviors. Brain. Behav. Immun. 24, 942–951 (2010).

42. 42.

Cornwallis, C. K. & Uller, T. Towards an evolutionary ecology of sexual traits. Trends Ecol. Evol. 25, 145–152, doi:10.1016/j.tree.2009.09.008 (2010).

43. 43.

West-Eberhard, M. J. Darwin’s forgotten idea: The social essence of sexual selection. Neurosci. Biobehav. Rev. 46, 501–508 (2014).

44. 44.

Champagne, F. A. & Meaney, M. J. Transgenerational effects of social environment on variations in maternal care and behavioral response to novelty. Behav. Neurosci. 121, 1353 (2007).

45. 45.

Curley, J. P., Davidson, S., Bateson, P. & Champagne, F. A. Social enrichment during postnatal development induces transgenerational effects on emotional and reproductive behavior in mice. Front. Behav. Neurosci. 3, 25 (2009).

46. 46.

Fox, C. W. & Mousseau, T. A. Maternal effects as adaptations for transgenerational phenotypic plasticity in insects. Maternal effects as adaptations 159 (1998).

47. 47.

Groom, M. J., Meffe, G. K. & Carroll, C. R. Principles of conservation biology. (Sinauer Associates Sunderland, 2006).

48. 48.

Beaty, B. J. & Marquardt, W. C. The biology of disease vectors. (University Press of Colorado, 1996).

49. 49.

Clancy, D. J. & Kennington, W. J. A simple method to achieve consistent larval density in bottle cultures. Drosophila Information Service 84, 168–169 (2001).

50. 50.

Sokolowski, M. B. Drosophila: genetics meets behaviour. Nature Reviews Genetics 2, 879–890 (2001).

51. 51.

Therneau, T. A package for survival analysis in S. R package version 2.37-4. See http://CRAN.R-project.org/package=survival (2014).

52. 52.

Edward, D. A., Fricke, C., Gerrard, D. T. & Chapman, T. Quantifying the life-history response to increased male exposure in female Drosophila melanogaster. Evolution 65, 564–573, doi:10.1111/j.1558-5646.2010.01151.x (2011).

53. 53.

Wigby, S. & Chapman, T. Sex peptide causes mating costs in female Drosophila melanogaster. Curr. Biol. 15, 316–321, doi:10.1016/j.cub.2005.01.051 (2005).

54. 54.

R Development Core Team. R: A language and environment for statistical computing. R. Foundation for Statistical Computing, Vienna, Austria. http://www.R-project.org/ (2015).

55. 55.

Fox, J. & Sanford, W. An R companion to applied regression (2011).

56. 56.

Wickham, H. ggplot2: elegant graphics for data analysis (2009).

57. 57.

Charlesworth, B. Evolution in age-structured populations. Vol. 2 (Cambridge University Press Cambridge, 1994).

58. 58.

Byrne, P. G. & Rice, W. R. Evidence for adaptive male mate choice in the fruit fly Drosophila melanogaster. Proceedings of the Royal Society B-Biological Sciences 273, 917–922, doi:10.1098/rspb.2005.3372 (2006).

59. 59.

Allen, R. M., Buckley, Y. M. & Marshall, D. J. Offspring size plasticity in response to intraspecific competition: An adaptive maternal effect across life‐history stages. The American Naturalist 171, 225–237 (2008).

60. 60.

Crean, A. J. & Bonduriansky, R. What is a paternal effect? Trends Ecol. Evol. 29, 554–559 (2014).

61. 61.

Mousseau, T. A. & Fox, C. W. The adaptive significance of maternal effects. Trends Ecol. Evol 13, 403–407 (1998).

62. 62.

Ruhmann, H., Wensing, K. U., Neuhalfen, N., Specker, J.-H. & Fricke, C. Early reproductive success in Drosophila males is dependent on maturity of the accessory gland. Behav. Ecol., arw123 (2016).

63. 63.

Glazier, D. S. Effects of food, genotype, and maternal size and age on offspring investment in Daphnia magna. Ecology 73, 910–926 (1992).

64. 64.

Fox, C. W. The influence of maternal age and mating frequency on egg size and offspring performance in Callosobruchus maculatus (Coleoptera: Bruchidae). Oecologia 96, 139–146 (1993).

65. 65.

Moorad, J. A. & Nussey, D. H. Evolution of maternal effect senescence. Proceedings of the National Academy of Sciences 113, 362–367 (2016).

66. 66.

Sirot, L. K., Wolfner, M. F. & Wigby, S. Protein-specific manipulation of ejaculate composition in response to female mating status in Drosophila melanogaster. Proceedings of the National Academy of Sciences 108, 9922–9926, doi:10.1073/Pnas.1100905108 (2011).

67. 67.

Kirkwood, T. B. & Rose, M. R. Evolution of senescence: late survival sacrificed for reproduction. Philosophical Transactions of the Royal Society B: Biological Sciences 332, 15–24 (1991).

68. 68.

Partridge, L. & Farquhar, M. Sexual activity reduces lifespan of male fruitflies. Nature 294, 580–582, doi:10.1038/294580a0 (1981).

69. 69.

Adler, M. I., Telford, M. & Bonduriansky, R. Phenotypes optimized for early‐life reproduction exhibit faster somatic deterioration with age, revealing a latent cost of high condition. J. Evol. Biol. (2016).

70. 70.

Price, T. D. Phenotypic plasticity, sexual selection and the evolution of colour patterns. J. Exp. Biol. 209, 2368–2376, doi:10.1242/jeb.02183 (2006).

71. 71.

Robinson, B. W. & Dukas, R. The influence of phenotypic modifications on evolution: the Baldwin effect and modern perspectives. Oikos, 582–589 (1999).

72. 72.

West-Eberhard, M. J. Developmental plasticity and evolution. (Oxford University Press, 2003).

73. 73.

Kokko, H. & Rankin, D. J. Lonely hearts or sex in the city? Density-dependent effects in mating systems. Philosophical Transactions of the Royal Society B: Biological Sciences 361, 319–334 (2006).

74. 74.

Han, C. S. & Brooks, R. C. Long-term effect of social interactions on behavioral plasticity and lifetime mating success. The American Naturalist 183, 431–444 (2014).

75. 75.

Lackey, A. C. R. & Boughman, J. W. Divergent sexual selection via male competition: ecology is key. J. Evol. Biol 26, 1611–1624, doi:10.1111/Jeb.12173 (2013).

76. 76.

Agrawal, A. A. Phenotypic Plasticity in the Interactions and Evolution of Species. Science 294, 321–326, doi:10.1126/science.1060701 (2001).

77. 77.

Forsman, A. Rethinking phenotypic plasticity and its consequences for individuals, populations and species. Heredity (Edinb.) 115, 276–284 (2015).

78. 78.

Arnqvist, G., Edvardsson, M., Friberg, U. & Nilsson, T. Sexual conflict promotes speciation in insects. Proceedings of the National Academy of Sciences 97, 10460–10464, doi:10.1073/pnas.97.19.10460 (2000).

79. 79.

Partridge, L. & Fowler, K. Non-mating costs of exposure to males in female Drosophila melanogaster. J. Insect Physiol. 36, 419–425 (1990).

80. 80.

Chapman, T., Arnqvist, G., Bangham, J. & Rowe, L. Sexual conflict. Trends Ecol. Evol. 18, 41–47, doi:10.1016/S0169-5347(02)00004-6 (2003).

81. 81.

Gavrilets, S. Rapid evolution of reproductive barriers driven by sexual conflict. Nature 403, 886–889, doi:http://www.nature.com/nature/journal/v403/n6772/suppinfo/403886a0_S1.html (2000).

82. 82.

Gavrilets, S. & Waxman, D. Sympatric speciation by sexual conflict. Proceedings of the National Academy of Sciences 99, 10533–10538, doi:10.1073/pnas.152011499 (2002).

83. 83.

Parker, G. A. Sexual conflict over mating and fertilization: an overview. Philosophical Transactions of the Royal Society B: Biological Sciences 361, 235–259, doi:10.1098/rstb.2005.1785 (2006).

## Acknowledgements

The authors acknowledge Prof Stephen J Simpson and Prof Phil Taylor for the support during the experiments. J.M. was funded by a DPhil scholarship from the Brazilian National Council for Scientific and Technological Development (CNPq). S.W. is funded by BBSRC (BB/K014544/1) fellowship.

## Author information

Authors

### Contributions

J.M., F.P. and S.W. designed the experiment. J.M., F.P., I.T. and J.C. collected the data. All authors contributed to writing the manuscript.

### Corresponding author

Correspondence to Juliano Morimoto.

## Ethics declarations

### Competing Interests

The authors declare that they have no competing interests.

Publisher's note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Reprints and Permissions

Morimoto, J., Ponton, F., Tychsen, I. et al. Interactions between the developmental and adult social environments mediate group dynamics and offspring traits in Drosophila melanogaster . Sci Rep 7, 3574 (2017). https://doi.org/10.1038/s41598-017-03505-2

• Accepted:

• Published:

• ### Effects of carbohydrate types on larval development and adult traits in a polyphagous fruit fly

• Juliano Morimoto
• , Binh Nguyen
• , Ida Lundbäck
• , Anh The Than
• , Shabnam T. Tabrizi
• , Fleur Ponton
•  & Phillip W. Taylor

Journal of Insect Physiology (2020)

• ### Offspring diet supersedes the transgenerational effects of parental diet in a specialist herbivore Neolema abbreviata under manipulated foliar nitrogen variability

• Abongile Mbande
• , Michelle Tedder
•  & Frank Chidawanyika

Insect Science (2020)

• ### Interactions between ecological factors in the developmental environment modulate pupal and adult traits in a polyphagous fly

• Binh Nguyen
• , Fleur Ponton
• , Anh Than
• , Phillip W. Taylor
• , Toni Chapman
•  & Juliano Morimoto

Ecology and Evolution (2019)

• ### Larval foraging decisions in competitive heterogeneous environments accommodate diets that support egg-to-adult development in a polyphagous fly

• Juliano Morimoto
• , Shabnam Tarahi Tabrizi
• , Ida Lundbäck
• , Bishwo Mainali
• , Phillip W. Taylor
•  & Fleur Ponton

Royal Society Open Science (2019)

• ### Sex peptide receptor-regulated polyandry modulates the balance of pre- and post-copulatory sexual selection in Drosophila

• Juliano Morimoto
• , Grant C. McDonald
• , Emelia Smith
• , Damian T. Smith
• , Jennifer C. Perry
• , Tracey Chapman
• , Tommaso Pizzari
•  & Stuart Wigby

Nature Communications (2019)