Layered roles of fruitless isoforms in specification and function of male aggression-promoting neurons in Drosophila

Inter-male aggressive behavior is a prominent sexually dimorphic behavior. Neural circuits that underlie aggressive behavior are therefore likely under the control of sex-determining genes. However, the neurogenetic mechanism that generates sex-specific aggressive behavior remains largely unknown. Here, we found that a neuronal class specified by one of the Drosophila sex determining genes, fruitless (fru), belongs to the neural circuit that generates male-type aggressive behavior. This neuronal class can promote aggressive behavior independent of another sex determining gene, doublesex (dsx), although dsx is involved in ensuring that aggressive behavior is performed only toward males. We also found that three fru isoforms with different DNA binding domains show a division of labor on male aggressive behaviors. A dominant role of fru in specifying sex-specific aggressive behavior may underscore a genetic mechanism that allows male-type aggressive behavior to evolve at least partially independently from courtship behavior, which is under different selective pressures.


Introduction
Aggression is widely observed across animal species, especially in the context of reproductive activities (Huntingford and Turner, 1987). It is mostly males that perform agonistic behaviors, which are often ritualized, to gain access to mating partners. Some species have even developed male-specific weaponry organs to gain advantage (Rico-Guevara and Hurme, 2018). Although these inter-male aggressive behaviors must have evolved to increase fitness, the effect on sexual selection is likely indirect. Unlike courtship behavior, which is selected directly through female preference, females can choose only the end result of inter-male contest and not the aggressive behavior itself. Another distinction of aggressive behavior from courtship behavior is that it can be exhibited by both males and females, but the motor programs are often sexually dimorphic (Hashikawa et al., 2018;Nilsen et al., 2004). Moreover, males are aggressive almost exclusively towards other conspecific males, and not towards females. In other words, aggressive behavior is sexually dimorphic, and its execution is strongly influenced by the sex of the target animal.
The sexually dimorphic nature of aggressive behavior predicts the existence of sexually dimorphic neuronal circuits that support this behavior. Both in mice and flies, mutations in genes with sexually dimorphic expression patterns, including sex-determining genes or steroid sex hormone receptors, can alter aggressive behaviors (Juntti et al., 2010;Ogawa et al., 2000;Vrontou et al., 2006;Wu et al., 2009;Xu et al., 2012). Neurons expressing sex-determining genes also influence aggressive behaviors (Asahina et al., 2014;Chan and Kravitz, 2007;Deutsch et al., 2020;Hashikawa et al., 2017;Hoopfer et al., 2015;Koganezawa et al., 2016;Lee et al., 2014;Palavicino-Maggio et al., 2019;Yang et al., 2013), which is consistent with the above prediction that male-type aggression and female-type aggression may be generated through distinct neural circuits. However, sexual dimorphisms within neurons or circuits that are causally responsible for the generation of sexually dimorphic behavior remain unclear. The genetic and neuronal mechanisms which ensure a male only executes aggressive behaviors towards a male target is not well understood either. Although sex-specific sensory cues seem to play critical roles for both mice (Chamero et al., 2007;Hattori et al., 2016;Stowers et al., 2002) and flies (Fernández et al., 2010;Wang and Anderson, 2010), how the sensory information affects the operation of circuits that generate sexually dimorphic aggressive actions is largely uncharacterized.
Sexual dimorphism of aggressive behavior in the common fruit fly Drosophila melanogaster has been well documented. Males perform aggressive behaviors almost exclusively to one another with a higher intensity than inter-female aggressive behaviors (Chen et al., 2002;Nilsen et al., 2004;Vrontou et al., 2006). Attack actions are also dimorphic: a male fly often perform lunges, in which it raises its front legs and pounces down toward a target fly (Chen et al., 2002;Dow and von Schilcher, 1975;Hoyer et al., 2008;Jacobs, 1960), whereas a female fly performs headbutts, in which it quickly moves its body horizontally and hits a target with its head (Nilsen et al., 2004;Ueda and Kidokoro, 2002). Sex of Drosophila is determined by two genes that encode transcription factors, doublesex (dsx) and fruitless (fru). These two genes undergo sex-specific splicing to produce male-specific (dsxM, fruM) and female-specific (dsxF, fruF) transcripts (Yamamoto and Koganezawa, 2013). fru further undergoes another round of alternative splicing among at least 3 different zing finger DNA binding domains (Usui-Aoki et al., 2000). dsx and fru collectively specify anatomical and behavioral sexual dimorphisms (Marín and Baker, 1998;Yamamoto and Koganezawa, 2013). In Drosophila, several classes of sexually dimorphic neurons, which express dsx or fru (or both), are implicated in aggressive behaviors (Asahina et al., 2014;Chan and Kravitz, 2007;Deutsch et al., 2020;Hoopfer et al., 2015;Koganezawa et al., 2016;Palavicino-Maggio et al., 2019). An outstanding question is which of these neurons are critical for the execution of male-type or femaletype aggressive behaviors. Results we present in Ishii et al. (2020) support the hypothesis that dsx specifies an execution mechanism for male courtship behavior, while fru specifies neural circuits underlying sexually dimorphic aggressive actions (Vrontou et al., 2006). Currently, however, it remains unclear which, if any, of the fru-expressing neurons constitutes the execution mechanism for male-type aggressive behavior.
Here, we characterized Tk-GAL4 FruM neurons (Asahina et al., 2014) as a part of a fruM-dependent neural circuit that generates male-type aggressive behavior. Tk-GAL4 FruM neurons are fruexpressing, male-specific neurons that are not only capable of promoting male-type aggressive behavior, but also are necessary for spontaneous male aggression (Asahina et al., 2014). We first found that Tk-GAL4 FruM neurons are specified solely by fru. We then demonstrated that the activation of Tk-GAL4 FruM neurons elicited male-type aggressive behaviors irrespective of dsx genotype. However, dsx has a role in refining the application specificity of male-type aggressive behaviors toward a male target fly. We also characterized the impact of different fru isoforms on male aggression. We found that only one of the three fru isoforms is necessary for the specification of Tk-GAL4 F-ruM neurons, while another isoform is necessary to perform spontaneous aggressive behaviors. The dominant role of fru in specifying the circuit for executing sex-specific aggressive behavior is in contrast to the importance of dsx for the execution mechanism for courtship behavior. The distinct roles of dsx and fru on the specification of courtship-and aggression-controlling neurons can be the genetic basis underlying evolution of beneficial behaviors for inter-male contests while preserving species-specificity for courtship behavior.

Results fruM specifies aggression-promoting Tk-GAL4 FruM neurons
Tk-GAL4 FruM neurons are male-specific fru-expressing neurons that not only promote male-type aggressive behavior upon activation, but also are necessary for normal levels of male aggression (Asahina et al., 2014). We first characterized the behavioral impact of optogenetic activation of these neurons in the presence of male or female target flies ( Figure 1A), because sex of the target fly can be an important biological variable in determining the function of social behavior-controlling   , lunges (C 2 , D 2 ), and wing extensions (C 3 , D 3 ) by the tester flies during the time windows 1-4 (see B). Their genotypes and pair numbers are indicated below the plots. Gray lines represent single testers. Target flies are either group-housed wild-type males (C) or mated females (D). In gray: **p<0.01, *p<0.05, n.s. p>0.05 (Kruskal-Wallis one-way ANOVA and post-hoc Wilcoxon signed rank test). In black: **p<0.01, n.s. p>0.05 (Kruskal-Wallis one-way ANOVA and post-hoc Mann-Whitney U-test). (E) Schematics of the sex-determination pathway in Drosophila. (F) Schematic of the four sex genotypes defined by dsx and fru splicing. (G-J) Expression of CsChrimson:tdTomato under the control of Tk-GAL4 1 and Otd-nls:FLPo (red in G 1 -J 1 ), black in G 2,3 -J 2,3 ) in brains of a male (G), fruM female (H), fruF male (I), and female (J) flies is visualized together with a neuropil marker BRP (blue) by immunohistochemistry. Traced Tk-GAL4 FruM neurons in a male (G 3 ) and a fruM female (H 3 ) are shown in white. Circle: soma (right cluster is enlarged in G 4 and H 4 ). Scale bar: 100 mm (G 1 -J 1 ), 10 mm (G 4 , H 4 ). (K) Mean number of cell bodies per hemibrain visualized by anti-DsRed antibody in each genotype represented in G-J) and Figure 1-figure supplement 2J-M. Error bars: S.D. Genotypes and number of hemibrains examined are indicated to the left. Lowercase letters denote significance group (p<0.01, one-way ANOVA with post-hoc Tukey's honestly significant difference test). Figure 1 continued on next page neurons. We quantified the time in which a tester fly orients toward a target fly, number of lunges, and duration of unilateral wing extensions (shorthanded as 'wing extension' hereafter) using automated behavior classifiers before, during, and after the optogenetic stimulation of Tk-GAL4 FruM neurons with programmed LEDs ( Figure 1B; see also Materials and methods).
The tester flies in which CsChrimson was expressed under the control of Tk-GAL4 1 within the brain (which phenocopies the manipulation of Tk-GAL4 FruM neurons; Asahina et al., 2014) showed robust aggression toward the target male flies, mainly during LED stimulation (Figure 1  ; see also Video 1 -Part 2), suggesting that the activation of Tk-GAL4 FruM neurons can promote interaction regardless of the sex of the target fly. Neither did we observe lunges when Tk-GAL4 1 -labeled neurons were optogenetically activated in the absence of any target fly (Figure 1-figure supplement 1D). Thus, the activation of Tk-GAL4 FruM neurons induces lunges strictly when a male target fly is present. In addition, we observed that tester flies performed less wing extensions toward target females during LED stimulation than during ISIs ( Figure 1D 3 ). However, the total amount of wing extensions was not significantly different from those of the two genetic controls. These phenotypes are largely consistent with those observed when Tk-GAL4 FruM neurons were thermogenetically activated (Asahina et al., 2014), and reinforces the idea that the sex of the target fly impacts the behavioral outcome of manipulations of Tk-GAL4 FruM neuronal activity. As was previously shown (Asahina et al., 2014), Tk-GAL4 FruM neurons are specified only in males ( Figure 1G,J). We next addressed the role of dsx and fru (Figure 1-figure supplement 2A) on specifying Tk-GAL4 FruM neurons. Two splicing mutations for fru, fru M and fru F (Demir and Dickson, 2005), forces male-type (fruM) and female-type (fruF) splicing of fru transcripts irrespective of the chromosomal sex composition, which normally determines the sexdetermination genetic cascade. As a result, these mutations allowed us to create 'fruF males' (expressing dsxM and fruF) and 'fruM females' (expressing dsxF and fruM), thus dissociating contributions of dsx and fru on sexual  -nls: FLPo (black) in the standard Drosophila brain (gray in L 1 , (M 1 ). Number of used hemibrains are indicated in L 2 , M 2 . N-P: Volumes of medial projection (N), anterior projection (O), and lateral projection (P) of Tk-GAL4 FruM neurons in males with genotypes indicated below. Their genotypes and pair numbers are indicated below the plots. n.s. p>0.05 (Kruskal-Wallis one-way ANOVA). The online version of this article includes the following figure supplement(s) for figure 1:  Video 1. Representative behavior of a male tester fly that expresses CsChrimson:tdTomato under the control of Tk-GAL4 1 and Otd-nls:FLPo toward a wild-type male (Part 1) or a wild-type female (Part 2) target fly, at the onset and offset of LED stimulation. In Part 2, the tester male was not actively performing any behavior toward the target female when the LED turned on. https://elifesciences.org/articles/52702#video1 dimorphism at the organismal level ( Figure 1-figure supplement 2B). fruM females are reported to show lunges and other male-type aggressive actions (Vrontou et al., 2006), suggesting that fru is the chief architect of neural circuits underlying sexually dimorphism in aggressive behavior. However, two fru-expressing, aggression-promoting neurons (male-type NP2631 T dsx FLP neurons (Koganezawa et al., 2016) and P1 a neurons Hoopfer et al., 2015) are not specified in this genotype (see Ishii et al., 2020). These observations strongly suggest that not all fru-expressing neurons underlie the sexual dimorphism of aggressive actions, even if the activation of such neurons in a normal male induces male-type aggressive behavior. Other neuronal populations specified by fru, but not dsx, must constitute a neural substrate for the execution mechanism for male-type aggression.
In contrast to male-type NP2631 T dsx FLP neurons or P1 a neurons, Tk-GAL4 FruM neurons were present in fruM females ( Figure 1H), but not in fruF males ( Figure 1I). Consistent with this observation, we detected expression of FruM, but not Dsx, proteins in Tk-GAL4 FruM neurons (Figure 1-figure supplement 2C,D). The cell body number of Tk-GAL4 FruM neurons in fruM females was indistinguishable from that in males ( Figure 1K). To compare Tk-GAL4 FruM neuronal morphology in males and fruM females, we first traced Tk-GAL4 FruM neurons using a volume visualization software FluoRender (see Materials and methods for details). The distinct neuronal processes of Tk-GAL4 FruM neurons allowed us to segment them in an unambiguous manner ( Figure 1G 3 , H 3 ). We then registered the original and segmented confocal images of brains to a unisex standard brain (Bogovic et al., 2018) using non-rigid spatial transformation (Jefferis et al., 2007).  Figure 1L) and from fruM females ( Figure 1M) appeared virtually identical (Video 3). To confirm this initial observation, we further segmented three prominent neurites that emanate from the lateral junction  of Tk-GAL4 FruM neurons ( Figure 1L 2 , M 2 ). None of these three processes showed significant difference in volume among fru +/+ control males, fru M /fru 4-40 males, and fruM females ( Figure 1N-P). While we acknowledge that this approach might miss finer scale differences in neuroanatomy, we conclude that Tk-GAL4 FruM neurons are specified predominantly by fru. dsx and fru therefore have clearly separable roles for the specification of neuronal populations that are important for Drosophila aggressive behaviors.
Presence of the fru 4-40 allele did not affect cell number or overall morphology of Tk-GAL4 FruM neurons ( Figure 1K . We also found that fru FLP , a knock-in allele of fru that expresses a DNA recombinase Flippase , is hypomorphic ( Figure 1-figure supplement 3D,E), raising the necessity to use caution when attempting to transform Drosophila sex by manipulating the fru locus.
Tk-GAL4 FruM neurons are a part of a fruM-dependent circuit for the execution of male-type aggressive behavior We next investigated the function of Tk-GAL4 F-ruM neurons in fruM females. Specifically, we wished to obtain insights into the sex recognition mechanism and execution mechanism in the context of aggression. Unfortunately, male 'target' flies often perform vigorous courtship toward female tester flies (Figure 2-figure supplement 1B), which interferes with tester females' social behavior (namely headbutts) towards target males (Figure 2-figure Video 2. 3D-rendered average image of segmented and registered Tk-GAL4 FruM neurons (green) and registered Tk-GAL4 FruM neurons that are genetically isolated (blue). Gray represents the standard unisex Drosophila brain (Bogovic et al., 2018). https://elifesciences.org/articles/52702#video2 supplement 1A; Vrontou et al., 2006). Following a previous study (Vrontou et al., 2006), we used group-housed fruF males (which are defective at enhancing courtship toward females; Demir and Dickson, 2005;Pan and Baker, 2014;Villella et al., 1997; Figure 2-figure supplement 1B) instead of wild-type male flies as targets when using anatomically female (dsxF) flies as testers.
Optogenetic activation of the Tk-GAL4 1 -labeled neurons in fruM females induced lunges toward a fruF male target for the majority of testers ( (Figure 2A 3 ). This indicates that Tk-GAL4 F-ruM neurons are part of a fruM-dependent, but dsx-independent, neuronal circuit for male-type aggressive behavior. The motion sequence underlying the lunges observed in this genotype were indistinguishable from wild-type male lunges (Video 5).
However, we noted two differences compared to the same manipulation in male flies. First, lunges were not induced in fruM females as consistently as in males. Forty-two percent (17/40) of fruM females did not perform a single lunge after LED stimulation ( Figure 2C). In contrast, over 96% of male testers lunged toward a male target ( Figure 2C). The median of induced lunges observed in fruM females (2) was lower than observed for male testers (58). Second, fruM females occasionally lunged toward a female target (Video 4 -Part 2), in addition to a fruF male target. Even though lunges were induced even less frequently than toward fruF males ( Figure 2C). We noticed that headbutts performed by the female target toward these testers often outnumbered the lunges performed by the tester toward the target (Figure 2-figure supplement 3B). This was not the case when the target flies were fruF males ( Figure 2-figure supplement 3A). These counterattacks by female targets may have contributed to the lower number of lunges toward female targets than toward fruF male targets.
We asked whether social isolation, which elevates levels of aggression in males (Hoffmann, 1990;Wang et al., 2008), could enhance the induction of lunges. Interestingly, optogenetic activation of Tk-GAL4 1 -labeled neurons in single-housed fruM females failed to induce a single lunge toward fruF male targets ( . These data suggest that the relatively high levels of courtship behavior seen in fruM females interferes with the aggression-promoting function of Tk-GAL4 FruM neurons. Consistent with this idea, group-housed fruM females that did not lunge toward a target fly after optogenetic stimulation of Tk-GAL4 1 -labeled neurons tended to show higher levels of wing extensions than testers who lunged (Figure 2-figure supplement 3E, F 1 ). Lastly, optogenetic activation of Tk-GAL4 FruM neurons did not induce headbutts (Figure 2-figure supplement 2A3, B 3 ), confirming that this genotype is using a male-type aggressive action exclusively (Vrontou et al., 2006).
Overall, the results above delineate complementary roles of dsx and fru on male aggressive behavior. The activation of Tk-GAL4 FruM neurons induces lunges even in the absence of dsx-dependent aggression-promoting neurons. Tk-GAL4 FruM neurons are therefore part of a fruM-dependent execution mechanism for male aggressive behavior ( Figure 2D). However, the reduced intensity and compromised target sex selectivity of lunges shown by fruM females suggest that a dsx-dependent mechanism may play a role in establishing a target sex-selective application of aggressive behavior. This mechanism can inhibit the execution of lunges specifically toward females, which ensures that lunges are performed exclusively by males towards other males ( Figure 2D), or can enhance aggression specifically toward male targets indirectly by inhibiting courtship toward them.

Female-type NP2631
T dsx FLP neurons in fruM females do not promote aggression Having established that Tk-GAL4 FruM neurons can trigger lunges independent of dsx splicing pattern, we wondered whether other sexually dimorphic neurons are involved in the execution of maletype aggressive behaviors in the fruM female brain. One candidate was the NP2631 T dsx FLP neuron group, which was reported to promote aggressive behaviors in both males and females (Koganezawa et al., 2016).
As was discussed above, dsx specifies the sexual dimorphism of NP2631 T dsx FLP neurons, such that the morphology of these neurons in fruM females is largely female-type, and not male-type ( Figure 3A; see also Ishii et al., 2020). We confirmed that optogenetic activation of NP2631 T dsx FLP neurons in females robustly increased time orienting ( ; see also Video 6 -Part 2). Aggression-promoting neurons that belong to the dsxexpressing 'pC1' cluster have been also characterized in the female brain by using different genetic reagents (Deutsch et al., 2020;Palavicino-Maggio et al., 2019). Whether these neurons and the NP2631 T dsx FLP neurons we manipulated belong to the same subtypes remains undetermined. However, we found that NP2631 T dsx FLP neurons did not overlap with neurons labeled by the R71G01-LexA transgene (Figure 3-figure supplement 1D,E). This is consistent with recent findings that female 'pC1' neurons are anatomically and functionally heterogeneous (Deutsch et al., 2020;Wang et al., 2020;Wu et al., 2019).
The aggression-promoting function of NP2631 T dsx FLP neurons raises an intriguing question: do female-type NP2631 T dsx FLP neurons promote aggression in fruM females, and if so, are male-type or female-type aggressive behaviors induced ( Figure 3A)? If fruM's role in defining sexual dimorphism in aggression prevails, activation of NP2631 T dsx FLP neurons in fruM may promote maletype aggression (lunges) even though these neurons exhibit female-type morphology. If the morphology of NP2631 T dsx FLP neurons dictates the sexual dimorphic action of aggressive behavior, the same manipulation may promote female-type aggressive actions (headbutts).
Interestingly, we did not observe induction of either lunges or headbutts ( Figure 3D2 and E 2,3 ) when we optogenetically activated the NP2631 T dsx FLP neurons in fruM females. Thus, female-type NP2631 T dsx FLP neurons can promote headbutts only if other mechanisms that rely on sexually dimorphic splicing of fru are present in the brain. In addition, this result suggests that NP2631 T dsx FLP neurons with female-like morphology fail to establish functional connections with neurons that are part of the fruM-dependent execution mechanism for male-type aggression (which includes Tk-GAL4 FruM neurons; Figure 3A). We therefore conclude that female-like NP2631 T dsx FLP neurons cannot participate in generation of aggressive behavior (e.g. headbutts) without separate populations of neurons that are specified in the absence of fruM. This finding raises a possibility that the sexual dimorphism of NP2631 T dsx FLP neurons, which is largely specified by dsx, does not determine the sexual dimorphism of aggressive actions. It is also possible that activities of both dsx and fru may be required for the complete functional transformation of NP2631 T dsx FLP neurons. As is shown in Ishii et al. (2020), maletype NP2631 T dsx FLP neurons cannot trigger lunges without a fruM-dependent mechanism, underscoring the dominant role of fru and fru-dependent neural circuits in specifying sexually dimorphic action patterns during aggressive interactions.
Differential roles of fru isoforms on male-male interactions and specification of Tk-GAL4 FruM neurons fruM undergoes another layer of alternative splicing to create three transcript isoforms, fruMA, fruMB, and fruMC, ( Figure 4A), which encode different zinc finger domains (Usui-Aoki et al., 2000). The loss of each of three fruM isoforms is known to affect male courtship behaviors in distinct manners von Philipsborn et al., 2014; Figure 4-figure supplement 1A,B). After finding that fruM is important for specification of Tk-GAL4 FruM neurons, as well as for its capacity to Video 3. 3D-rendered average image of registered Tk-GAL4 FruM neurons in male (green) and in fruM female (blue). Gray represents the standard unisex Drosophila brain (Bogovic et al., 2018).    Figure 1B). Their genotypes and pair numbers are indicated below the plots. Gray lines represent single testers. Target flies are either group-housed fruF males (A) or wild-type mated females (B). In gray: **p<0.01, *p<0.05, n.s. Figure 2 continued on next page execute male-type aggressive actions, we next addressed whether different isoforms of fruM have distinct roles for the specification and function of Tk-GAL4 FruM neurons. First, we characterized how isoform-specific mutations affect spontaneous male-type aggressive behavior after social isolation (Hoffmann, 1990;Wang et al., 2008). In parallel with their previously characterized differential effects on courtship von Philipsborn et al., 2014), we found defects of male aggressive behavior in isoform-specific mutants. Loss of fruMA caused no reduction of lunges compared to the fru 4-40 heterozygous genetic control ( Figure 4B 2 ). In contrast, we observed a dramatic reduction in male-type aggressive behaviors by the loss of fruMB or fruMC isoforms ( Figure 4B 2 ). While fruMC mutants showed decreased orientation time toward a male target, orienting times of fruMA and fruMB mutants were comparable to the fru 4-40 heterozygous genetic control ( Figure 4A 1 ). This reduction in lunges in fruMB mutants was qualitatively recapitulated when the fru F allele was used to create trans-heterozygotes ( Figure  . These data indicate that each of the three fruM isoforms make different contributions to aggressive behaviors. fruMA had a minimal impact on male aggressive behavior, whereas fruMB and fruMC were both necessary to maintain normal levels of male aggression. Moreover, the decreased aggression of fruMB mutants was not necessarily due to reduced activity levels or opportunities to interact with the target fly. We next asked how each of the three fruM isoforms contributes to the specification of Tk-GAL4 FruM neurons. In fruMC mutants, we found only 1.9 ± 1.1 (mean ± S.D., n = 8; Figure 5D,E) faintly labeled neurons in the brain area where Tk-GAL4 FruM neurons are expected to appear, significantly fewer than the number of cells found in genetic controls (5.6 ± 0.5, mean ± S.D., n = 8; Figure 5A,E). Weak staining of the Tk-GAL4 FruM neurons in the fruMC mutants prevented us from visualizing their branching pattern. In contrast, fruMA and fruMB mutants did not affect the number of Tk-GAL4 FruM neurons ( Figure 5E). We compared the neuroanatomy of Tk-GAL4 FruM neurons in these genotypes by registering immunohistochemically labeled brains on a standard brain. Tk-GAL4 FruM neurons from p>0.05 (Kruskal-Wallis one-way ANOVA and post-hoc Wilcoxon signed rank test). In black: **p<0.01, *p<0.05, n.s. p>0.05 (Kruskal-Wallis one-way ANOVA and post-hoc Mann-Whitney U-test). (C) Ratio of male (dataset from Figure 1C, D) and fruM female (dataset from A), (B) tester flies that lunged toward each of the two target sexes (above) in the time window 4. Testers' genotypes and pair numbers are indicated below the plots. **p<0.01, n.s. p>0.05 (Fisher's exact test, two genetic controls are pooled). (D) Schematic summary of the roles of sexdetermining genes for Tk-GAL4 FruM neurons and male-type aggressive behavior. The online version of this article includes the following figure supplement(s) for figure 2:   Video 4. Representative behavior of a fruM female tester fly that expresses CsChrimson:tdTomato under the control of Tk-GAL4 1 and Otd-nls:FLPo toward a fruF male (Part 1) or a wild-type female (Part 2) target fly, at the onset and offset of LED stimulation.
https://elifesciences.org/articles/52702#video4 fruMA ( Figure 5G) or fruMB ( Figure 5H) mutants are indistinguishable from each other or from fru 4-40 heterozygous control males ( Figure 5F; see also Video 7). We measured the volumes of three prominent neurites that emanate from the lateral junction   Taken together, we found that fruMA, fruMB and fruMC have distinct effects on male aggression and specification of the Tk-GAL4 FruM neurons. fruMA appeared largely dispensable for both, whereas fruMC was necessary for both. Interestingly, fruMB was necessary for normal levels of male-male aggression, but was not required for specification of the Tk-GAL4 FruM neurons.

The Tk-GAL4 FruM neurons in fruMB mutants can induce male aggression
While the reduction of male aggression in fruMC mutants can be explained by defects in specification of the Tk-GAL4 FruM neurons, which are necessary for normal levels of aggression (Asahina et al., 2014), this same logic does not apply for the fruMB mutants, since these mutants have Tk-GAL4 FruM neurons that appear to retain their morphology. One possible explanation is that the Tk-GAL4 FruM neurons in fruMB mutants have neurophysiological defects and are no longer functional. To address this, we quantified the excitability of Tk-GAL4 FruM neurons in fruMB mutants by measuring their intracellular calcium response while optogenetically stimulating them ( Figure 6A,B). The overall calcium response dynamics and magnitudes of Tk-GAL4 FruM neurons in fruMB mutants were comparable to those seen in the fru 4-40 heterozygous controls ( Figure 6C,D), suggesting that Tk-GAL4 FruM neurons in fruMB mutants are capable of physiologically responding to depolarizing stimuli.
Even though Tk-GAL4 FruM neurons exhibited normal excitability, it remains possible that neural circuits downstream of the Tk-GAL4 FruM do not respond to inputs from Tk-GAL4 FruM neurons in fruMB mutants, due to altered development or physiology of these downstream circuits, or inability of Tk-GAL4 FruM neurons to excite downstream neurons. To address this possibility, we optogenetically activated Tk-GAL4 1 -labeled neurons in fruMA, fruMB, or fruMC mutants. Optogenetic activation of Tk-GAL4 1 -labeled neurons in fruMB mutants elicited robust levels of male aggression across several LED intensities, as seen in genetic controls ( Figure 6E-G, Figure 6-figure supplement 1A-C). This result suggests that Tk-GAL4 FruM neurons in fruMB mutants, once activated, can induce male aggression as efficiently as in the fru wild-type males, and argues against the hypothesis that the mutation of fruMB proteins causes defective development of downstream neurons or reduced efficiency of Tk-GAL4 FruM neurons to excite downstream neurons. Instead, these results favor the alternative hypothesis that fruMB mutation reduces aggression-promoting input to Tk-GAL4 FruM neurons from upstream circuits. This is likely mediated through fruM-dependent mechanisms as well, since activation of Tk-GAL4 FruM neurons can completely overcome the lack of such input.
Overall, our results show that three isoforms of fruM assume distinct roles in the specification and function of sexually dimorphic neurons that control male-type aggressive behaviors ( Figure 6H). Namely, fruMC is necessary for the specification of Tk-GAL4 FruM neurons, whereas fruMB is necessary for a normal level of spontaneous aggression.

Discussion
In this study, we identified Tk-GAL4 FruM neurons as part of a fruM-dependent execution mechanism for male-type aggression. The exclusive role of fruM on the specification of a neural circuit for the execution of male-type aggression is in contrast to the circuit for the execution of male-type courtship behavior, for which dsx plays a major role (see Ishii et al., 2020). One role of dsx on male-type aggression appears to be to prevent inappropriate aggression toward a female target, which suggests that dsx may be involved in the sex-recognition mechanism in the context of agonistic interactions. Furthermore, we found that each of three fruM isoforms play separable roles on male-type aggressive behavior. Our finding reveals a layered genetic mechanism of the fru gene for the specification and function of a sexually dimorphic aggression-controlling circuit, which may provide a genetic substrate for the male-specific evolution of contest rituals.
fru specifies a neural circuit for sexually dimorphic aggressive actions We found that the optogenetic activation of Tk-GAL4 FruM neurons in fruM female tester flies induced male-type aggressive behavior. This result indicates that at least Tk-GAL4 FruM neurons and downstream populations form a neural circuit that is sufficient for the execution of male-type aggressive behavior. While this does not necessarily mean that fruF males or females lack the capability to execute male-type aggressive behavior, there has been no report that these two sex genotypes perform lunges spontaneously (Vrontou et al., 2006). Moreover, female-type NP2631 T dsx FLP neurons fail to promote aggressive behaviors (lunges or headbutts) in fruM females. NP2631 T dsx FLP neurons were previously proposed to be the 'aggression output' of a switch circuit that selects between courtship and aggression (Koganezawa et al., 2016). Since stimulation of NP2631 T dsx FLP neurons in fruF males did not trigger lunges (see Ishii et al., 2020), at least sexual dimorphism in the neuroanatomy of NP2631 T dsx FLP neurons does not correlate with the sexual dimorphism in aggressive motor programs. These observations favor a hypothesis that neurons specified by fru, which include Tk-GAL4 FruM neurons, form the execution mechanism for male-type aggressive action, and NP2631 T dsx FLP neurons serve as modulatory neurons that act on this fru-dependent execution mechanism. Sex-specific splicing of fru defines what type of aggressive behavior an animal performs, likely by specifying a mutually exclusive neural circuit that generates either male-type or female-type aggressive actions.
The definitive role of fru in specifying the execution mechanism for aggression does not mean that dsx is irrelevant. In fact, fruM females lunge against females as well as fruF males, suggesting that dsx is important for suppressing inappropriate aggressive behavior toward a female target. Currently, we do not know whether it is the  Figure 1B). Their genotypes and pair numbers are indicated below the plots. Gray lines represent single testers. Target flies are either group-housed fruF males (B, D) or mated females (C, E). In gray: **p<0.01, n.s. p>0.05 (Kruskal-Wallis one-way ANOVA and post-hoc Wilcoxon signed rank test), In black: **p<0.01, *p<0.05, n.s. p>0.05 (Kruskal-Wallis one-way ANOVA and post-hoc Mann-Whitney U-test). The online version of this article includes the following figure supplement(s) for figure 3:

Figure supplement 1. Behaviors induced by optogenetic activation of NP2631
T dsx FLP neurons in females.
Video 6. Representative behavior of a female tester fly that expresses CsChrimson:tdTomato under the control of NP2631 and dsx FLP toward a wild-type female (Part 1) or a fruF male (Part 2) target fly, at the onset and offset of LED stimulation.
https://elifesciences.org/articles/52702#video6 presence of dsxM, or the absence of dsxF, that is critical. Intriguingly, however, dsx-expressing neurons respond to sex-specific sensory cues, such as olfactory, gustatory, and auditory stimuli (Deutsch et al., 2019;Zhou et al., 2014;Zhou et al., 2015). Since thermogenetic activation of Tk-GAL4 FruM neurons induces lunges toward a male target that lacks cuticular hydrocarbons (Asahina et al., 2014), one possible scenario is that a dsx-dependent circuit is responsible for detection or transmission of female-specific, aggression-suppressing cues that have yet to be identified. Alternatively, dsx in males may allow execution of male-type aggressive behavior specifically toward male targets indirectly by inhibiting courtship behavior toward males. fruM females that showed high levels of courtship behavior generally showed low levels of male-type aggression. This observation suggests that courtship behavior can interfere with aggressive behavior, possibly through feedforward inhibitory circuits (Clowney et al., 2015;Kallman et al., 2015;Koganezawa et al., 2016).
Regardless of the mechanism, our results uncover distinct roles of dsx and fru on male-type aggressive behavior. The contribution of dsx on the target sex-selective execution of aggressive behavior also implies that information about target sex can be supplied downstream of Tk-GAL4 FruM neuronal activities and modify its behavioral influence. Currently, it remains unclear how the stimulation of Tk-GAL4 FruM neurons is transformed into lunges, because the downstream partners of Tk-GAL4 FruM neurons have not been characterized yet. It is possible that dsx-specified neurons serve as a 'block' against neuronal activity generated by Tk-GAL4 FruM neurons and other unidentified constituents of the lunge execution mechanism. Since fru-expressing neurons have been comprehensively characterized in the male brain (Cachero et al., 2010;Yu et al., 2010), it may be necessary to establish an equally detailed catalog of dsx-expressing neurons for uncovering the neural mechanism by which male-type aggressive behavior is controlled in a target sex-dependent manner.
The neuronal population that supports execution of female-type aggressive behaviors has begun to be characterized only recently. Consistent with a previous observation (Koganezawa et al., 2016), we observed that NP2631 T dsx FLP neurons in females promote female-type aggression. This population belongs to a cluster of dsx-expressing 'pC1' neurons, which is known to promote a  variety of female social behaviors including aggression (Deutsch et al., 2020;Palavicino-Maggio et al., 2019;Robie et al., 2017), receptivity (Deutsch et al., 2020;Zhou et al., 2014) or even courtship-like behaviors (Rezával et al., 2016;Wu et al., 2019). In spite of the importance of 'pC1' neurons collectively on female social behaviors, female-type NP2631 T dsx FLP neurons are unlikely to be a part of the execution mechanism that generates female-type aggressive actions. Our results suggest that there are uncharacterized sexually dimorphic neurons that are necessary for females to execute headbutts and other female-specific  Video 7. 3D-rendered average image of registered Tk-GAL4 FruM neurons in fru 4-40 heterozygous control male (dark green) and in fruMB mutant (fru DB /fru 4-40 ) male (bright green). Gray represents the standard unisex Drosophila brain (Bogovic et al., 2018). https://elifesciences.org/articles/52702#video7 aggressive actions, likely downstream of female-type NP2631 T dsx FLP neurons. Isoform-specific roles of fru on male-type aggression fru is a complex gene with multiple alternative splicing sites. Male-specific fruM transcripts can encode at least 3 different DNA binding domains (Usui-Aoki et al., 2000). These three isoforms have distinct impacts on gene expression (Dalton et al., 2013;Neville et al., 2014;Vernes, 2015), neuronal specification (Billeter et al., 2006;Ito et al., 2016;Meissner et al., 2016;von Philipsborn et al., 2014), and courtship behavior von Philipsborn et al., 2014), prompting us to address whether these isoforms have differential roles on aggression. Indeed, we found that fruMC is important for the specification of Tk-GAL4 FruM neurons, whereas fruMB is possibly important for perceiving or transmitting relevant sensory cues about male targets to an aggression execution mechanism. Because optogenetic stimulation of Tk-GAL4 FruM neurons in fruMB mutants increases aggression as effectively as the same manipulation in normal males, any role of fruMB on modulating aggression is likely taking place upstream of Tk-GAL4 FruM neurons. In order to understand the role of fruMB on the neural circuits controlling male-type aggression, it will be important to characterize the neural inputs to Tk-GAL4 F-ruM neurons and to identify which of such neurons express fruMB (von Philipsborn et al., 2014).
Our result is in line with the previously reported importance of the fruMC isoform in the development of male-specific branching patterns in several fruM-expressing neurons (Billeter et al., 2006;Ito et al., 2016;von Philipsborn et al., 2014). Among them, activities of 'P1' neurons (von Philipsborn et al., 2014) and mAL/aDT2 neurons (Ito et al., 2016;von Philipsborn et al., 2014) are necessary for normal levels of courtship behavior (Kallman et al., 2015;von Philipsborn et al., 2011), reflecting the severe courtship defects of fruMC mutant males von Philipsborn et al., 2014). Our observation that fruMC is necessary for both male aggression and specification of Tk-GAL4 FruM neurons reveals its importance for male-type aggressive behavior as well, at behavioral and circuitry levels. Using an analogy from the function of steroid hormones in mammals (McCarthy, 2008), fruMC can be regarded as exerting 'organizational' functions, while fruMB may exert 'activation' functions, in the sense that fruMB is dispensable for the specification of a lunge execution mechanism, yet is necessary for induction of spontaneous aggressive behaviors. The additional support of dsx ensures the aggressive behaviors are applied specifically toward male targets.
The segregation of roles within fru isoforms may increase the gene's flexibility: for instance, change in the circuit connectivity underlying perception of male-specific cues can be independently altered if different isoforms have different roles in the aggression circuit. In mice, there are at least 3 different estrogen receptor genes (Wu et al., 2009). Although the specific function of each receptor on neural circuits that control sexual behaviors remains largely uncharacterized, it is tempting to speculate that a similar type of division of labor may exist among the estrogen receptor genes. For both fru and estrogen receptors, the functional characterization of genes which each isoform regulate will be the first important step to understand how the division of labor is implemented at the molecular level.
fru may allow males to evolve male-type aggressive actions without altering courtship motor programs In theory, presence or absence of just one gene can specify two sexes. However, most animal species use multiple genes for sex determination, even if one 'master' switch gene (such as Sex-lethal in Drosophila) may initiate the sex determination process (Robinett et al., 2010;Williams and Carroll, 2009). Our results suggest that one of the reasons behind this apparent genetic cooperativity may be that each gene controls specific aspects of sexually dimorphic traits, including behaviors (Pereira et al., 2019;Xu et al., 2012). We further speculate that separate genetic mechanisms for establishing sexually dimorphic actions and target sex-dependent action bias may be evolutionarily adaptive.
Courtship and aggression are likely under different types of selection pressures. Courtship behavior is executed by a male toward a female, who either rejects or accepts courtship (Hall, 1994). In Ishii et al. (2020), we showed that dsx plays an important role in specifying the male courtship execution circuit. The dsx gene produces functional proteins in both sexes, and mediates specification of not only male-type circuits for courtship but also female-type circuits that make females receptive to such motor programs (Deutsch et al., 2019;Zhou et al., 2014). This dual function of dsx in males and females may ensure that the species-specificity of courtship rituals are preserved between both sexes even during speciation, which must accompany co-evolution of both a male's courtship behavior and a female's choice process through sexual selection (Majerus, 1986). Interestingly, dsxexpressing neurons show high selectivity to courtship pulse song with behaviorally relevant interpulse interval frequencies both in males and females (Deutsch et al., 2019;Zhou et al., 2015).
In contrast, aggressive behavior is executed by sexually dimorphic motor programs often between two members of the same sex, most predominantly among males (Chen et al., 2002;Nilsen et al., 2004;Smith and Price, 1973). Consequently, aggressive actions can be under a different selection pressure from courtship behavior. Ample examples of male-specific weaponry organs across a variety of species support the hypothesis that sexually dimorphic traits that bring advantage specifically during inter-male competition can be fixed through evolution even if it is not directly under sexual selection (Rico-Guevara and Hurme, 2018). This hypothesis suggests that such traits, which can be behavioral as well as anatomical, may evolve independently of courtship behavior.   Indeed, some closely related Hawaiian Drosophila species evolved species-specific aggressive rituals even though action patterns of courtship behavior as well as morphology of antennae, an organ necessary for successful courtship, remain relatively similar (Kaneshiro and Boake, 1987;Price and Boake, 1995;Spieth, 1981). This example suggests that animals must be equipped with a genetic mechanism that controls motor programs for aggressive behavior at least partially separately from the motor programs for courtship behavior. fru is well situated to be a genetic agent for such a male-specific modification of aggressive behavior (Davis et al., 2000), because it seems dispensable for specifying a neural circuit that generates at least certain aspects of courtship action patterns (see Ishii et al., 2020). At the same time, dsx can ensure that males do not act aggressively toward a conspecific female. Female-type somatic characteristics, including sex-specific chemical cues (Shirangi et al., 2009), are specified by dsx. It is possible that dsxM prevents costly male aggression toward females by helping the brain process female-type sensory cues as an aggression-inhibiting signal (Fernández et al., 2010) in a species-specific manner. The origin of sexual dimorphism in social behavior is a fundamental neuroscientific and ethological question. While circuit manipulations offer a powerful approach to dissect the neural mechanisms behind sexually dimorphic behaviors, comparative studies of the neural circuits controlling social behaviors in genetic gynandromorphs can serve as a complementary approach to address this question from both developmental, and possibly evolutionary, perspectives. Although sex-determining genetic pathways are diverse across animal species, studying Drosophila sexual dimorphism can lead to logical predictions about the genetic or neuronal mechanisms underlying sexual dimorphism of social behavior in mammals.

Materials and methods
See Supplementary file 1 for details of reagents used in this study.
For simultaneous detection of DsxM and FruM (Figure 1-figure supplement 2C,D), brains were fixed in 1XPBS with 4% formaldehyde for 15 min at room temperature. Brains were then transferred to a 1.5 mL microtube, in which the remaining steps were carried out.
Z-stack images were acquired by FV-1000 confocal microscopy (Olympus America) except samples for Figure 3-figure supplement 1D, E, which were acquired by a Zeiss 710 confocal microscopy (Carl Zeiss Microscopy) at the Salk Institute Biophotonics Core, and were processed in Fiji software (Schindelin et al., 2012) (RRID:SCR_002285; https://fiji.sc/). The despeckle function was applied before a z-projection image was generated using maximum intensity projection. Minimum or maximum intensity thresholds were adjusted for enhanced clarity. Source image files used in all figures can be found in Source data 1.

Segmentation, registration, and analysis of immunohistochemical samples
All data points for anatomical quantifications used in all figures, as well as all statistical results with exact p values, can be found in Source data 1.
Parametric tests were applied as indicated in figure legends to compare cell body numbers among different genotypes. All data points have biological replicates of at least 8, which has sufficient power to detect mean changes in cell body number of larger than 1.75 when assuming a mean cell body number of 5 and a standard deviation of 1.5 (which is reasonable based on our data). As indicated in figures, genotype-dependent changes in cell body number had a larger effect size than 2 in all cases. For segmentation of Tk-GAL4 FruM neurons, we first visualized each z-stack in a 3D space using a rendering software FluoRender (Wan et al., 2009) (RRID:SCR_014303; https://github.com/SCIInstitute/fluorender). We then chose the channel corresponding to Alexa 568 (which labels CsChrimson: tdTomato immunohistochemistry signal), and traced neural processes emanating from the cell bodies of Tk-GAL4 FruM neurons, which could be identified unambiguously at the lateral side of the brain. The neural processes were then segmented using the Paint Brush function (Wan et al., 2017), and saved as a new. nrrd file.
For registration of brains, we split each channel of a z-stack file and resaved each as an individual. nrrd files in Fiji. We added the newly created. nrrd file that represent Tk-GAL4 FruM neurons (see above) into the same folder, and used the Fiji plugin for Computational Morphometry Toolkit (CMTK) (RRID:SCR_002234; https://www.nitrc.org/projects/cmtk; Rohlfing and Maurer, 2003) to register the brain image stacks to the template brain as described in Jefferis et al. (2007) (https:// github.com/jefferis/fiji-cmtk-gui). Briefly, for each brain, the image of neuropil visualized by anti-BRP antibody was used to transform the z-stack to the template brain, and the same transformation was subsequently applied to additional channels. Registration was performed by using the same parameters implemented in 'Cachero et al. (2010)' (exploration = 26, coarsest = 8, grid spacing = 80, refine = 4, accuracy = 0.4) in CMTK plugin on Fiji. We used JRC2018 INTERSEX (Bogovic et al., 2018) as our template, since we experienced more robust registration result than with the FCWB template brain (Costa et al., 2016) (data not shown).
After the registration of z-stacks, we calculated the average of the images in a hemibrain for each genotype. We did this by horizontally flipping each transformed z-stack images, and calculating the average signal intensity in each voxel. The resulting averaged images are bilaterally symmetrical. Therefore, only the left hemisphere is shown for z-projection images.
To calculate the volumes of specific neuronal structures within Tk-GAL4 FruM neurons, we further segmented the target structures using the Paint Brush function of FluoRender, and calculated the volume of each structure using the Volume Size function. Statistical analyses were carried out using MATLAB (The Mathworks, Inc, RRID:SCR_001622). The Kruskal-Wallis test ('kruskalwallis') was used to evaluate whether a volume of the given structure was significantly different among different genotypes. When the p-value was below 0.05, the post-hoc the Mann-Whitney U-test ('ranksum') was used to detect significant differences between testing and control genotypes. In both cases, Bonferroni correction was applied to p values. Non-parametric tests were applied for volume data since we could not necessarily assume the normal distribution of this data type.

Social behavior analysis Subject preparation
Flies were collected on the day of eclosion into vials containing standard cornmeal-based food, and were kept either as a group of up to 16 flies per vial, or singly at 25˚C with 60% relative humidity, and a 9AM:9PM light:dark cycle. For optogenetic experiments, the tester flies were reared on food containing 0.2 mM all-trans retinal (MilliporeSigma, Cat#R2500, 20 mM stock solution prepared in 95% ethanol), and vials were covered with aluminum foil to shield light. Every 3 days, flies were transferred to vials containing fresh food. Tester flies were aged for 5-7 days except tester flies used in Figure 3B-E and Figure 3-figure supplement 1A-C, which were aged for 14-16 days to ensure consistent labeling of targeted neurons (data not shown).
Male target flies were group-reared Canton-S (originally from the lab of Martin Heisenberg, University of Wü rzberg) virgin males except those used in Figure 4B-C and Figure 4-figure supplement 1C, which were males of an isogenic Canton-S (a gift from Anne von Philipsborn, Aarhus University). They were used as targets in these experiments because we observed that our standard Canton-S target males were sometimes aggressive and dominant towards the tester males even after being reared in groups (data not shown), which we were concerned could obscure the innate level of aggression in the tester male flies. These isogenic males performed few lunges toward the tester male flies (data not shown). To prepare mated wild-type target females, 5 Canton-S males were introduced into vials with 10 virgin females at 4 days old, and were reared for 2 more days to let them mate. At 3 days old, both male and female target flies were briefly anesthetized with CO 2 , and the tip of either one of their wings were clipped by a razor to create a 'mark'. This clipping treatment did not reduce the amount of each behavior (lunge, wing extension, and headbutt) detected under our experimental settings (see Ishii et al., 2020 for details).

Behavioral assays
All behavior assays were conducted in the evening between Zeitberger time (ZT)7 and ZT12 (from 4 to 9PM) at 22-25˚C. Social behavior assays were performed in a '12-well' acrylic chamber (Asahina et al., 2014) with food substrate (apple juice (Minute Maid) supplemented with 2.25% w/v agarose and 2.5% w/v sucrose; Hoyer et al., 2008) covering the entire floor of arena. The wall was coated with Insec-a-Slip (Bioquip Products, Inc, Cat# 2871C) and the ceiling was coated with Surfasil Siliconizing Fluid (ThermoFisher Scientific, Cat# TS-42800), both to prevent flies from climbing, as described previously (Asahina et al., 2014;Hoyer et al., 2008). The arenas were lit by LED backlights, which were controlled by a custom-built switch box. For optogenetic experiments, 850 nm infrared LED backlights (Sobel Imaging Systems, CA, Cat# SOBL-150 Â 100-850) were used, whereas white backlights (Edmunud Optics, NJ, Cat# 83873) were used for non-optogenetic experiments ( Figure 4A,B, Figure 4-figure supplement 1A-C). Flies were introduced into the chamber by gentle aspiration, and were allowed to acclimate for 5 min before recording started.
Recording was done by USB3 digital cameras (Point Grey Flea3 USB3.0, FLIR Inc, Cat# FL3-U3-13Y3M-C) controlled by the BIAS acquisition software (IORodeo, CA; https://bitbucket.org/iorodeo/ bias). The camera was equipped with a machine vision lens (Fujinon, Cat# HF35HA1B), and an infrared longpass filter (Midwest Optical Systems, Cat# LP780-25.5) when the infrared light sources were used. Movies were taken at 60 frames per second in the AVI format, either for 10 min in the optogenetic experiments or for 30 min for non-optogenetic experiments. Flies were discarded after each experiment. The food substrates were changed to a new one after 2 recordings for 30 min movies, or after 3 recordings for 10 min movies.
The setup for optogenetic experiments was assembled as described previously (Inagaki et al., 2014). Briefly, the red light (655 nm) LEDs were controlled via an Arduino Uno board (Arduino, Italy) using a custom program. As illustrated in Figure 1B, the stimulation paradigm (10 min in total) consists of 1 min pre-stimulation (time window '1' in Figure 1B), three blocks of 1 min stimulation at an indicated frequency (time window '2', 3 min in total) each followed by 2 min inter-stimulus intervals (ISIs, time window '3', 6 min in total). The recording and LED control were manually started simultaneously.

Quantification of social behavior data
All behavioral data points used in all figures, as well as all statistical results with exact p values, can be found in Source data 1.
Acquired movies were first processed by the FlyTracker program (Asahina et al., 2014; http:// www.vision.caltech.edu/Tools/FlyTracker/), which runs on MATLAB and creates output files which JAABA uses for behavioral classifications. See Ishii et al. (2020) for the creation, validation, and. jaab source files of JAABA-based behavioral classifiers used in this study, as well as the definition of 'time orienting'. The regions of interest were defined as circles corresponding to the chamber of each arena. The identities of tester and target flies were manually confirmed. The fly pair was removed from further analysis when (1) one of the two flies was killed during introduction to the chamber, (2) the wings of either fly was stuck at the extended position, or (3) the discrimination of the two flies was impossible due to wing damage of a tester fly. The amount of behavior is the number of bouts for lunges and headbutts, and the total duration (seconds) for wing extensions. These amounts were binned per minute for quantification. Extremely short bouts detected by a classifier were almost always false positives, and were eliminated from quantification. For lunges and headbutts, events with duration of less than 50 milliseconds were discarded. For wing extensions, events with a duration of less than 100 milliseconds were discarded. The post-processing of data was done using custom MATLAB codes which are available on Github (https://github.com/wohlmp/Ishii_Wohl_ DeSouza_Asahina_2019; Wohl, 2019; copy archived at https://github.com/elifesciences-publications/Ishii_Wohl_DeSouza_Asahina_2019).
The frame in which the infrared indicator LED turned on during the first LED stimulation period was used to align frames of movies. Statistical analyses were carried out using MATLAB. After behavior within each time window were calculated (see Figure 1B), the Kruskal-Wallis test ('kruskalwallis') was used to evaluate whether a given behavior was significantly different among different illumination periods (periods 1, 2, and 3; Figure 1B) or among different genotypes. When the p-value was below 0.05, the post-hoc Mann-Whitney signed rank test ('signrank') was used to detect significant differences between illumination period, and the Mann-Whitney U-test ('ranksum') was used to detect significant differences between testing and control genotypes. In both cases, Bonferroni correction was applied to p values. When the uncorrected p value was less than 0.05 but the corrected value did not pass the significant level, the uncorrected value was shown on panels with parenthesis. For Figure 6E-G, Dunn's multiple comparison test was applied to detect significant groups using a custom code ('dunn.m') (Cardillo, 2006; http://www.mathworks.com/matlabcentral/fileexchange/ 12827).
While it is not feasible to perform power analyses for non-parametric datasets, we performed a bootstrapped power analysis with a sample dataset from 171 single-housed wild-type male fly pairs (which is not included in this manuscript). We asked how many pairs of flies (biological replicates) are necessary to achieve a power of 0.8 when attempting to detect a 50% difference in the number of lunges and found that 22 pairs are sufficient. Thirty pairs of flies would increase the power to 0.9. We tested at least 24 pairs per genotype for all social behavior assays, and many groups contain more than 30 pairs. While the data distribution appears different among different genotypes and behaviors, we are confident that the number of biological replicates used in this study gives us sufficient power to support our conclusions.
Generally, male testers seldom performed lunges toward female targets. Also, noticeably less lunges were detected in fruM females. Behavioral data from these conditions often result in zeroinflated datasets. In such cases, a few false positive incidents can impact the result of statistical tests. To avoid this pitfall, classifier results of lunges from male testers toward female targets and from fruM females were manually validated, and obvious false positives (caused by tracking errors, when a fly was near or on the wall, or when a fly suddenly jumped) were eliminated before statistical tests were applied.

Activity and sleep analysis
Male flies were collected and singly reared for 6 days as was described in 'Social behavior analysis'. Experiments were carried out for 3 days at 24˚C. Activity and sleep data were acquired using individual Drosophila activity monitors (TriKinetics Inc) under 12 hr:12 hr light:dark cycles, as was described previously (Wu et al., 2014). Counts of beam crosses between Zeitgerber (ZT)8 and ZT12 on day 2 and day 3 were binned per minute (note that ZT8-12 corresponds to the time period when we performed social behavioral assays). Sleep was defined as at least 5 min of inactivity (no beam cross). The amount of activity and sleep were quantified using custom MATLAB scripts provided by William Joiner (University of California, San Diego).

Functional calcium imaging
Male flies were kept in all-trans retinal food after eclosion and aged 6 days. On the day of the experiment, flies were briefly anesthetized on ice and mounted on a custom chamber using ultraviolet curing adhesive (Norland Optical Adhesive 63, Norland Products, Inc) to secure the head and thorax to a tin foil base. The proboscis was also dabbed with glue to prevent its extension from altering the position of the brain. The head cuticle was removed with sharp forceps in room temperature Drosophila adult hemolymph-like saline (Wang et al., 2003). After cuticle removal, the recording solution was refreshed. Optogenetic stimulation was applied with an external fiber-coupled LED of 625 nm (Thorlabs Inc, Cat# M625F2) controlled by a programmable LED driver (ThorLabs, Cat# DC2200). The end of the LED fiber (Thorlabs, Cat# M28L01) was placed 5 mm from the brain. LED illumination of 5 Hz, 10-millisecond pulses for a 30 s duration was applied for optogenetic activation of CsChrimson. LED power was varied so that each fly received stimulations at 0, 0.02, 0.04, 0.1, and 0.2 mA. The energy from the LED that the neurons receive was estimated from the measurement of the LED power using a photodiode power sensor (Thorlabs, Cat# S130C) 5 mm away from the end of the LED fiber. The energy was read using a digital optical power/energy meter (Thorlabs Cat# PM100D).
The multiphoton laser scanning microscope (FV-MPE-RS, Olympus Corporation), equipped with 25X water immersion objective (Olympus Corporation, Cat# XLPLN25XWMP2), was used for monitoring the fluorescence of GCaMP6f. The recordings began 10 s before stimulation and continued 20 s after stimulation for a total of 1 min. GCaMP6f proteins were excited with a 920 nm laser (Spectra-Physics Insight DL Dual-OL, Newport Corporation). Images were taken at 10 Hz with a 256 Â 256 pixel resolution.
Acquired images were converted and analyzed in Fiji with the Olympus ImageJ plugin (http:// imagej.net/OlympusImageJPlugin). Imaging windows were chosen that maximally captured the dense set of projections that emanate from Tk-GAL4 FruM neurons before they branch out further (lateral junction described in Yu et al., 2010; Figure 6B). Rectangular regions of interest were selected and DF/F was calculated using a custom-written MATLAB code. First, the baseline fluorescence value (F base ) was calculated by averaging the fluorescence for 5 s preceding the stimulation. DF/F for each frame (DF/F frame=N ) was calculated as follows: ðDF=F frame¼N Þ ¼ ½ðF frame¼N Þ À ÀF base =F base Then, the DF/ F frame=N for frames taken during the 30 s LED stimulation (excluding frames where the light was on) were averaged to calculate the DF/F of a given trial. Boxplots of average DF/F during stimulation at different LED powers and across flies were generated. Heterozygous controls and fruMB mutants' fluorescence data were compared across LED powers using the Mann-Whitney U-test ('ranksum').