Drosophila melanogaster behaviour changes in different social environments based on group size and density


Many organisms, when alone, behave differently from when they are among a crowd. Drosophila similarly display social behaviour and collective behaviour dynamics within groups not seen in individuals. In flies, these emergent behaviours may be in response to the global size of the group or local nearest-neighbour density. Here we investigate i) which aspect of social life flies respond to: group size, density, or both and ii) whether behavioural changes within the group are dependent on olfactory support cells. Behavioural assays demonstrate that flies adjust their interactive behaviour to group size but otherwise compensate for density by achieving a standard rate of movement, suggesting that individuals are aware of the number of others within their group. We show that olfactory support cells are necessary for flies to behave normally in large groups. These findings shed insight into the subtle and complex life of Drosophila within a social setting.


In the wild, many animals interact and congregate into groups. It has been suggested that within a group, individuals follow simple rules based on local information and interact in ways that produce complex phenomena1,2,3,4. The benefits of forming groups can include increased foraging times5,6, lower predation risks7,8,9,10, social thermoregulation (e.g.11,12) and access to mates13. The composition of a group can influence the health and fitness of individuals within it14,15,16. Thus, understanding how the size and density of a group influence self-organisation can provide insight into the relative benefits of group living.

Drosophila melanogaster aggregate and form groups. Drosophila will aggregate even in the absence of food17. In addition, groups of flies display collective avoidance to aversive stimuli and increased foraging efficiency18,19. Drosophila groups disseminate social information throughout their life history, from larval communication and collective feeding20,21 to pheromonal communication during pupal metamorphosis22 to adult information transfer of oviposition preference23 and social learning24. Within this complex social aggregate, flies may regulate inter-individual distance25 and maintain a social space26, thereby limiting ʽrandomʼ encounters in favour of behavioural interactions27. Within aggregates, individual flies synchronise themselves to the group, both in terms of overall behaviour28 and pheromone profile29. Thus, flies adjust their behaviour and physiology to group size and composition.

There are at least two explanations for a fly's ability to sense and respond to the group: (1) with larger densities, the frequency of encounters between individuals increases locally and the fly adjusts to this frequency or (2) single flies are able to sense group size globally, such that their behaviour and physiology are influenced by the size of the group. These possibilities have been confounded in previous studies, which often do not separate the effects of group size and density. To disentangle their roles and gain insight into these key features of group dynamics and their underlying mechanisms, we investigate whether flies adjust their behaviour as a function of group size, density, or both using a social network approach. Moreover, we investigate whether olfaction may affect a group’s ability to adjust to different sizes and densities.


Group size and density alter behaviour in wild-type flies

First, we asked whether wild-type flies form social interaction networks (SINs) with different properties depending on the size and/or density of the group (Supplementary Fig. 1). Their interactions were characterised by use of an automated social interaction identification system27. For each group size, as density increases the interaction criteria (angle, distance, time) generally decreases, although due to the non-independent nature of how the criteria are calculated, no statistical tests can be done (see ref. 27). As group size increases while maintaining a constant density, the interaction criteria generally increases (Table 1; Supplementary Fig. 2). Thus, flies are adjusting the ways in which they interact based on the size and density of their groups. Next, movement and interaction rates were evaluated. Interestingly, flies across all group sizes and densities move the same amount (Fig. 1a). Intuitively, one would expect that increasing density would decrease individual movement via collision, with the increasing chance of physical encounters, whereas there would be little change in individual movement across constant densities. These results suggest that wild-type flies are regulating their movement to compensate for increasing densities. In addition, their rates of interaction are both group size- and density-dependent: as both group size and density increase, rates of interaction increase (Fig. 1b). Overall, these results indicate that flies are adjusting their interactions based on their group size and density, both in terms of the rate at which they interact and the way they interact, while regulating their movement to compensate for density.

Table 1 Interaction criteria for wild-type flies for different group sizes and densities.
Fig. 1: Behavioural properties of male flies at different densities and group sizes.

Dots represent a single trial for groups of 6, 12 and 24 flies at low (blue), medium (orange) and high (grey) densities. The mean for each group size-density treatment is indicated by a horizontal line. Letters indicate statistical significance (α = 0.008) after outlier removal (Supplementary Fig. 3). a Movement. Movement does not change across different group sizes and densities. Density: F(2,183) = 0.96, p = 0.386; Group size: F(2,183) = 0.02, p = 0.982; Density × Group size: F(4,183) = 1.52, p = 0.198. Group size 6: low—n = 20, medium—n = 21, high—n = 23; Group size 12: low—n = 22, medium—n = 20, high—n = 21; Group size 24: low—n = 23, medium—n = 19, high—n = 23. b Interaction rate. Interaction rates increase with increasing density and group size. Density: F(2,184) = 78.27, p < 0.008; Group size: F(2,184) = 538.27, p < 0.008; Density × Group size: F(4,184) = 9.39, p < 0.008. Group size 6: low—n = 20, medium—n = 21, high—n = 24; Group size 12: low—n = 22, medium—n = 20, high—n = 22; Group size 24: low n = 22, medium = 19, high = 23. c Clustering coefficient. Flies in groups of 6 and 12 have lower clustering coefficient than groups of 24 flies. There is no effect of density on clustering coefficient. Density: F(2,176) = 2.70, p = 0.070; Group size: F(2,176) = 47.50, p < 0.008; Density × Group size: F(4,176) = 1.10, p = 0.360. Group size 6: low n = 20, medium = 21, high = 21; Group size 12: low n = 21, medium = 20, high = 22; Group size 24: low n = 22, medium = 17, high = 21. d Betweeness centrality. Flies in groups of 6 have lower betweeness centrality than groups of 12 and 24 flies. Density: F(2,178) = 6.03, p < 0.008; Group size: F(2,178) = 809.95, p < 0.008; Density × Group size: F(4,178) = 1.76, p = 0.140. Group size 6: low n = 20, medium = 21, high = 23; Group size 12: low n = 20, medium = 19, high = 22; Group size 24: low n = 21, medium = 18, high = 23.

Next, two SIN properties were evaluated: (1) clustering coefficient: a measure of how interconnected neighbours are to one another30 and (2) betweeness centrality: a measure of network cohesion30. For clustering coefficient, groups of six and 12 behave similarly to each other and have a lower clustering coefficient than groups of 24 flies (Fig. 1c). The higher clustering coefficient in groups of 24 indicates that flies are more interconnected when in a large group. For betweeness centrality, groups of six flies form SINs with lower betweeness centrality than groups of 12 and 24 flies (Fig. 1d). This indicates that when flies are in medium- and large-sized groups, they form SINs with greater network cohesion. Overall, these data indicate that flies can evaluate their social environment and alter their behaviour to regulate for differences in density and group size, suggesting that flies respond to their group using both a local and global approach.

LUSH-mediated olfaction regulates behaviour across groups

We asked whether olfaction is required for flies to evaluate the number of individuals in their group, while maintaining a fixed density. To do this, cells expressing the olfactory binding protein, LUSH, were inhibited. LUSH is expressed in all Drosophila trichoid sensillae31 and facilitates the binding of ligands to olfactory receptors31,32. For all measurements, control flies behave similarly to wild-type flies, suggesting that we are capturing a robust group-size effect (Figs. 1 and 2). In lush-inhibited flies, interaction criteria exhibit a similar trend to those of wild-type flies: at constant density, the interaction criteria generally increase with group size (Table 2). Although movement is genotype-dependent, there was no group-size effect on movement: the experimental lush-inhibited flies move the same amount as at least one of their respective control lines (Fig. 2a). We see a similar trend of interaction rates when compared with wild-type flies, where increasing group size increases the interaction rates (Figs. 1b and 2b). In groups of six, inhibiting lush-expressing cells has no effect on clustering coefficient or betweeness centrality. However, when lush-expressing cells are inhibited in flies in groups of 12 or 24, flies organise themselves in ways that mimic a larger group (Fig. 2c,d). Interestingly, for both clustering coefficient and betweeness centrality, lush-inhibited flies in groups of 12 have a higher clustering coefficient and betweeness centrality than their controls and behave as if they are in a group of 24. Groups of 24 lush-inhibited flies have higher clustering coefficient and betweeness centrality values than their controls, presumably behaving like they are in an even larger group (Fig. 2c,d). Overall, we observe that, in medium- and large-sized groups, olfaction is required for flies to accurately detect the number of individuals in their social environment and, when inhibited, flies behave as if in a larger group. Moreover, impairing olfaction has no effect on flies in small groups, indicating that other sensory modalities may be used to evaluate small group sizes.

Fig. 2: Behavioural properties of male flies with inhibited lush-expressing cells at different group sizes.

Dots represent a single trial for groups of 6, 12 and 24 flies for UAS-Kir2.1 control flies (pink), lush-GAL4 control flies (pink) and silenced lush flies (turquoise) at medium density. The mean for each group size-genotype is indicated by a horizontal line. Letters indicate statistical significance (α = 0.008) after outlier removal (Supplementary Fig. 4). a Movement. The movement for the silenced lush flies (turquoise) is the same as at least one of their respective controls (pink) for each group size. Genotype: F(2,184) = 6.15, p < 0.008; Group size: F(2,184) = 4.61, p = 0.011; Genotype × Group size: F(4,184) = 6.93, p < 0.008. Group size 6: UAS-Kir2.1 Control—n = 22, Gal4 Control—n = 22, Experimental—n = 22; Group size 12: UAS-Kir2.1 Control—n = 22, Gal4 Control—n = 21, Experimental—n = 22; Group size 12-UAS-Kir2.1 Control n = 21, Gal4 Control = 19, Experimental = 22. b Interaction rate. The interaction rates for the silenced lush flies (turquoise) are the same as at least one of their respective controls (pink) for each group size. Genotype: F(2,183) = 13.39, p < 0.008; Group size: F(2,183) = 229.88, p < 0.008; Genotype × Group size: F(4,183) = 9.2, p < 0.008. Group size 6: UAS-Kir2.1 Control—n = 22, Gal4 Control—n = 22, Experimental—n = 22; Group size 12: UAS-Kir2.1 Control—n = 22, Gal4 Control—n = 21, Experimental—n = 22; Group size 24: UAS-Kir2.1 Control n = 20, Gal4 Control = 19, Experimental = 22. c Clustering coefficient. Silenced lush flies (turquoise) in groups of 6 do not differ in clustering coefficient from their controls (pink). When in groups of 12 and 24, silenced lush flies have higher clustering coefficient than their controls. Genotype: F(2,167) = 30.68, p < 0.008; Group size: F(2,167) = 243.49, p < 0.008; Genotype × Group size: F(4,167) = 6.63, p < 0.008. Group size 6: UAS-Kir2.1 Control—n = 20, Gal4 Control—n = 20, Experimental—n = 21; Group size 12: UAS-Kir2.1 Control—n = 19, Gal4 Control—n = 21, Experimental—n = 18; Group size 24: UAS-Kir2.1 Control—n = 20, Gal4 Control—n = 18, Experimental—n = 19. d Betweeness centrality. Silenced lush flies (turquoise) in groups of 6 do not differ in betweeness centrality from their controls (pink). When in groups of 12 and 24, silenced lush flies have higher betweeness centrality than their controls. Genotype: F(2,172) = 18.52, p < 0.008; Group size: F(2,172) = 710.79, p < 0.008; Genotype × Group size: F(4,172) = 9.28, p value < 0.008. Group size 6: UAS-Kir2.1 Control—n = 22, Gal4 Control—n = 20, Experimental—n = 21; Group size 12: UAS-Kir2.1 Control—n = 21, Gal4 Control—n = 21, Experimental—n = 20; Group size 24: UAS-Kir2.1 Control—n = 19, Gal4 Control—n = 18, Experimental—n = 19.

Table 2 Interaction criteria for lush-silenced flies and their controls for different group sizes at medium density.


In this paper, we show that flies can detect the number of individuals around them and, importantly, their behaviour changes depending on that number. We test group size and density separately and show that some, but not all, group behaviours are density-dependent. A fly's ability to sense and respond to the group is not merely a function of flies encountering each other more frequently: although their interaction rates and interaction criteria change based on both group size and density, their social network properties were primarily dependent on group size. Thus, individual group members can sense their social environment and are influenced by the size of their group. Moreover, we show that lush-expressing cells are necessary for detecting group size. LUSH is required to detect cis-vaccenyl acetate (cVA), a male-specific volatile pheromone, which is known to cause aggregation and dispersal in Drosophila33,34. It is possible that cVA is a necessary component for flies to accurately assess group size but that it is not the only factor necessary: when lush-expressing cells are inhibited, flies in groups of six show no effect in their SIN properties. This indicates that flies in small groups may rely on non-olfactory mechanisms for sensing the social environment, such as vision, mechanosensation or auditory cues. Previous studies on groups of 12 flies failed to show effects of vision or sound on group-level structure35. However, recent research indicates that both vision and the cVA receptor, Or65a, are required to regulate social group interactions in groups of 10 flies36 and groups of 50 flies’ social clustering is impacted by various sensory modalities, including olfaction, vision and touch17. Further studies on smaller group sizes are required to fully dissect how flies detect their social environment.

Individuals following simple rules may yield complex group responses despite the absence of a centralised or global control mechanism, a phenomenon defined as self-assembly37. At the group level, this can manifest as insect swarms, fish shoals or avian flocks1,2,3,38. The group size-dependent behaviour that we observe for betweeness centrality is seen in shoaling fish, where group sizes greater than six have different foraging properties in the presence of a predator compared with groups of six or less39. Similar to our finding of movement across different densities, ants have also been shown to regulate their behaviour based on density40. Recent research shows that SINs are formed by various species of Drosophila and their network properties differ across species41. Thus, social regulation at the group-level spans across species, taxa and across a variety of social systems. Perhaps because flies are small and move at a quick time scale, most research has not focused on what happens within a group of flies. Yet, it is clear that Drosophila melanogaster has an innate capacity to assess its social environment and participate in complex group behaviour.


Fly stocks

The Canton-S strain was the wild-type strain of D. melanogaster. For the lush experiments, we backcrossed both our lush-GAL4 line (w*;pLUSH-GAL4;sb/Tm6B) and UAS-Kir2.1 line (BDSC: 6596 w*;P{UAS-Hsap\KCNJ2.EGFP}1;+) to w1118. We used w1118;pLUSH-GAL4/+;+/+ male progeny as Gal4 control flies. We used w1118;P{UAS-Hsap\KCNJ2.EGFP}1/+;+/+ as UAS control flies. The genotype of our experimental flies was w1118; pLUSH-Gal4/ P{UAS-Hsap\KCNJ2.EGFP}1;+/+.

Video acquisition and fly treatment

Experiments were acquired as described in Schneider et al.35. Briefly, fly stocks were maintained at 25 °C in a 12/12 Light–Dark cycle. Collections were done under light anesthesia (CO2) within 4 h of eclosion. The appropriate numbers of male flies were housed for 3 days at 25 °C in a 12/12 Light–Dark cycle in vials with food. Flies were housed in group sizes determined by treatment. Experiments were performed within a 2-h window starting 3 h before lights off. Flies were gently aspirated by mouth into plexiglass arenas and were allowed to acclimate for 10 min prior to the 30-min video acquisition. Video acquisition was performed in an environmental chamber (25 °C, 60% humidity) using Fview software (open source, Ubuntu package used) and FireflyMV (Point Grey) cameras. Each assay was performed on a distinct sample of flies. Flies were discarded after the 30-min video was recorded.

Arena diameters are described in Supplementary Fig. 1. The pLUSH-Kir2.1 experiment was performed at medium density for all group sizes.

Social interaction networks (SINs)

These experiments were performed as described by Schneider et al.35. Briefly, each flies’ trajectory was tracked from the videos using Ctrax (open source, versions 0.3.2 and 0.5.18) to track fly movement, orientation and identity. Ctrax-Fixerrors was used to manually inspect/correct fly trajectories. Custom algorithms were used to generate the SINs at 25% network density. Each network iteration had its structural measure calculated, and then normalised against 10,000 random networks which preserved the in- and out- degree of the iteration to create a Z-score.

Social distance and social interaction space were determined using an open-source automated algorithm described by Schneider & Levine27 in Matlab (Mathworks).

To generate ‘null’ datasets, we mixed and matched trajectories within a treatment to generate virtual trials which contained the appropriate number of flies. These trials, therefore, controlled for the movement and behaviour of flies in our arena without social feedback. The ‘null’ dataset’s connectivity matrices and measurements were calculated as above.

To control for the artificial change in network measures caused by varying the network size, the Z-scores of our observed networks were normalised a second time against the average mean and average standard deviation of the respective ‘null’ measurements.

Each trial (or n = 1) indicates the mean from an independent group of flies (at their correct group size/density/genotype) that were discarded after the 30-min network experiment was acquired. For each experimental treatment, we acquired videos from ~20 independent groups of flies (n = ~20 for each treatment).

Statistics and reproducibility

We analyzed four network properties, movement and interaction rate. For each experiment, a two-way ANOVA was performed in Matlab (MathWorks) with a Bonferroni corrected alpha (α = 0.008) followed by a Tukey–Kramer post hoc (α = 0.05). Each data point indicates a mean from a single trial, derived from a group of flies that were filmed once and then disposed of. For all data, outliers ≥75th quartile+(1.5 × IQR) or ≤25th quartile-(1.5 × IQR) were removed (Supplementary Figs. 3 and 4) before statistical testing.

Sample sizes for the wild-type experiment before outlier removal are as follows: Group size 6: low—n = 20, medium—n = 21, high—n = 24; Group size 12: low—n = 22, medium—n = 20, high—n = 22; Group size 24: low—n = 23, medium—n = 19, high—n = 23.

Sample sizes for the LUSH experiment before outlier removal are as follows: Group size 6: UAS-Kir2.1 Control—n = 22, Gal4 Control—n = 22, Experimental—n = 22; Group size 12: UAS-Kir2.1 Control—n = 22, Gal4 Control—n = 21, Experimental—n = 22; Group size 24: UAS-Kir2.1 Control—n = 21, Gal4 Control—n = 20, Experimental—n = 22.

Reporting summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.

Data availability

The datasets generated during and/or analyzed during the current study are provided as Supplementary Data.

Code availability

Custom code used in this manuscript is available upon request from the corresponding author.


  1. 1.

    Moiseff, A. & Copeland, J. Firefly synchrony: a behavioral strategy to minimize visual cluster. Science 329, 181 (2010).

    CAS  Article  Google Scholar 

  2. 2.

    Procaccini, A. et al. Propagating waves in starling, sturnus vulgaris, flocks under predation. Anim. Behav. 82, 759–765 (2011).

    Article  Google Scholar 

  3. 3.

    Partridge, B. Internal dynamics and the interrelations of fish schools. J. Comp. Physiol. 144, 313–325 (1981).

    Article  Google Scholar 

  4. 4.

    Downes, J. A. The swarming and mating flight of diptera. Annu. Rev. Entomol. 14, 271–298 (1969).

    Article  Google Scholar 

  5. 5.

    Underwood, R. Vigilance behaviour in grazing African antelopes. Behaviour 79, 81–107 (1982).

    Article  Google Scholar 

  6. 6.

    Blumstein, D. T., Evans, C. S. & Daniel, J. C. An experimental study of behavioural group size effects in tammar wallabies, Macropus eugenii. Anim. Behav. 58, 351–360 (1999).

    CAS  Article  Google Scholar 

  7. 7.

    Hamilton, W. D. Geometry of the selfish herd. J. Theor. Biol. 31, 295–311 (1971).

    CAS  Article  Google Scholar 

  8. 8.

    Beauchamp, G. Group-size effects on vigilance: a search for mechanisms. Behav. Process. 63, 111–121 (2003).

    Article  Google Scholar 

  9. 9.

    Roberts, G. Why individual vigilance declines as group size increases. Anim. Behav. 51, 1077–1086 (1996).

    Article  Google Scholar 

  10. 10.

    Elgar, M. A. Predator vigilance and group size in mammals and birds. Biol. Rev. 64, 13–33 (1989).

    CAS  Article  Google Scholar 

  11. 11.

    Andersen, I. L., Boe, K. E. & Hove, K. Behavioral and physiological thermoregulation in groups of pregnant sows housed in a kennel system at low temperatures. Can. J. Anim. Sci. 80, 1–8 (2000).

    Article  Google Scholar 

  12. 12.

    Ostner, J. Social Thermoregulation in Redfronted Lemurs (Eulemur fulvus rufus). Folia Primatologica 73, 175–180 (2002).

    Article  Google Scholar 

  13. 13.

    Krause, J. & Ruxton, G. D. Living in groups. (Oxford University Press, 2002).

  14. 14.

    Billeter, J.-C., Jagadeesh, S., Stepek, N., Azanchi, R. & Levine, J. Drosophila melanogaster females change mating behaviour and offspring production based on social context. Proc. R. Soc. B: Biol. Sci. 279, 2417–2425 (2012).

    Article  Google Scholar 

  15. 15.

    Dawson, E. et al. Social environment mediates cancer progression in Drosophila. Nat. Commun. 9, 3574 (2018).

    Article  Google Scholar 

  16. 16.

    Ferreira C., Moita M. Behavioral and neuronal underpinnings of safety in numbers in fruit flies. Preprint at https://doi.org/10.1101/629311 (2019).

  17. 17.

    Jiang, L. et al. Emergence of social cluster by collective pairwise encounters in Drosophila. eLife 9, e51921 (2020).

    Article  Google Scholar 

  18. 18.

    Ramdya, P. et al. Mechanosensory interactions drive collective behaviour in Drosophila. Nature 519, 233–236 (2015).

    CAS  Article  Google Scholar 

  19. 19.

    Tinette, S., Zhang, L. & Robichon, A. Cooperation between Drosophila flies in searching behavior. Genes, Brain Behav. 3, 39–50 (2004).

    CAS  Article  Google Scholar 

  20. 20.

    Durisko, Z. & Dukas, R. Attraction to and learning from social cues in fruitfly larvae. Proc. R. Soc. B: Biol. Sci. 280, 20131398 (2013).

    Article  Google Scholar 

  21. 21.

    Durisko, Z., Kemp, R., Mubasher, R. & Dukas, R. Dynamics of social behavior in fruit fly larvae. PLoS ONE 9, e95495 (2014).

    Article  Google Scholar 

  22. 22.

    Pontier, S. & Schweisguth, F. A Wolbachia-Sensitive communcation between male and female pupae controls gamete compatibility in Drosophila, Curr. Biol. 25, 2339–2348 (2015).

  23. 23.

    Golden, S. & Dukas, R. The value of patch-choice copying in fruit flies. PLoS ONE 9, e112381 (2014).

    Article  Google Scholar 

  24. 24.

    Battesti, M., Moreno, C., Joly, D. & Mery, F. Spread of social information and dynamics of social transmission within Drosophila groups. Curr. Biol. 22, 309–313 (2012).

    CAS  Article  Google Scholar 

  25. 25.

    Sexton, O. J. & Stalker, H. D. Spacing patterns of female Drosophila paramelanica. Anim. Behav. 9, 77–78 (1961).

    Article  Google Scholar 

  26. 26.

    Simon, A. F. et al. A simple assay to study social behavior in Drosophila: measurement of social space within a group. Genes, Brain Behav. 11, 243–252 (2012).

    CAS  Article  Google Scholar 

  27. 27.

    Schneider, J. & Levine, J. D. Automated identification of social interaction criteria in Drosophila melanogaster. Biol. Lett. 10, 20140749 (2014).

    CAS  Article  Google Scholar 

  28. 28.

    Higgins, L. A., Jones, K. M. & Wayne, M. L. Quantitative genetics of natural variation of behavior in Drosophila melanogaster: the possible role of the social environment on creating persistent patterns of group activity. Evolution 59, 1529–1539 (2005).

    Article  Google Scholar 

  29. 29.

    Kent, C., Azanchi, R., Smith, B., Formosa, A. & Levine, J. D. Social context influences chemical communication in D. melanogaster Males. Curr. Biol. 18, 1384–1389 (2008).

    CAS  Article  Google Scholar 

  30. 30.

    Newman, M. Networks: An Introduction. (Oxford University Press Inc., New York, 2010).

    Google Scholar 

  31. 31.

    Benton, R. Sensitivity and specificity in Drosophila. Pheromone Percept., Trends Neurosci. 30, 512–519 (2007).

    CAS  Article  Google Scholar 

  32. 32.

    Kim, M. S., Repp, A. & Smith, D. P. LUSH odorant-binding protein mediates chemosensory responses in alcohols in Drosophila melanogaster. Genetics 150, 711–721 (1998).

    CAS  PubMed  PubMed Central  Google Scholar 

  33. 33.

    Xu, P. X., Atkinson, R., Jones, D. N. M. & Smith, D. P. Drosophila OBP LUSH is required for activity of pheromone-sensitive neurons. Neuron 45, 193–200 (2005).

    CAS  Article  Google Scholar 

  34. 34.

    Billeter, J. & Levine, J. D. The role of cVA and the odorant binding protein Lush in social and sexial behavior in Drosophila melanogaster. Front. Ecol. Evolution 3, 75 (2015).

    Article  Google Scholar 

  35. 35.

    Schneider, J., Dickinson, M. H. & Levine, J. D. Social structures depend on innate determinants and chemosensory processing in Drosophila. Proc. Natl Acad. Sci. USA 109, 17174–17179 (2012).

    CAS  Article  Google Scholar 

  36. 36.

    Bentzur, A. et al. Soc. Interact. Netw. Struct. groups Drosoph. are shaped prior. Soc. experience group composition. Preprint at https://doi.org/10.1101/2020.03.19.995837 (2020).

    Article  Google Scholar 

  37. 37.

    Camazine, S. Self-organization in biological systems. (Princeton University Press, 2003).

  38. 38.

    Pettit, B., Perna, D., Biro, D. & Sumpter, J. Interaction rules underlying group decisions in homing pigeons. J. R. Soc. 10, 20130529 (2013).

    Article  Google Scholar 

  39. 39.

    Morgan, M. J. The influence of hunger, shoal size and predator presence on foraging in bluntnose minnows. Anim. Behav. 36, 1317–1322 (1988).

    Article  Google Scholar 

  40. 40.

    Gordon, D. M., Paul, R. E. & Thorpe, K. What is the function of encounter patterns in ant colonies? Anim. Behav. 45, 1083–1100 (1993).

    Article  Google Scholar 

  41. 41.

    Jezovit J., Rooke R., Schneider J. & Levine J. Behavioural and environmental contributions to Drosophilid social networks, Proc Natl Acad Sci USA. https://doi.org/10.1073/pnas.1920642117 (2020).

Download references


The authors wish to thank Jacob Jezovit, Ina Anreiter and Joshua Krupp for their insightful comments and Seamus Gearin for help with making some figures. These studies were funded by grants to J.D.L. from NSERC, CIHR, CRC and CIFAR.

Author information




R.R. helped design the experiments, analyzed the experiments and wrote the manuscript. A.R. performed the behavioural experiments. J.S. provided computational scripts and statistical insights. J.D.L., A.R. and J.S. helped design the experiments and edit the manuscript.

Corresponding author

Correspondence to Joel D. Levine.

Ethics declarations

Competing interests

The authors declare no competing interests.

Additional information

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

Supplementary information

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Rooke, R., Rasool, A., Schneider, J. et al. Drosophila melanogaster behaviour changes in different social environments based on group size and density. Commun Biol 3, 304 (2020). https://doi.org/10.1038/s42003-020-1024-z

Download citation

Further reading


By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.


Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing