Main

During sexual maturation, the nervous system undergoes sexually dimorphic changes that couple behaviour to reproductive needs1,2,3,4,5. Sex differences in behaviour extend beyond courtship and mating to cognitive-like processes such as learning that also enhance reproductive success6,7. However, the precise dimorphisms in neural circuit development and organization that generate these differences in behavioural plasticity are mainly unknown.

C. elegans is a sexually dimorphic species with hermaphrodites that can self-fertilize and males that can only cross-fertilize hermaphrodites. As a consequence, males display a repertoire of reproductive behaviours not performed by the hermaphrodite and these behaviours require sex differences in the nervous system that develop during sexual maturation8,9. The best described dimorphisms are the male-specific sensory and motor circuits required for mating. However, non-reproductive behaviours such as learning are also sexually dimorphic. Males, but not hermaphrodites, are capable of sexual conditioning, a process that involves associative learning and leads to a switch in chemotactic responses that facilitates effective mate finding10. Sexual conditioning requires sex-shared and male-specific sensory neurons10, but whether the circuit also contains sexually dimorphic interneurons for integration is not known.

The MCMs are a novel class of interneurons

We identified a previously unnoticed bilateral pair of neurons in the head of males that are required for sexual conditioning. We have termed them the MCMs (for mystery cells of the male) (Fig. 1). The identification of the MCMs is surprising given that the C. elegans anatomy, neuronal connectivity and developmental lineage have been characterized extensively8,9,11,12,13,14. We noted the presence of the MCMs when we were analysing the expression pattern of a reporter transgene for the neuropeptide pdf-1. In males, but not in hermaphrodites, we observed pdf-1 expression in a bilateral pair of cells located dorso-anterior to the pharyngeal metacorpus, a region devoid of neuronal cell bodies in hermaphrodites (Fig. 1a–c). This region is comprised of glial and epithelial cells, some of which project anteriorly to the nose13,15. Unlike any other cells in this region, we observed that the male’s pdf-1-positive cells send projections posteriorly into the nerve ring (Fig. 1b and Extended Data Fig. 1a, b). The nerve ring is the main concentrated neuropil of the nematode brain, where most sensory neuron–interneuron synapses and neural processing occur13. We found that the pdf-1-positive cells also express the pan-neuronal reporter rab-3, suggesting they may be neurons. rab-3 expression was first observed at the L4 stage, when sexual maturation begins (Fig. 1c). Through reporter gene analysis, and ultrastructural reconstruction, we found that the MCMs are indeed fully differentiated neurons. In addition to rab-3, these cells express a battery of neuronal genes required for both electrical and chemical communication (Fig. 1d, Extended Data Fig. 1c and Extended Data Table 1). These include components of the SNARE complex; Na+ and voltage-gated Ca2+ channel subunits; innexins; components of the machinery for neuropeptide secretion ric-19 and ida-1; and pdf-1. At the ultrastructural level, we observed dense-core vesicles in the MCM somata and projections, and clear-core vesicles at presynaptic densities (Fig. 1e). Together, these observations indicate that the MCMs are a novel class of male-specific interneurons.

Figure 1: The MCMs are newly identified male-specific neurons.
figure 1

ad, Lateral views (a, b) and dorsal views (c, d) of animals oriented anterior to the left. a, WormAtlas-style47 diagram depicting the morphology and position, adjacent to the pharynx, of one of the bilateral pair of MCM neurons in the head of a male. b, Confocal projection of pdf-1::rfp expression in the head of an adult male (same region as in a). c, Expression of the pan-neuronal reporter transgene rab-3::rfp (Ras GTPase) in the head of an hermaphrodite and males at the third (L3) and fourth (L4) larval stages. The position of the MCMs is indicated with dashed red circles. L, left; R, right. d, Expression in the MCMs in adult males of reporter transgenes for neuronal markers. nca-1 (NALCN Na+ channel subunit); inx-3 (gap junction innexin); snt-1 (synaptotagmin); unc-64 (syntaxin); snb-1 (synaptobrevin); rgef-1 (Ras exchange factor); ida-1 (tyrosine phosphatase-like receptor, phogrin); ric-19 (cytosolic, vesicle secretion). e, Electron micrographs of MCM showing dense-core vesicles (DCVs) (left) and a synapse (right).

PowerPoint slide

We identified the MCMs in electron micrographs of serial sections through the male head and established their entire neural connectivity (Fig. 2 and Extended Data Table 2). The cell bodies send processes posteriorly in the amphid bundles, from which they diverge to enter the nerve ring, and from which they exit and extend into the ventral nerve cord (Extended Data Fig. 1b). In the nerve ring and ventral nerve cord we identified synaptic interactions with 24 neuron classes (Extended Data Fig. 1d and Extended Data Table 2). The bulk of the synaptic input (65%) is from three interneuron classes, two of which are sex-shared (AVF and PVQ) and one of which is male-specific (EF). These interneurons receive extensive sensory inputs from the male copulatory circuits in the tail and extend processes through the ventral nerve cord and into the nerve ring, where they connect to the MCMs both directly and through RIF (a sex-shared class of second-order interneurons that receive input from head chemosensory circuits) (Fig. 2). The largest synaptic output is onto the AVB pre-motor interneurons that drive forward locomotion. These outputs are both direct (41%) and indirect via RIF (14%). Thus, the presence of the MCMs creates a series of male-specific disynaptic feed-forward triplet motifs connecting male-specific EF and sex-shared AVF, PVQ and RIF to AVB (Fig. 2). Such triplet motifs recur frequently in the C. elegans nervous system9,16. There is also a small amount of reciprocal interaction between the MCMs and the male-specific, pheromone-sensing CEM head sensory neurons. The major input from mate-sensing circuits and their output onto second- and third-order interneurons make the MCMs ideally placed for the integration of mate-experience into circuits regulating behavioural plasticity to sensory stimuli.

Figure 2: MCM connectivity.
figure 2

a, Connectivity diagram of the MCMs showing the main inputs and outputs. The connections to the neurons known to regulate sexual conditioning (rays and CEMs), chemosensory plasticity (AIA, RIF), and salt sensation (ASE) are included. Grey and red connections indicate chemical and electrical synapses, respectively. The triplet motifs created by the MCMs are highlighted in black. The thickness of the lines is proportional to the anatomical strength of the connections, indicated in numbers (the number of EM serial sections of scored synaptic connectivity). Pink triangles, sensory neurons; red octagons, interneurons; purple circles, motor neurons; blue outline, male-specific.

PowerPoint slide

The MCMs regulate sex-specific learning

We found that the MCMs are required for a male-specific switch in chemosensory behaviour induced by sexual conditioning. Sexual conditioning is a mate-experience-dependent process of behavioural modification that overrides the effects of starvation during chemosensory learning10. This plasticity confers on males the ability to use recent environmental chemosensory cues as signals for effective mate finding, and reflects the adult male prioritization of sex over food17,18. One chemosensory behaviour that is subject to sexual conditioning is salt-avoidance learning10. C. elegans is normally attracted to salt but both males and hermaphrodites can learn to avoid salt when it is previously associated with an aversive stimulus such as starvation19,20 (Fig. 3a). However, unlike hermaphrodites, males switch their behaviour and become attracted to salt if mates are present during previous conditioning10 (Fig. 3a). Ablation of the MCMs at the late fourth larval (L4) stage with a laser microbeam resulted in males that failed to undergo a sexually conditioned switch, thus avoiding salt rather than being attracted to it, after conditioning with starvation, salt and mates (Fig. 3b). Importantly, MCM ablation did not disrupt salt attraction in non-conditioned males or salt avoidance learning after conditioning with salt and starvation in the absence of mates (Fig. 3b), indicating that the defects are specific to sexual conditioning and not due to inability to sense salt or starvation.

Figure 3: The MCMs are required for male-specific associative learning.
figure 3

a, Diagram depicts the salt-avoidance learning and sexual conditioning assay. CS, chemotaxis score. b, Salt chemotaxis scores of previously conditioned intact and MCM-ablated males [inIs179(ida-1::gfp);him-8(e1489)], and wild-type [him-5(e1490)] and pdf-1(tm1996) mutant males. n, number of individual animals tested. Error bars indicate s.e.m. Mann–Whitney U-test was used for statistical analysis. ***P < 0.001; **P < 0.01; *P < 0.05; NS = no statistically significant difference (P ≥ 0.05). WT, wild type.

PowerPoint slide

Sexual conditioning requires two types of mate inputs10: a secreted pheromone synthesized by the enzyme DAF-22 and sensed through chemosensory amphid neurons and the male-specific CEM sensory neurons in the head10,21, and a contact-dependent cue that is sensed through the male-specific ray neurons in the tail10,22. MCM-ablated males responded efficiently to both daf-22-dependent secreted pheromones (ascarosides) (Fig. 4a, b and Extended Data Fig. 2a) and contact-dependent hermaphrodite cues that initiate the mating sequence and inhibit male food-leaving behaviour22,23 (Fig. 4c, d and Extended Data Fig. 2b, f). These results indicate that the MCMs are not required for the sensory detection of mates, salt or starvation, but that they specifically regulate the integration of these cues to produce behavioural plasticity in a context- and sex-specific manner.

Figure 4: MCM ablation does not affect other male-specific behaviours.
figure 4

Efficiency of intact and MCM-ablated males [inIs179(ida-1::gfp);him-8(e1489) or otIs356(rab-3::rfp)him-5(e1490)], and wild-type [him-5(e1490)] and pdf-1(tm1996) mutant males in male-specific behaviours. a, Response to wild-type or daf-22 (m130) hermaphrodite-conditioned media and purified ascaroside pheromones (80 nM Ascr no. 3, 800 nM Ascr no. 2). Graphs represent Tukey box plots of logarithmic transformations of the data; n = number of independent events (that is, entry in scoring region); t-test with Bonferroni correction was used for statistical analysis. ***P < 0.001; *P < 0.05; NS, no statistically significant difference (P ≥ 0.05). b, Summary diagram of the data plotted in a. Statistical significance compared to control buffer is indicated by +++, P < 0.001; +, P < 0.05; –, no statistically significant difference. n.d., not determined. c, d, Execution of mating sub-steps (c) and exploration in search of mates (d). +++ indicates performance level of intact control males.

PowerPoint slide

Having found a role for the MCMs in sexual conditioning, we next asked whether the MCMs are important regulators of other male-specific behaviours from the coordinated sensory-motor programmes of mating24 to other integrative behaviours such as the decision to leave food in search of mates22,25. MCM ablation did not cause defects in any other male-specific behaviour tested or overall fertility (Fig. 4c, d and Extended Data Fig. 2b–f), demonstrating a surprisingly specific role for the MCMs in sexual conditioning.

To establish whether sexual conditioning is regulated through neuromodulation, we tested pdf-1(tm996) mutants in the salt chemotaxis learning assay. The tm1996 deletion allele removes the minimal promoter and first exon of the pdf-1 gene and is likely to be a null26,27. We found that pdf-1 mutant males, like MCM-ablated males, failed to undergo sexual conditioning and avoided salt after conditioning with starvation, salt and mates (Fig. 3b). Loss of pdf-1, like loss of MCMs, did not disrupt salt sensation in naive animals or the ability to associate salt and starvation (Fig. 3b). pdf-1 mutants also responded to secreted and contact-dependent mate cues, although they were slightly, but significantly, less efficient than wild-type males at contact response (Fig. 4 a, b and Extended Data Fig. 2b)27. Together, these results tentatively suggest that the MCMs may modulate the circuits that regulate chemosensory plasticity through neuropeptide secretion.

The MCMs arise from glia

Next, we sought to establish the developmental mechanisms by which these male-specific neurons arise. Unlike any other neurons in C. elegans and other invertebrates, which arise from epithelial or undifferentiated blast cells8,11,12,28, we found that the MCMs arise from glial cells. Glia are specialized cells with projections that ensheath the cilia of the sensory neurons with which they are associated, and provide structural and functional support to these neurons29. As neuronal gene expression in the MCMs begins during sexual maturation, we examined the expression of an rnr-1::gfp reporter, which labels cells in S-phase30, to determine whether the MCMs are born at this stage via an undescribed cell division in the male head. In the head region, we observed strong expression only in males (Fig. 5a). Expression was observed in a bilateral pair of cells at the late L3 stage, corresponding to the amphid socket (AMso) glial cells, and perduring in two bilateral pairs of cells at the early L4 stage, corresponding to the two AMso and the MCMs (Fig. 5b and Extended Data Fig. 3a). The lack of expression in the hermaphrodite head is consistent with the lack of AMso glial cell division in this sex12.

Figure 5: The MCMs originate from a male-specific cell division of the AMso glial cells.
figure 5

Lateral views of animals oriented anterior to the left and dorsal to the top. a, b, Expression of the S phase reporter transgene rnr-1::gfp in whole animals at the L4 stage (a) and in the head of L3 and L4 males (b). The male-specific division in the head is indicated by dashed circles in a. The rest of expression corresponds to developing reproductive structures. c, Differential interference contrast (DIC) and fluorescent images of the AMso cell body with RFP-labelled histones during cell division. d, WormAtlas diagram depicting the morphology and position of the AMso and the MCM in the male head at the L3 and L4 stages. e, Head of animals with sex-reversal genetic manipulations of AMso. Feminization by expression of the grl-2::tra-2(IC)::SL2::mCherry transgene oleEx23. Masculinization by expression of grl-2::fem-3::SL2::mCherry transgenes oleEx18 and oleEx24.

PowerPoint slide

Ablation of one of the bilateral pair of AMso glial cells at the L3 stage in males resulted in a consistent loss of the MCM on the operated side (Extended Data Table 3). Importantly, the MCM was not lost when the AMso was ablated at the mid-L4 stage, after the MCM was born (Extended Data Table 3). Together this demonstrates that the AMso glial cells are the MCM progenitors.

The AMso glial cells display a polarized morphology with a single projection running anteriorly along the anterior to posterior (A–P) axis to the nose15 (Figs 5d and 6a, b). Live imaging of the AMso cell division in males revealed that the cleavage plane was perpendicular to the axis of AMso polarity and that the AMso projection was maintained throughout the division (Fig. 5c and Extended Data Fig. 3b). The projection was inherited by the self-renewing AMso glial daughter.

Figure 6: The male AMso cells are fully differentiated glia before and after the division that generates the MCM neuron.
figure 6

Lateral views of animals oriented anterior to the left and dorsal to the top. a, AMso glial cell (green, grl-2::gfp) and amphid sensory neuron dendrites (red, pdf-1::rfp) in an L3 hermaphrodite and L3 and L4 males. b, Diagram of the AMso glial cell and the distal end of its projection to the nose, where it ensheaths the cilia of sensory dendrites. c, Expression in AMso and perdurance in MCM of reporter transgenes for glial markers in L3, L4 and adult males. ptr-10 (Patch-related receptor); itr-1 (IP3 receptor); grl-2 (Hedgehog-like/Ground-related).

PowerPoint slide

AMso plasticity is intrinsically regulated

The AMso glial cells are born during embryogenesis from the same fully described lineages in both sexes (Extended Data Fig. 4a)11, but retain their plasticity only in males, re-entering the cell cycle during sexual maturation. We found that the AMso developmental program occurred according to the genetic sex of the AMso cells and not according to that of the rest of their lineage or the animal. Sexual dimorphism in C. elegans is regulated by a genetic pathway that converges on the Ci/GLI-like zinc-finger transcription factor tra-1, which inhibits male development and activates hermaphrodite development31,32. Consistent with a role for the sex-determination pathway in MCM specification, 22/22 tra-1(e1488) sex-transformed XX pseudo-males produced MCMs (data not shown). The sister cells of the AMso are the male-specific CEM sensory neurons, which undergo cell death during embryogenesis in hermaphrodites11 (Extended Data Fig. 4a). In order to establish whether sex-specific neurogenic competence of the AMso glial cells is specified extrinsically or intrinsically, we expressed sex-reversing transgenes under cell-restricted promoters to uncouple the genetic sex of the AMso glial cells from that of the rest of the animal. We used the grl-2 and ztf-16 promoters, which drive expression in the AMso cells after they are born and one or two other non-overlapping cell types in the head in larval animals33,34. Masculinization of the AMso cells in hermaphrodites, by expression of a fem-3 transgene35,36, resulted in AMso cell division and MCM neuronal differentiation (Fig. 5e, Extended Data Fig. 4b and Extended Data Table 4). Conversely, feminization of AMso cells in males, by overexpression of the tra-2 intracellular domain (tra-2IC)18,37, resulted in lack of AMso cell division and lack of MCMs (Fig. 5e, Extended Data Fig. 4c and Extended Data Table 4). Masculinizing transgenes in males or feminizing transgenes in hermaphodites had no effect on AMso development (Fig. 5e). These results indicate that the competence of the AMso glial cell to become a neural progenitor is specified intrinsically, and extend the battery of sexual dimorphisms regulated by the sex-determination pathway to the intrinsic properties of glia.

The male AMso cells are fully differentiated glia

We found that the male AMso glial cells are fully differentiated specialized cells before they divide, indicating that the production of the MCMs from AMso involves a complete switch in terminal cell fate (Fig. 6). In hermaphrodites and adult males, the AMso cells are specialized glial cells that form a hole in the cuticle through which most amphid neurons contact the outside world15, (Fig. 6a, b). Hermaphrodite AMso cells also express a battery of glial-cell markers38. We observed that at the L3 stage, before their division, the male AMso cells display the same characteristics as the AMso of hermaphrodites and adult males: they project to the nose where they form a socket that ensheaths amphid neuron cilia (Fig. 6a, b), and they express AMso markers (Fig. 6c and Extended Data Table 5). Following AMso division, one daughter retains the AMso identity and the other becomes the MCM, which loses molecular and structural characteristics of glia (Extended Data Fig. 5) and, as described above, acquires a neuronal identity. Similar complete switches in terminal cell fates have been described as transdifferentiation events in C. elegans and other systems11,39,40,41.

Discussion

The production of the MCMs from AMso glial cells through a division that results in self-renewal and neuronal differentiation is equivalent to a snapshot of the reiterative neuronal differentiation events arising from radial glia cell divisions during vertebrate neurogenesis42. However, the extent to which vertebrate neural progenitors are fully differentiated glia remains unclear and, in particular, it is not known whether the support and progenitor functions of glia can be integrated within one cell43,44. Our results provide the first example of neurons arising from glia in a non-vertebrate organism and demonstrate that fully differentiated, functional glia can retain neural progenitor properties during normal development.

In C. elegans the best described transdifferentation event is the direct conversion of the rectal epithelial cell Y into a neuron39,45. Other cell fate switches in C. elegans and other systems, which are not direct but require cell division, have also been suggested to be transdifferentation events11,40,41. The complete cell fate switch we observe suggests that the production of neurons from glia may be a process of natural transdifferentiation. It will be interesting to determine whether direct and indirect transdifferentiations of this kind occur through similar molecular mechanisms.

Our findings provide a direct link between developmental and anatomical sexual dimorphism in higher-order processing areas of the brain and sexually dimorphic behavioural plasticity during learning. We have shown that sex differences in learning require the production, late in development, of a male-specific class of cephalic interneurons that were not previously known to exist. These interneurons are incorporated into pre-existing, sex-shared circuits allowing the male to change behavioural priorities according to its new reproductive needs. The MCMs function to confer salience to previous mate-experience during male navigation. Based on their connectivity, we suggest that these interneurons may function in other chemosensory-plasticity behaviours that may be subject to sexual conditioning. The production of more neurons in males is also a mechanism to generate cognitive sexual dimorphism in the song-learning system of songbirds, where neural progenitors have a glial identity46. However, whether these neurons are a male-specific class and whether their progenitors are intrinsically sexually dimorphic is not known. Our findings indicate that the addition of sex-specific neurons is an effective way of remodelling brain circuits during sexual maturation and reveal a general, possibly ancient role for glia as neural progenitors to assemble circuits for higher-order processing.

Methods

No statistical methods were used to predetermine sample size. No samples were excluded from analysis. For behavioural assays, investigators were blinded to the genotype or surgery of the animals during experiments and outcome assessment. Experiments testing response to secreted pheromones were randomized.

Strains

him-5(e1490) was used as the wild-type background strain. BL5717, inIs179(ida-1::gfp);him-8(e1489) was used for MCM ablation and behavioural assays (data in Figs 3 and 4 and Extended Data Fig. 2). BAR4, otIs356(rab-3::rfp)him-5(e1490) was used for MCM ablation and behavioural assays (data in Fig. 4 and Extended Data Fig. 2). PT2248, pdf-1(tm1996);him-5(e1490). DR476, daf-22(m130). CB369, unc-51(e369) VT774, unc-36(e251);maIs103(rnr-1::gfp+unc-36 (+)). CB2823, tra-1(e1488)III;eDp6(III;f). BAR63, stIs10116 [his-72::his-24::mCherry::let-858 3′UTR + unc-119(+)]; itIs37 [pie-1::mCherry::H2B::pie-1 3′ UTR + unc-119(+)];him-5(e1490).

Arrays for neuronal and amphid socket markers are indicated in Extended Data Tables 1 and 5, respectively.

DNA constructs

Sex transformation constructs were made by PCR fusion of the regulatory sequences of grl-2 (ref. 34) or ztf-16 (ref. 33) directly upstream of the ATG of fem-3::SL2::mCherry or tra-2IC::SL2::mCherry18,35,36,37. These contructs include the unc-54 3′ UTR. The grl-2 promoter included 862 bp upstream of the ATG start codon (this is a smaller region of the promoter from that used in ref. 34). We checked transgenes driven by this promoter for embryonic expression and saw no expression before the birth of the AMso. The ztf-16 glia enhancer included the region −2,536 to −4,637 upstream of the ATG, as described in ref. 33.

The following arrays were generated: oleEx18[grl-2::fem-3::SL2mCherry (20 ng µl−1) + elt-2::gfp (40 ng µl−1)]; oleEx24[grl-2::fem-3::SL2mCherry (8 ng µl−1) + elt-2::gfp (40 ng µl−1)]; oleEx19[grl-2::tra-2IC::SL2mCherry (50 ng µl−1) + elt-2::gfp (30 ng µl−1)]; oleEx23[grl-2::tra-2IC::SL2mCherry (10 ng µl−1) + elt-2::gfp (40 ng µl−1)]; oleEx22[ztf-16::tra-2IC::SL2mCherry(5 ng µl−1) + elt-2:: gfp(40 ng µl−1)].

Laser ablations

A standard protocol was used48. L1, L3 or L4 males were mounted on a glass slide on a 5% agarose pad with 25 mM NaN3 as anaesthetic. For MCM candidate progenitor ablations the presence or absence of MCMs was identified with a rab-3 transgene (Extended Data Table 1). Epithelial cells were identified by morphology, position, and expression of the gaIs220 [col-93::HIS-24::mCherry + unc-119(+)] or syIs78[ajm-1::gfp+unc-119(+)] transgenes. Amphid socket cells were identified with glial markers (Extended Data Table 5).

For MCM ablation and behavioural assays the strains BL5717, inIs179(ida-1::GFP);him-8(e1489) and BAR4, otIs356(rab-3::rfp)him-5(e1490) were used. Animals were left to recover for one day and then assayed.

Behavioural assays

Sexual conditioning switch. Assays were performed as in ref. 10 with some modifications. Assay plates and 50 mM NaCl conditioning plates were 5 cm in diameter and contained 4.5 ml of 2% agar, 5 mM potassium phosphate (pH 6.0), 1 mM CaCl2 and 1 mM MgSO4 (salt-conditioning plates also contained 50 mM NaCl). A radial gradient of salt was created in the assay plates by adding 10 µl of 50 mM NaCl 2 cm away from the centre of the plate the night before the assay and then 5 µl of 50 mM NaCl three hours before the assay. Males and hermaphrodites were picked as L4s the night before the assay and transferred to single-sex plates with food. Animals were recovered from the food plates with wash buffer (1 mM CaCl2, 1 mM MgSO4, and 5 mM pH 6.0 potassium phosphate) and centrifuged at 1,700 r.p.m. for 3 min. A total of three washes were performed to remove the food before placing the animals on the conditioning plates. Between 8 and 15 males were placed on each conditioning plate and 200 hermaphrodites were used for sexual conditioning. Animals were conditioned for 2 h. Ablated males were sexually conditioned in the same plate as control males, tested blind, and identified afterwards based on the absence of MCMs. Animals were tested individually on a radial gradient of salt by placing them in the centre of the assay plate, 2 cm away from the source of NaCl. After 20 min, the tracks left by the animal were visualized and the chemotaxis score was calculated as in ref. 10 by the sum of the scores of the regions by which the animal had travelled (Fig. 3a). At least five replicas were performed and on different days. Mann–Whitney U-test was used for statistical analysis.

Response to secreted mate pheromones. Assays were performed as in ref. 22. Hermaphrodite-conditioned media was prepared by incubating wild-type or daf-22(m130) hermaphrodites in M9 buffer at a concentration of one hermaphrodite per 1 µl of M9 for 3 h. Animals were picked as L4 s the night before. Assay plates were regular NGM plates seeded with 50 µl of OP50. A pheromone spot (1 µl of hermaphrodite-conditioned M9, or diutions of Ascr no. 2 and Ascr no. 3 in M9) and a control spot (1 µl of M9) were placed 3 mm apart. The two spots were interchanged every other trial to remove any bias. Upon drying, the spots left a visible rim on the food lawn. A population of 5 males (8 males for him-5 (e1490) and pdf-1(tm1996) trials) was placed 3 mm away from the spots and video recorded for 20 min. Videos were scored blindly for time spent in each spot. Each entrance to a spot was considered an independent event if after leaving, the worm had moved at least 2 mm away from the spot. The average duration of events was calculated and compared between spots and populations. Mann–Whitney U-test with Bonferroni correction was used for statistical analysis. For clear visualization of the data in the plotted graphs, data was logarithmically transformed. This results in normalization of the distribution of the data. t-test with Bonferroni correction was used for statistical analysis of the transformed data. Comparison of arithmetic (raw data) or geometric (transformed data) means did not affect the interpretation of the data.

Seven independent population trials were performed for each condition except for daf-22(m130)-conditioned media (twelve), 600 nM Ascr no. 2 + 60 nM Ascr no. 3 (five) and 1200 nM Ascr no. 2 + 120 nM Ascr no. 3 (four). We selected three different ascaroside dilutions according to the response elicited in intact males: 600 nM Ascr no. 2 + 60 nM Ascr no. 3 (no robust and stochastic response), 800 nM Ascr no. 2 + 80 nM Ascr no. 3 (robust but low response), 1,200 nM Ascr no. 2 + 120 nM Ascr no. 3 (robust and strong response) (Extended Data Fig. 2).

Response efficiency to mate contact. Animals were isolated as L4s the night before. For the assay, single males were placed with 30 mates (hermaphrodites) in a 20 mm food lawn. Males were tested until they responded to a mate or for three minutes, whatever happened first. A male was scored as responding to mate contact if it placed its tail ventral down on the mate’s body and initiated the mating sequence by backing along the mate’s body to make a turn. The response efficiency was calculated by dividing a response by the total number of contacts made with the mate before responding. If a male did not respond within three minutes, it was scored as having 0 efficiency. Males were scored blindly. The Mann–Whitney U-test was used for statistical analysis.

Turning and location of vulva (lov) assays. Single males (isolated the night before as L4) were tested on a 10 μl lawn of food (E. coli OP50) with 30 unc-51 hermaphrodites during 3 min. Upon response to contact, up to seven turns were scored as good or bad. Good turns: sharp ventral bend around the tip of the body of the mate, followed by uninterrupted scanning along the other side of the mate’s body. Bad turns: stutter (stops moving backwards before turning and moves forward before continuing with backward move); wide (tail positioned in a loose bend when turning around the tip of the mate); swim off (continues backing after reaching the end of the mate’s body and loses contact); or interrupted (after turning, the male does not continue backing along the mate’s body). The proportion of good turns out of total turns was scored.

For location of vulva efficiency, the number of encounters with the vulva until it was first located was scored. The assay finished when the male located the vulva or after three minutes, whatever happened first. Location efficiency was scored as 1 divided by the total number of encounters.

The Mann–Whitney U-test was used for statistical analysis.

Fertility assays. A single rab-3::rfp transgenic male was left to mate with two unc-51 hermaphrodites on a 15-μl lawn of food (E. coli OP50) for 24 h and then removed. The hermaphrodites were transferred to a fresh plate every 24 h for a total of three days. The proportion of cross-progeny from total progeny was calculated for three ablated individuals and three controls. t-test was used for statistical analysis.

Food-leaving and retention assays. As described in ref. 27.

Electron microscopy and serial reconstruction

Four samples were fixed by chemical fixation or high-pressure freezing and freeze substitution as previously described49. Ultrathin sections were cut using a RMC Powertome XL, collected onto grids, and imaged using either a Philips CM10 TEM or Zeiss Supra 40 FE-SEM. Sections were elastically aligned50 and volumetrically reconstructed using TrakEM2 (ref. 51). The MCM cell bodies were identified in the EM sections based on position and morphology and in comparison to similar hermaphrodite sections. This identity was further confirmed by the identification of a posterior projection, as no other cell with its soma in the same region is known to project posteriorly. This was followed by serial tracing of the projections to establish their morphology and connectivity. Synaptic connectivity and skeleton diagrams were determined using Elegance52. Circuit diagrams of connectivity were generated using Cytoscape53. We estimated the anatomical strength of synaptic connectivity between two neurons by summing the number of serial sections where we observed the ultrastructural morphology presynaptic components using the same criteria as ref. 13.