Sexual morph specialisation in a trioecious nematode balances opposing selective forces

The coexistence of different mating strategies, whereby a species can reproduce both by selfing and outcrossing, is an evolutionary enigma. Theory predicts two predominant stable mating states: outcrossing with strong inbreeding depression or selfing with weak inbreeding depression. As these two mating strategies are subject to opposing selective forces, mixed breeding systems are thought to be a rare transitory state yet can persist even after multiple speciation events. We hypothesise that if each mating strategy plays a distinctive role during some part of the species life history, opposing selective pressures could be balanced, permitting the stable co-existence of selfing and outcrossing sexual morphs. In this scenario, we would expect each morph to be specialised in their respective roles. Here we show, using behavioural, physiological and gene expression studies, that the selfing (hermaphrodite) and outcrossing (female) sexual morphs of the trioecious nematode Auanema freiburgensis have distinct adaptations optimised for their different roles during the life cycle. A. freiburgensis hermaphrodites are known to be produced under stressful conditions and are specialised for dispersal to new habitat patches. Here we show that they exhibit metabolic and intestinal changes enabling them to meet the cost of dispersal and reproduction. In contrast, A. freiburgensis females are produced in favourable conditions and facilitate rapid population growth. We found that females compensate for the lack of reproductive assurance by reallocating resources from intestinal development to mate-finding behaviour. The specialisation of each mating system for its role in the life cycle could balance opposing selective forces allowing the stable maintenance of both mating systems in A. freiburgensis.

nematode genus Auanema 11 displays trioecy, having two egg-laying reproductive modes that coexist in a population: females, which must outcross with males to reproduce, and hermaphrodites, which although able to cross with males, predominantly reproduce by self-fertilisation 12 . In A. freiburgensis, sex determination between nonmales (females and hermaphrodites) and males is regulated chromosomally: males inherit a single X chromosome (XO), whilst hermaphrodites and females inherit two (XX) (Fig. 1). Auanema males are under-represented in populations, as they are produced at low percentages both from male-female crosses (< 20%) and self-fertilising hermaphrodites (< 10%) 11,[13][14][15][16] . In contrast, environmental cues play an important role in determining the nonmale sexual morphs in A. freiburgensis 17,18 . Whereas at low population density hermaphrodites produce mostly female progeny, sensing of a crowding signal triggers the hermaphrodite mother to switch to produce predominantly hermaphrodite offspring. The female and hermaphrodite exhibit different larval development (Fig. 1). When in well-fed conditions at 20 °C, a hermaphrodite takes approximately 3 days from hatching to adulthood. The hermaphrodite obligatorily passes through dauer, a specialised non-feeding, stress-resistant, migratory  In A. freiburgensis, whether a mother (female or hermaphrodite) produces females or hermaphrodite progeny depends upon her perception of her habitat. In uncrowded conditions (blue arrows), she produces outcrossing female progeny, but upon sensing a crowding signal can switch to producing selfing hermaphrodites (red arrows). Hermaphrodites pass through an obligatory dauer larval stage optimised for migration 11,14 . If dispersed to a new habitat patch the dauer will complete reproductive development and produce progeny by self-fertilisation. If this new habitat patch is uncrowded the hermaphrodite will produce mostly female (and male) progeny (blue arrows). As neither females nor males pass through the dauer diapause larval stage they reach sexual maturity quicker, which could allow more rapid population growth in new habitats 11 . Times for development are based on well fed conditions at 20 °C. *The dauer diapause can persist for longer in sub-optimal conditions. **A. freiburgensis hermaphrodites predominantly reproduce by self-fertilisation although they are able to outcross with males 11 . Hermaphrodites are not able to cross with females as they do not have the structures to transfer sperm to other individuals 11  www.nature.com/scientificreports/ larval stage. In contrast, the A. freiburgensis female and male never pass through dauer and reach adulthood after approximately 2 days at 20 °C. The passage through dauer by the hermaphrodite is probably an adaptation to colonise new environments, assuring the establishment of a new population out of a single self-fertilising individual. A. freiburgensis hermaphrodite founders, when in low population density, will produce predominantly male and female progeny. Since females and males do not pass through dauer, subsequent population growth by the offspring of this founding generation will be more rapid. Outcrossing between the progeny of co-founders could facilitate adaptation by generating genetic variation [19][20][21][22] .
Thus, the female (outcrossing) and hermaphrodite (pre-dominantly selfing) sexual morphs of A. freiburgensis play distinct roles during the life cycle and will therefore be under different selection pressures. Their life histories suggest that selection for reproductive assurance takes place during the initial colonisation phase (hermaphrodite) and selection for sex specialisation in subsequent generations (females). The aim of this work was to understand how trioecy can be maintained in A. freiburgensis if females and hermaphrodites are under these opposing selection pressures. For example, in synthetic trioecious C. elegans populations females are rapidly outcompeted, with populations reverting to androdioecy after only a few generations 23 . We hypothesised that if each sexual morph has specific adaptations to minimise the cost of their life histories, this will facilitate temporal balancing of these opposing selection forces, allowing the stable maintenance of trioecy. If this were the case, we would anticipate hermaphrodites and females specialise in their respective roles resulting in more differences between sexual morphs over and above the mode of reproduction or the ability to go through dauer. To test our hypothesis, we will search for a series of behavioural, physiological and gene expression specialisations between females and hermaphrodites.

Materials and methods
Nematodes strains and culture. To reduce genetic variation, we inbred the A. freiburgensis strain SB372 11 for 11 generations to produce the strain APS7. APS7 was used in all experiments and was maintained on nematode growth medium (NGM) agar plates, seeded with the streptomycin-resistant Escherichia coli OP50-1 strain and cultured at 20 ˚C, using standard C. elegans protocols 24 . Microbial contamination was prevented by adding 200 µg/mL nystatin and 100 µg/mL streptomycin to the NGM 25 .

Identification of A. freiburgensis females, males and hermaphrodites.
A. freiburgensis dauer larvae invariably develop into hermaphrodites 11 . Thus, to isolate hermaphrodites, dauers were identified on wellpopulated plates by their distinctive morphology 11 and incubated on NGM OP50-1 plates until reaching adulthood (~ 48 h after collection).
A. freiburgensis hermaphrodites, in uncrowded conditions, produce mostly female and male progeny 11 . To collect females, young adult hermaphrodites were allowed to lay eggs at a low population density (3 hermaphrodites per 2 cm diameter OP50-1 bacterial lawn). 24-36 h after egg laying began, larval stage 2 (L2) female larvae were distinguished from males by their different tail morphology and transferred to female-only plates to prevent fertilisation. From these plates, L4 or early adult females could be identified after ~ 16 h or ~ 24 h respectively.
To generate mated females (MF) L4/early adult females were co-cultured with males overnight (16 h). Crosses were carried out in a ratio of 5 females to 1 male (total 30 individuals per plate). This ratio was chosen to reflect that males only constitute ~ 20% of the A. freiburgensis population 11 and to minimise male induced damage to females.
Behavioural assays. Chemotaxis assay. To test if virgin females, mated females and hermaphrodites exhibit different attraction behaviour we conducted chemotaxis assays as described elsewhere 13 . In brief, conditioned medium was generated by placing 20 young adult males in 100 μl of M9 buffer 24 for 16 h at 20 °C. Samples were centrifuged at 15 000 rpm for 5 min to pellet the nematodes and the supernatant removed and used for the assay. Assays were conducted on NGM plates without bacteria. A spot of 5 μl of conditioned media (pheromone treatment) and one of 5 μl of M9 buffer (control) were added 3 cm apart, with the midpoint as the centre of the plate. For each test 10 adult nematodes at either day 0, day 1 or day 2 of adulthood were placed at the midpoint and scored for their location after 60 min. A total of 65 replicates were carried out, with five replicates per sexual phenotype per day of adulthood, unless otherwise stated (virgin females (day 0 n = 7, day 2 n = 13) mated females (day 2 n = 11) and hermaphrodites (day 0 n = 7).
To calculate the chemotaxis index (CI) the number of nematodes attracted to the test spot was subtracted by the number of nematodes in the control spot, and divided by the total number of nematodes assayed 26 .
As the data was zero-inflated (animals not attracted to the male pheromone), we analysed it using a hurdle model. We analysed if the animals were attracted to the male pheromone (yes/no) as a logistic regression, we then analysed how attracted they were using a generalized linear model with a gamma distribution in R. Post-hoc tests were carried out using the emmeans package version 1.5.4 in R 27 .
Food patch leaving assay. Food patch leaving, whereby individuals leave an abundant central food source to search surrounding areas of the plate, is associated with the nematode mate searching behaviour 28 . To test if A. freiburgensis exhibits food patch leaving behaviour, virgin females, mated females and hermaphrodites were isolated as described above. On the first day of adulthood, 30 individuals were moved to a fresh bacterial food patch www.nature.com/scientificreports/ (1 cm diameter lawn in a 6 cm Petri dish) per treatment. The number of individuals remaining on each bacterial lawn was counted after 24 h and again 48 h after the move, and expressed as a percentage of the starting number of individuals. The procedure was replicated five times for each phenotype and adult day (30 replicates in total). This data was transformed using an arcsine square root transformation and analysed with a mixed effect model (proportion of adults on lawn ~ sexual phenotype * adult day) to account for the repeated measures design using the lme4 package (version 1.1-27.1) in R 29 . Post-hoc tests were carried out using the emmeans package in R 27 .
Physiological and morphological assays. Measurement of intestinal development. To test if A. freiburgensis intestinal development varies between virgin females, mated females and hermaphrodites each phenotype was obtained as described above and imaged with the Zeiss Axio Zoom V16 (Zeiss) using the Zen 2 software (v2) on day 2 of adulthood. Images were then converted to TIFF format and analysed in ImageJ. The A. freiburgensis intestinal cells appear dark (due to light-scattering and/or absorption by gut-specific organelles) and are easily distinguished. To determine the intestine width to nematode width ratio, individuals were measured for both body width and intestinal width at the midpoint of third intestinal cell (from the posterior) (virgin females n = 22, mated females n = 28 and hermaphrodites n = 29). This cell was easily identified in all stages and morphs.
To determine if lumen length varies between the different phenotypes, individuals were measured for both lumen and body length (virgin females n = 25, mated females n = 26 and hermaphrodites n = 22). The intestinal lumen is characterised by the lack of pigmentation and runs as a central line along the individual. Nematode length was measured from mouth to tail. All three measurements were analysed with linear models with a Gaussian distribution in R. We carried out Tukey's posthoc honestly significant difference (HSD) tests in R.

Transmission electron microscopy (TEM) analysis of gut microvilli.
To study intestinal development further approximately 25 virgin females or hermaphrodites were isolated as described above and placed into 100 μm aluminium platelets filled with OP50-1 E. coli. They were then frozen in a HPM-010 High Pressure Freezing machine (BalTec). Samples were processed in an automatic freeze substitution machine (RMC) in the following conditions: 90 °C for 14 h in 0.1% tannic acid in acetone, 72 h in 2% OsO4 in acetone while slowly increasing temperature to 4 °C. Nematodes were further stained with 0.1% thiocarbohydrazide in acetone for 2 h at room temperature, 2 h in 1% OsO4 and infiltrated with increasing concentrations of 812 hard resin (Taab) over 4 days. Nematodes were finally thin-embedded between glass slides in 812 hard resin and polymerised at 70 °C for 24 h. 50 nm sections were cut with a PowerTome ultramicrotome (RMC) and examined with a Hitachi H-7650 transmission electron microscope operating at 100 kV. Microvilli were measured through the middle of the microvilli from the level of the apical base to the tip of the microvilli. At least 5 microvilli were measured per individual and the mean length recorded. In total, images from 27 (13 virgin female and 14 hermaphrodite) individuals were analysed with a linear model with timepoint and sexual phenotype (hermaphrodite or virgin female) as predictor variables using a Gaussian distribution in R. Unfortunately, mated females and later developmental stages could not be analysed due to sample deterioration.

Analysis of neutral lipid stores by Nile red staining.
To test if A. freiburgensis intestinal lipid stores varies between virgin females, mated females and hermaphrodites each phenotype was obtained as described above and analysed on day 0, 1 and 2 of adulthood. To measure neutral lipid stores we used the fixed Nile red staining method modified from the protocol by 30 . Nile red (MP BIOMEDICALS SAS) was prepared as a 0.5 mg/ml stock in acetone. Staining solution was prepared just before use by adding 6 μl of Nile red stock solution per 1 ml of 40% isopropanol (3 μg/ml final concentration). Approximately 50 nematodes per sample were collected in 300 μl of M9 buffer 24 . Samples were briefly washed in M9 buffer, to remove contaminating bacteria, and then fixed in 300 μl of 40% isopropanol for 5 min at room temperature. The isopropanol was removed and replaced with 300 μl of the Nile red staining solution. Samples were wrapped in foil and left at room temperature for 1 h. After staining, samples were washed twice with M9 buffer and mounted on microscope slides on agarose pads (2% v/v agarose). Neutral lipid stores were visualised with the GFP filter set (excitation 482, emission 505) using the Zeiss Axio Zoom V16 (Zeiss). Images were taken at the specified exposure times and processed using the Zen 2 software (v2). To quantify corrected total nematode fluorescence (CTNF) for 146 individuals, images were converted to TIFF and processed with ImageJ. 20 measurements were taken per phenotype per timepoint except for hermaphrodite day 0 (n = 19) day 1 (n = 16) and day 2 (n = 13) and mated female day 2 (n = 16). The CTNF was calculated per individual as described in 31 .
This data was analysed with a linear model with timepoint and sexual phenotype as predictor variables with a Gaussian distribution in R. Post-hoc tests were carried out using the emmeans package in R 27 .
The chemical manipulation of dauer development. In nematodes, entry into dauer is regulated by the binding of steroidal endocrine hormone Δ7-dafachronic acid (DA) to the nuclear hormone transcription factor DAF-12 [32][33][34] . In normal development DAF-9 (a cytochrome P450) synthesises high levels of DA, thereby blocking entry into dauer. In dauer-inducing conditions, DAF-9 inhibition results in low DA levels, facilitating DAF-12 mediated promotion of dauer development 35 . Addition of exogenous DA blocks dauer 36 while addition of specific inhibitor of DAF-9 (dafadine-A) forces entry into dauer 37 .
Δ7-dafachronic acid (DA) inhibition of dauer development. DA-mediated inhibition of dauer development was carried out as described in 36  www.nature.com/scientificreports/ 1 mM stock in 100% ethanol. Immediately before use, the DA stock was diluted in water to 10 µM DA (1% ethanol). 20 µl of 10 µM DA or 1% ethanol alone (control) were added directly to a 1 cm diameter E. coli OP50-1 lawn on NGM plates and plates dried for 2 h. Under crowded conditions, A. freiburgensis hermaphrodite mothers predominantly produce hermaphrodite offspring 11 . Therefore, eggs were transferred from crowded plates, to either DA or control plates (4 plates for each condition with approximately 30 eggs per plate) and incubated at 20 °C for 48 h, before the sex of the progeny was determined by phenotype. All non-male progeny was subsequently moved to NGM plates (without DA or ethanol) to continue development and examined daily for their intestinal phenotype. In total, 630 individuals were scored (409 with DA, 221 control) from 3 independent experiments.
Dafadine-A promotion of dauer development. Dafadine-A (Sigma-Aldrich) was prepared as a 10 mM stock in DMSO and added to molten NGM, to a final concentration of 10 µM dafadine A (0.1% DMSO v/v). Control plates were supplemented with the same final volume of DMSO (0.1% v/v). All plates were seeded with 50 µl of OP50-1 and incubated overnight at room temperature. At low population density, A. freiburgensis hermaphrodite mothers produce female and male offspring 11 . Therefore 'female-fated' eggs were isolated from uncrowded plates (as described above) and added to the bacterial lawn of NGM plates, supplemented with dafadine-A or DMSO alone (4 plates for each condition with approximately 30 eggs per plate). Plates were incubated at 20 °C for 48 h, before the sex of the progeny was determined by phenotype. Females were physically larger and had reached adulthood, whilst those converted to hermaphrodite remained in the dauer larval stage. All non-male progeny was subsequently moved to NGM plates (without dafadine-A or DMSO) to continue development and examined daily for intestinal phenotype. In total, 390 individuals were scored (201 with dafadine-A, 189 control) from 3 individual experiments.

Gene expression analysis.
De novo transcriptome assembly. Sample preparation. Three biological replicates were generated for each RNA-seq condition (unmated females and hermaphrodites). Females and hermaphrodites were identified as described above. Approximately 150 individuals at the day 2 stage of adulthood were collected per replicate into 1.5 ml tubes containing 200 µl of M9 buffer 24 . The nematodes were washed 3 times in M9 buffer. After the final wash, the supernatant was removed, 200 µl of Trizol® (Ambion) was added, and the sample stored at − 80 °C. RNA was extracted as described previously 38 . Residual genomic DNA was removed using Turbo DNase (Thermo Fisher Scientific) and samples cleaned with the RNA Clean and Concentrator kit (Zymo Research) according to the manufacturer's instructions. Libraries were prepared with the TruSeq RNA Library Prep Kit v2 (Illumina) by the Genomics Facility at Warwick University.
RNA sequencing and transcriptome assembly. RNA-seq was performed on the Illumina HiSeq 4000 platform, generating a mean of 24.3 million 150 base pair end reads per replicate (Wellcome Trust, Oxford, UK). General assessment of the RNA-seq libraries was performed using FastQC 39 and the raw reads from each library were pre-processed using Trimmomatic (version 0.36, TruSeq3-PE-2 adapters and the following parameters ("HEADCROP:15 SLIDINGWINDOW:5:20 MINLEN:36") 40 . De novo transcriptome assembly was conducted with Trinity (v 2.8.3) including the jaccard-clip parameter 41,42 . Potential contamination was removed using the DeconSeq program 43 and CD-HIT-EST was used to reduce redundancy in the assembly using a sequence identity threshold of 0.95 44 . In total 34,538,898 bases were assembled.
Differential gene expression and GO term analysis. Transcript abundance quantification was estimated within the Trinity software package 42 using the genome-free alignment-based quantification method RSEM 45 . Processed reads were aligned to the de novo transcriptome with Bowtie2 and transcript abundance was estimated with RSEM, all within the Trinity package (v2.8.3). Differential gene expression analysis was conducted with EdgeR (also within Trinity v2.8.3). An adjusted p-value of 0.01 and an absolute log2 fold change (FC) of 1 were used to define differentially expressed genes.
Normalisation gene identification and qRT-PCR analysis. Optimal normalisation genes were identified from the RNA-seq data using the NormFinder software 49 . This algorithm ranks candidate normalization genes according to their expression stability in all samples in a given experiment. Afr-myosin (TR7316|c0_g1_i1) and Afr-tubulin (TR12573|c1_g1_i1) were identified as the two top candidates. Afr-tubulin encodes for a tubulin-like protein (shares 98% identity with Cel-BEN-1) and Afr-myosin encodes for a myosin-like protein (shares 71% identity with Cel-HUM-5).
qRT-PCR analysis. Samples were collected and RNA extraction conducted as described above. RNA was treated with DNase I (Sigma) to remove residual genomic DNA. cDNA synthesis was performed with 0.5 µg of RNA using random primers (Promega) and the MMLV reverse transcriptase enzyme (Promega) following the manufacturer's instructions. qRT-PCR was conducted using the Stratagene Mx3005P detection system (Agilent Technologies) and GoTaq qPCR mix (Promega). Expression levels were calculated relative to the normalisation genes Afr-myosin or Afr-tubulin. All primer sequences used are listed in Supplemental Table S1.

Results
Unmated females exhibited mate-searching behaviour. If females and hermaphrodites are specialised in their roles, we would expect to see difference in their behaviours. Females, due to sexual morph specialisation 8 , would spend more time looking for a male. We tested this directly with behavioural assays measuring chemotaxis to male pheromones and food leaving behaviour. There was a significant interaction between sexual phenotype and age on whether animals were attracted to male pheromones (logistic regression: χ 2 = 10.113, d.f. = 4, p = 0.0386) (Fig. 2a). Unmated females exhibited a high level of attraction to male pheromones at all ages tested, while actively reproducing hermaphrodites showed no attraction. Mated females became increasingly attracted to the male pheromone as they became sperm depleted (approximately 48 h after mating (personal observation)) and began to lay unfertilised oocytes (z = − 2.390, p = 0.0444). By day 3, the chemotaxis index of mated females was comparable to that of virgin females (z = 1.748, p = 0.1875).
Nematodes are usually cultured in a Petri dish containing agar seeded in the centre with a patch of bacterial lawn used as a food source. Food-leaving behaviour, whereby individuals leave the abundant central food source to search surrounding areas of the culture plate where no food is present, is sometimes associated with the search of the nematode for a mating partner 28 . We found a significant interaction between sexual phenotype and time on food-leaving behaviour (χ 2 = 7.2928, d.f. = 2, p = 0.02608) (Fig. 2b). 48 h after the start of the experiment unmated females showed high levels of food-leaving behaviour compared to themselves at 24 h (t = 2.143 p = 0.0322) In contrast, no increase in leaving over time was observed in hermaphrodites (t = 0.581, p = 0.5614) or mated females (t = 1.431, p 0.1527), suggesting that female leaving was not driven by food depletion.

Females limit intestinal development until they mate.
We hypothesised that females compensate for investing in costly mate-searching, by redirecting resources from other processes. In nematodes, the intestine is the major metabolic organ 50 . Consistent with reduced investment in metabolism, A. freiburgensis virgin female intestines are less developed compared to hermaphrodites at the same developmental stage (Fig. 3).

Hermaphrodites have a larger intestine.
We hypothesised that the enlarged and specialised intestine of the hermaphrodite (and to a lesser extent the mated female) promotes increased nutrient absorption to meet the high energy demands of reproduction in A. freiburgensis. In C. elegans, excess energy is predominantly stored in neutral lipid vesicles in the intestine and epidermis 51 . We predicted that in A. freiburgensis, if the hermaphrodite www.nature.com/scientificreports/ intestine was better suited to nutrient uptake, hermaphrodites would have higher lipid stores than mated females in well-fed conditions. Although staining of live nematodes with the neutral lipid dye Nile red is problematic, due to the sequestering of ingested dye into lysosome-related organelles (LROs) 52 , Nile red staining of fixed samples faithfully highlights neutral lipid stores in C. elegans 53 and P. pacificus 54 . Therefore, we employed the fixed Nile red staining method 30 to study neutral lipid stores in unmated females, mated females and hermaphrodites. Age and sexual phenotype interactively had a significant effect on neutral lipid storage in A. freiburgensis (F 3,138 = 1.24 × 10 12 , p < 2 × 10 -16 ) (Fig. 4). Females entered adulthood (day 0) with high lipid stores, which were maintained if unmated (0-2 days: t = 0.901, p = 0.6406) but significantly decreased once they started to produce offspring (day 1 MF − VF: t = − 4.227, p = 0.001). As females are less likely to leave the food source once mated (Fig. 2B), depletion of energy stores is likely to be due to the redirection of resources and not due to reduced nutrient uptake. In contrast, hermaphrodite lipid store levels were low as they exited the non-eating dauer stage and entered adulthood (day 0) but rose steadily to significantly exceed those of unmated females by mid-adulthood (day 2) (H − VF : t = 5.222, p < 0.001). The hermaphrodite intestine may promote more efficient nutrient uptake as the elongated lumen and  www.nature.com/scientificreports/ longer microvilli could increase the surface area for absorption. Not only would this allow the hermaphrodite to replenish energy stores depleted during diapause, but it could facilitate the production of progeny in less nutrient-rich surroundings.

Passage through dauer links mating system and optimised intestinal morphology in A. freiburgensis.
At the L3d/L4 stage of larval development, the zigzag intestinal pattern resulting from the positioning of the pyramidal cells becomes apparent in hermaphrodites (Fig. 5a). In contrast, the L3 female intestinal cells are cuboid and the lumen straight. These differences in intestinal morphology continue into adulthood. As A. freiburgensis hermaphrodites pass through dauer, a larval stage where the C. elegans intestine undergoes remodelling 50 , we postulated that passage or bypassing of the dauer larval stage may regulate sexual morphspecific intestinal development. Therefore, we exploited the ability to chemically induce or inhibit dauer development to determine if passage through dauer was sufficient to modulate intestinal development (see methods for details). Previously, we have shown that addition of the hormone Δ7-dafachronic acid (DA) is sufficient to block dauer development in Auanema rhodensis 36 . To test if the dauer pathway can be manipulated in A. freiburgensis, hermaphrodite-fated eggs were collected from crowded plates and incubated either with DA (10 μM in 1% ethanol (v/v)) or on control plates (1% ethanol alone (v/v)). With supplemented DA, no dauers were observed (n = 409), whilst on control plates 86% non-males (n = 221) passed through dauer.
To determine if addition of the DAF-9 inhibitor dafadine-A 37 is able to promote the dauer fate in A. freiburgensis, female-fated eggs were collected from isolated hermaphrodite mothers and incubated, either on NGM plates with dafadine-A (10 μM, 0.1% DMSO (v/v)) or on control plates (0.1% DMSO alone (v/v)). In the presence of dafadine-A, all non-male progeny passed through dauer (n = 201). No dauers were observed on the control plates (n = 189). Consistent with previous studies 11 , all individuals that passed through dauer developed into hermaphrodites, whilst non-males that bypassed dauer became female adults.
Passage through dauer was sufficient to induce the hermaphrodite intestinal phenotype, regardless of whether individuals were female or hermaphrodite at hatching (Fig. 5b, c). Female-fated individuals that were chemically forced through dauer exhibited the pyramidal cell shape (Fig. 5b). In contrast, if dauer development was blocked in hermaphrodite-fated larvae, they exhibited the reduced intestine, straight lumen and intestinal cell shape of female larvae (Fig. 5c).
Females and hermaphrodites activate mate-finding and metabolism-related pathways. We carried out RNA-seq analysis to determine which biological pathways are differentially regulated between females and hermaphrodites. As we predicted that the major cost for females will be reproductive assurance, we compared unmated females with hermaphrodites at the same stage of adulthood (2 days of adulthood).
We identified 819 differentially expressed genes (with a cut-off of twofold change and p < 0.01), with 275 upregulated in females (Supplemental Table S2) and 544 upregulated in hermaphrodites (Supplemental Table S3).   www.nature.com/scientificreports/ Upregulated transcripts in hermaphrodites showed gene ontology (GO) term enrichment for genes associated with reproduction, embryo/larval development and ovulation (Supplemental Fig. S1). There was also enrichment for GO terms associated with metabolic processes (including lipid catabolism and proteolysis) and digestion. In addition, hermaphrodites showed enhanced expression of genes associated with cuticle development and defence responses. Many upregulated transcripts in the female were associated with signalling processes and neuronal regulation (Supplemental Fig. S2). Many of these genes have been directly implicated in mating and mate-searching behaviour (Table 1). Our data suggest that unmated females upregulate specific neuronal development and signalling pathways (see Table 1). If these pathways are a specific female adaptation to drive mate-searching behaviour, then mating should downregulate the expression of the identified neuronal/behavioural candidate genes. Therefore, we used qRT-PCR to analyse the expression of a subset of these candidate genes in virgin females, mated females and hermaphrodites, throughout peak egg production ( Fig. 6b-f, Supplemental Fig. S3). Candidates were chosen to include genes with suggested roles in chemotaxis/chemoattraction (Afr-deg-3 and Afr-des-2), reproduction linked neuropeptide production (Afr-ntc-1 and Afr-flp-1) and lawn leaving behaviour (Afr-tyra-3). All the neuronallinked candidates tested were suppressed in females after mating, often to the level observed in hermaphrodites. Interestingly, from day 2 to 3 of adulthood, the expression levels of many of the neuronal candidates increased in mated females, which coincided with most of these individuals ceasing egg laying, due to depletion of sperm stores. This suggests that this suite of genes can be reversibly repressed by reproduction. In contrast, Afr-ges-1, a homologue of the gut-specific esterase ges-1 55 is suppressed in females until reproduction starts (Fig. 6a).

Discussion
We hypothesised that the female (obligate outcrossing) and hermaphrodite (predominantly selfing) morphs of A. freiburgensis play distinct roles and that each exhibits adaptations to minimise the cost of their specific life history, allowing the stable maintenance of trioecy. Unmated females specialise in finding males, showing the upregulation of genes implicated in mate-finding, increased attraction to male pheromones and enhanced matesearching behaviour. Females may compensate for this high investment in mate finding by limiting metabolism and intestinal development till they are mated.
Hermaphrodites, on the other hand, have specialised in energy acquisition. Passage through a migratory larval state is sufficient to ensure that a hermaphrodite enters adulthood able to self-fertilise with several intestinal adaptations likely to promote nutrient uptake. The hermaphrodite's enlarged and specialised intestine could allow the individual to not only replenish energy stores depleted during migration, but also meet the high energy demands of reproduction. Consistent with hermaphrodite specialisation in energy acquisition they also show upregulation of genes involved in metabolic processes.
A. freiburgensis unmated females show upregulation of genes whose homologs are associated with chemoattraction, pheromone production, lawn-leaving and other mating behaviours [56][57][58][59][60][61] . Suppression of these genes in mated females and hermaphrodites correlated with reduced food patch leaving and chemoattraction behaviour in A. freiburgensis. Food patch leaving and attraction to male pheromones have been described in other obligate outcrossing nematodes, suggesting they represent conserved mate-searching traits 13 Ascaroside production TR20_c0_g1_i1 Afr-acox Regulates the dynamic balance of different pheromone production Zhang et al. 61 Joo et al. 59 Neuronal development TR6524_c1_g1_i1 Afr-alfa Loss of alfa-1 results in motor neuron degeneration Therrien et al. 78 Mating behaviour TR6910|c0_g1_i2 Afr-lov Male mating behaviour in C. elegans Barr and Sternberg 56 BBS proteins are expressed solely in the 60 ciliated sensory neurons TR15390_c0_g1_i1 Afr-bbs-9 Mutations in bbs-9 result in hyperactive endocrine signalling and misregulated neuropeptide secretion Lee et al. 79 Neuropeptide production and signalling regulation Li and Kim 80 Buntschuh et al. 81 Garrison et al. 58 Topalidou et al. 82 Positive regulation of movement TR6805_c0_g1_i1 TR11765_c0_g2_i1 Afr www.nature.com/scientificreports/ A. freiburgensis, mating suppresses many of these drives, including female lawn-leaving and attraction to male pheromones, indicating that these female behaviours are governed by reproductive status and are associated with the need to mate 13,28,62,64 .
In most organisms, mate-searching behaviour is predominantly associated with males, as females are thought to rarely require more than one mating to fertilise all their eggs 65 , in accordance with Bateman's gradient 66 . However, models predict that females could benefit from mate searching if females are at risk of not mating or would benefit from multiple matings [67][68][69] . As males are under-represented in A. freiburgensis populations and time-limited mated females became sperm depleted, natural selection could favour females who actively search for males.
Investment in mate-searching behaviour is costly. Our data suggest that unmated A. freiburgensis females may meet this cost by reallocation of resources from metabolism and intestinal expansion. Although adult tissue is often considered to be homeostatically maintained at a constant size, there are a growing number of examples of post-developmental organ plasticity to meet the energy demands of reproduction. Expansion of the alimentary tract during pregnancy and/or lactation has been observed in diverse mammalian species 70,71 , and hormones released post-mating in Drosophila promote an increase in the midgut (an organ which plays a similar role to the mammalian small intestine), enhancing reproductive output 72  www.nature.com/scientificreports/ expands post-mating in A. freiburgensis, it does not develop all the characteristics of the hermaphrodite intestine triggered by passage through dauer. Delayed or reduced intestinal development may explain why female lipid stores were depleted, whilst hermaphrodite levels increased, during peak egg reproduction. As A. freiburgensis females are predominantly produced in uncrowded conditions 11 when food supplies are likely to be plentiful, reducing intestinal development, and by association nutrient uptake, may be an 'acceptable' risk.
In conclusion, A. freiburgensis exhibits developmental and behavioural plasticity dependent upon sexual morph. In simple terms, females are not merely hermaphrodites who are unable to produce sperm, or vice versa. Although we cannot discount that trioecy in A. freiburgensis is an evolutionary transient state, it is feasible that selection for specific female and hermaphrodite adaptations drives the stable co-existence of both mating strategies. Trioecy has been identified in a growing number of animal species including; Hydra viridissima 73 , the marine mussel, Semimytilus algosus 74 and the sea anemone Aiptasia diaphana 75 . The study of sexual morph specialisation in this growing number of trioecious animal species will allow the development of more robust mathematical models to investigate the long-debated evolutionary enigma of mixed mating strategies.

Data availability
The data for this study have been deposited in the European Nucleotide Archive (ENA) at EMBL-EBI under accession number PRJEB50372 (https:// www. ebi. ac. uk/ ena/ brows er/ view/ PRJEB 50372). www.nature.com/scientificreports/