BACKGROUND
sex determination is the process by which an individual makes the developmental decision to become male or female.
unlike other fundamental processes in development, such as body patterning by hox genes  <cit> , the molecular mechanisms responsible for sex determination have not been conserved  <cit> .
instead, a plethora of sex determining strategies exist, varying greatly in the primary signal used in sex determination.
this diversity can be seen across the diptera alone, where the initial signal is genetic in drosophila melanogaster, environmental in sciara ocellaris and maternal in chrysomya rufifacies .
variation and fast turnover also occur in the genetic implementation of sex determining mechanisms.
the housefly musca domestica provides a striking example for evolutionary lability at this level.
in some populations, male development is triggered by the presence of masculinizing alleles with varying genomic location in some populations, whereas in other populations these factors are fixed and sex is based on the presence of a dominant feminizing allele at another locus  <cit> .
dipteran sex determination probably provides the best studied model for understanding the evolution of sex determining mechanisms.
particularly well described is the genetic cascade of d. melanogaster, in which sex is determined by a primary signal that is transmitted through a short cascade of regulatory genes and translated into sexual phenotypes via downstream transcription factors  .
in d. melanogaster, the primary signal is provided by a gene counting mechanism sensing the number of x chromosomes .
this primary input is translated into differential expression of splice forms of the switch gene sex-lethal .
female embryos express a fully functional sxl protein while males produce a shorter peptide that lacks an rna-binding domain.
the female protein sxlf maintains the master signal through an auto-regulatory self-splicing loop.
at the same time, sxlf transmits the female signal further down the cascade by ensuring that transformer  transcripts are spliced into a female-specific, functional, form.
the female traf protein, in turn, forms a heterodimer with tra <dig> protein to regulate the splicing of the transcription factor doublesex  mrna.
the resulting female variant dsxf regulates female differentiation of somatic tissue.
in males, the truncated sxlm has no regulatory effect, leading to the production of an equally inactive default splice variant of tra.
the presence of tram , results in the production of default male forms of the downstream target dsx, dsxm.
tra also regulates the splicing of another transcription factor fruitless.
a sex-specific mrna of this gene is produced in males that contributes to differentiation of male nervous tissue.
a comparison between the drosophila sex determining cascade and those of the closely related families tephritidae and muscidae  illustrates how sex determining cascades evolved from the bottom up  <cit> .
the downstream genes tra and dsx are used by all three groups.
only drosophila uses the switch gene sxl which appears to have been recruited recently to the top of the cascade.
the ancestral condition is present in the tephritidae and muscidae, which uses tra and a tra-orthologue, respectively, as the switch gene  <cit> .
the tra gene in these species maintains its signal through a self-splicing loop operated by the tra/tra <dig> heterodimer.
this mechanism is common among the diptera  <cit>  and might be an ancestral element of the sex determining cascade across the insects  <cit> , as indicated by the discovery in honeybees of a conserved gene with homology to tra  <cit> .
outside the insects, there is no evidence for tra involvement in sex determination.
homologues of the downstream target dsx, however, have been identified not only in other insects  <cit>  but also in worms and mammals  <cit> .
this suggests that dsx has been involved in sex determination for a very long time  <cit> .
it is unclear what general principles underlie the bottom-up evolution of sex determining mechanisms or whether indeed such general principles exist  <cit> .
however, adaptive scenarios have been proposed that provide plausible adaptive scenarios for the the recruitment of sxl to the drosophila cascade  <cit> .
in this paper, we investigate the molecular changes to the drosophila sex determining cascade due to the recruitment of sxl.
we use sequences from twelve drosophila species, a sample of species from the tephritidae, as well as musca domestica to infer patterns of selection on the coding regions of sex determining genes.
thanks to the detailed molecular knowledge of sex determination in d. melanogaster and the simple structure of the genetic cascade, we are able to formulate clear hypotheses for the consequences of recruitment of sxl on the molecular evolution of sxl itself and its downstream targets.
hypotheses about the patterns of molecular evolution in drosophila sxl can be derived from the evolutionary origin of the gene.
evidence suggests that the recruitment of sxl coincided with a gene duplication event  <cit>  that gave rise to sxl and its paralogue cg <dig>  now named sister-of-sex-lethal   <cit> .
both drosophila genes and their orthologue in the tephritidae contain two rna recognition motifs  .
drosophila sxl encodes an additional n-terminal protein domain, the 'sxl-specific domain' .
truncated proteins lacking this domain show the same binding affinity as the full sxl protein, but fail to induce female-specific self-splicing of sxl transcripts  <cit> .
the presence of the sxl-specific domain in drosophila, together with the fact that neither ssx in drosophila nor the sxl orthologue in the tephritidae and muscidae show sex-specific expression or splicing  <cit>  suggest neo-functionalization of the drosophila sxl duplicate  <cit> .
according to this hypothesis, the common ancestor of drosophilidae and tephritidae would have employed a sex determining mechanism similar to that used by the tephritidae today  <cit> ; following duplication in the drosophila lineage, sxl then adapted to its new role in sex determination while the paralogue ssx retained the ancestral, non-sex specific function.
based on this scenario, we would expect a signature of adaptation under positive selection in drosophila sxl but comparable levels of purifying selection on tephritid sxl and drosophila ssx.
a recent study has put forward an alternative scenario for the evolution of sxl and ssx  <cit> , whereby sxl would have acquired a new role in sex determination while retaining its ancestral, sex-independent function, whereas ssx would have neo-functionalized to take on roles not previously performed by sxl.
this scenario is based on the observations that loss of ssx had no significant negative effect in fly viability or fertility combined with the discovery of a conserved, non-sex-specific splice variant of sxl.
under this scenario, we would expect signals of positive selection in both ssx and drosophila-sxl, while tephritid sxl would have evolved under purifying selection.
we also predict an effect of sxl recruitment on the evolution of the downstream genes in the sex determining cascade.
in drosophila, sxl took over the memory function previously held by tra.
this should have led to evolutionary change at two levels.
first, we expect relaxation of selection on amino acids involved in the now obsolete self-splicing of tra.
whether this will result in changes in the tra coding sequence depends on the degree to which the self-splicing mechanism differs from the interaction of tra/tra <dig> with its regulatory targets dsx and fru.
the high degree of similarity between tra/tra <dig> binding sites in the intronic sequences of tra outside of drosophila   <cit>  and in dsx  <cit>  and fru  <cit>  within and outside of drosophila  suggest similar splicing mechanism.
the evolutionary loss of tra self-splicing in drosophila then might not have resulted in changes in its amino acid sequence.
however, there is also evidence that the self-splicing mechanism involves a protein complex including not only tra/tra <dig> and rbp <dig> but also an as yet unknown factor .
tra coding regions involved in the interactions with these proteins would then be free to erode after sxl recruitment rendered tra self-splicing redundant.
second, we expect adaptive change to accommodate the new splicing regulation of tra through sxl.
as this regulation in drosophila occurs via the binding of sxl to a non-coding region of tra transcripts, adaptation of tra is expected to have occurred at the level of non-coding  rather than coding sequences.
adaptive evolution in response to the recruitment of drosophila sxl is not expected at the bottom gene of the cascade, as dsx does not directly interact with sxl and the functional link between tra and dsx is unaffected by sxl recruitment.
if at all, the recruitment of sxl might have allowed fine-tuning of the sex-specific signal of dsx in drosophila  <cit> , which would be evident in its relative expression in males and females rather than in changes in the coding sequence.
RESULTS
molecular evolution of sxl
we analyzed patterns of molecular evolution by applying phylogenetic maximum likelihood models implemented in paml  <cit>  to sequence alignments of sex determining genes .
the mode of selection acting on coding sequences  was inferred by estimating the ω = dn/ds ratio that compares the rates of non-synonymous and synonymous mutations.
an ω ratio smaller than one indicates that sequences are under purifying selection, where non-synonymous mutations are eliminated from the gene-pool and hence fixed at a lower rate than synonymous mutations; an ω ratio equal to one occurs in neutrally evolving sequences where drift affects synonymous and non-synonymous mutations to the same extent; finally, an ω ratio greater than one occurs in sequences under positive selection, where non-synonymous mutations have a greater chance of reaching fixation than synonymous mutations.
we first inferred selection on sxl associated with its recruitment to the sex determining pathway of drosophila by analyzing an alignment of sxl sequences from the drosophila species, the tephritidae and m. domestica .
before analyzing evolutionary patterns specifically associated with sxl recruitment, we tested for global patterns of neutral evolution and positive selection along all branches of the tree .
we detected a proportion of amino acids that evolve neutrally , but there was no evidence for the evolution of amino acids under positive selection across all taxa studied .
a alternative and null models, see additional file  <dig>  table s <dig> for more information on models and log-likelihood values, b p value calculated from a χ <dig> distribution, c number of sites significant in bayesian post-hoc tests , d clade consisting of all species excluding drosophila.
the alignment, after deleting gaps, was composed of  <dig> codons.
tests that we deemed weakly significant because bayesian post-hoc tests did not detect relevant aa are shown in italics.
we then looked for signatures of selection during sxl's recruitment to the sex determining cascade.
we tested for a signal of relaxed selection on the basal branch leading to the drosophila clade, i.e., identifying amino acids that evolve neutrally on the basal branch but are under purifying selection on the rest of the tree.
this test was significant  revealing an evolutionary shift from purifying selection to neutral evolution on the branch leading to the drosophila clade.
given the signature of relaxed purifying selection, we then tested for the signal of positive selection on the basal drosophila branch, seeking to identify sites that are under positive selection on that branch but evolve neutrally or are under purifying selection on the rest of the tree.
we found significant evidence of positive selection .
furthermore, posterior bayesian analysis provided evidence for adaptive fixation of  <dig> amino acids  .
taken together, these tests indicate that the recruitment of sxl to the drosophila sex determining cascade coincided with release from selective constraint and adaptive changes in the protein sequence.
as a comparison, the same tests were applied to assess selection specific to the basal branch of the tephritid clade.
the test for positive selection was significant , but bayesian analysis did not identify any site under positive selection .
the failure to identify selected codons by bayesian estimation does not provide reliable evidence for positive selection on the branch leading to the tephritidae.
inconsistent results of this type can occur whenever codons cannot be unambiguously allocated to a particular class of sites .
our data therefore provide, at best, weak evidence for positive selection at the root of the tephritidae, in contrast to strong evidence for positive selection at the root of the drosophila clade.
the previous tests investigated the selective signatures of substitutions along the branch coinciding with sxl's recruitment to the sex determining cascade.
we also performed tests to investigate patterns of evolutionary change following the recruitment to sex determination.
a first test sought to identify sites that are under relaxed selection along all branches of the drosophila clade but under purifying selection elsewhere in the tree.
this test was significant , but again no individual amino acid was identified by site-specific bayesian tests.
evidence for relaxed selection of sxl in the drosophila clade is therefore inconclusive.
in contrast to this, we obtained highly significant results for the mirror model, which identified amino acids that are under purifying selection in drosophila but evolve neutrally across the rest of the clade.
moreover, bayesian posterior tests provided robust evidence for relaxation of purifying selection affecting  <dig> sites .
tests for positive selection either along the internal branches of the drosophila clade or the rest of the tree were non-significant.
together this evidence suggests that the main evolutionary change to sxl after its recruitment to drosophila sex determination was a relative strengthening of purifying selection.
the absence of recurrent positive adaption within the drosophila clade indicates that adaptive change of sxl to its new role in sex determination occurred prior to the divergence of the drosophila species.
molecular evolution of the sxl paralogue ssx
we investigated selection pressures associated with the duplication of sxl in drosophila by analysing an alignment including drosophila sxl and ssx as well as their orthologue sxl in the tephritidae .
analysis of selection on specific sites along all branches provided evidence for neutrally evolving sites over the whole tree  but the test for tree-wide positive selection was not significant .
branch-site models on the branch leading from the sxl/ssx split to the ssx clade in drosophila provided evidence for the adaptive fixation of  <dig> amino acids on the ancestral branch .
in addition, the test for local relaxation across the ssx clade, rather than the basal branch only, was significant  and identified  <dig> codons that evolve under purifying selection in sxl, but neutrally in ssx.
so we find evidence from two different tests: adaptive fixation of some amino acids on the ancestral branch of ssx  which is followed by neutral evolution of some amino acids in the clade .
because nine of the  <dig> amino acids that were inferred by bayesian analysis to have been positively fixed at the sxl/ssx split were also found to evolve neutrally once fixed in the ssx clade, they are likely characteristic of sxl evolution rather than ssx evolution.
there remains consistent evidence of nine amino acids fixing under positive selection for ssx.
our results suggest that adaptive evolution following the gene duplication in drosophila was not restricted to sxl, as extensive ancestral adaptive evolution was observed for amino acids of the paralogue ssx.
a alternative and null models, see additional file  <dig>  table s <dig> for more information on models and log-likelihood values, b p value calculated from a χ <dig> distribution, c number of sites significant in bayesian post-hoc tests .
the alignment, after deleting gaps, was composed of  <dig> codons.
molecular evolution of downstream sex determining genes
we performed analyses designed to detect changes in the pattern of molecular evolution of the downstream sex determining genes tra and dsx, coinciding with the recruitment of sxl in drosophila.
for tra, we analyzed an alignment of drosophila and tephritid sequences .
we found evidence for site-specific neutral evolution .
the likelihood ratio test for local relaxation on the basal branch  was significant, but no amino acid was found to have evolved neutrally on that branch , so the overall evidence for relaxation on the basal branch alone is weak.
tests of local relaxation of selective constraint were significant for both clades .
the effect was quantitatively stronger in the drosophila clade than in the tephritidae ;  <dig> sites were inferred to evolve neutrally in drosophila, but only  <dig> in the tephritidae.
taken together, these results show that the recruitment of sxl to the sex determining cascade coincided with a significant loosening of selective constraint in the drosophila clade.
a alternative and null models, see additional file  <dig>  table s <dig> for more information on models and log-likelihood values, b p value calculated from a χ <dig> distribution, c number of sites significant in bayesian post-hoc tests .
the alignment, after deleting gaps, was composed of  <dig> codons.
tests that we deemed weakly significant because bayesian post-hoc tests did not detect relevant aa are shown in italics.
the evidence for a relaxed purifying selection in drosophila tra is corroborated by the pattern of insertions and deletions  for tra that is not taken into account by paml's analysis of coding sequences.
first, the coding sequence of the tra protein is on average much shorter in drosophila than in the tephritids .
whilst some indels appear to be species-specific, we observe four substantial domains  that are conserved in all tephritid species but absent in all drosophila species .
these represent indel events that have most likely taken place on the ancestral branch dividing the two clades.
the difference in mean coding length between the two clades is  <dig> nucleotides, so the  <dig> ancestral indels make up a significant share of this length difference.
these important structural changes in the protein provide further evidence for the relaxation of purifying selection on tra coinciding with the recruitment of sxl in the sex determination network.
a indel rate was calculated for each pair of species within a clade by dividing the number of indel sites by the number of nucleotides in the pairwise alignment, then further dividing by the branch length between the two species estimated using the dsx gene.
in addition to a general shortening, we observe much greater variance in the length of the tra protein between drosophila than between tephritid species .
this again suggests weaker purifying selection against indels, or less consistent selection across drosophila species.
the comparison between drosophila and the tephritidae is potentially confounded by differences in branch length  between the clades.
to control for this effect, pairwise comparisons were made within each clade, and the number of indels per site was scaled by the branch lengths separating each pair of species.
based on these data, we found that the rate of indels is higher in the drosophila than the tephritid clade .
in addition, the variance in the indel rate was much higher in the drosophila than the tephritid clade .
from a statistical point of view these tests are not entirely rigorous, as they do not take into account the inter-dependence between the data points derived from overlapping pairs of species.
however, the large difference observed, in particular in the variance in indel rates, suggests that the evolutionary processes are not identical in the two clades, with lower evolutionary constraint in the drosophila clade.
we finally analyzed patterns of molecular evolution in the dsx gene.
the lower rate of change in dsx allowed us to include the gene sequence from m. domestica in our analysis, without removing an excess of amino acids due to alignment gaps .
as with sxl and tra, analyses based on site models revealed that some sites evolve neutrally across the entire tree , but there was no evidence for consistent positive selection .
including the sequences from m. domestica allowed us to root the split between the drosophila and tephritid clades.
a alternative and null models, see additional file  <dig>  table s <dig> for more information on models and log-likelihood values, b p value calculated from a χ <dig> distribution, c number of sites significant in bayesian post-hoc tests .
the alignment, after deleting gaps, was composed of  <dig> codons.
applying tests to infer changes in selection on the basal branches leading to the drosophila and tephritid clades, we detected evidence for positive selection along both branches , with  <dig> and  <dig> sites being identified as targets in drosophila and the tephritidae, respectively.
comparing the evolution of the gene within and outside of drosophila, we found evidence for relaxation of purifying selection at a small proportion of sites within drosophila  and in the outgroup .
type i error in the inference of positive selection
although our analyses provide evidence for adaptation at some point in the phylogeny of every gene except tra, caution is required when inferring past selection from dna sequences.
when sequences are very divergent, the occurrence of multiple substitutions at a site  can cause the rate of synonymous substitutions  to be under-estimated.
this, in turn, results in an inflated dn/ds ratio and the inference of spurious positive selection.
problems of this kind are unlikely to affect our results because the mle methods used here estimate the most likely dn/ds ratio based on patterns of substitutions along all branches of a tree and have been shown to be significantly more powerful and reliable for inferring ancestral positive selection than counting methods comparing pairs of sequences  <cit> .
in order to formally rule out effects of saturation on our results, we performed extensive simulations in an approach previously taken by studer et al.
.
these simulations seek to estimate the type i error in a conservative scenario.
we generated artificial alignments by simulating sequence evolution along the tree of the original sequences using the parameters of the null models  for all genes.
to make the test conservative, the risk of saturation was artificially increased by multiplying the number of substitutions per codon on the tested branch by a factor of  <dig> .
for each gene, a set of  <dig> simulated alignments was analyzed for positive selection using the same tests as in the original analyses.
the highest rate of false positives observed in our conservative approach was 1% , indicating that our inferences of positive selection are extremely unlikely to be due to type i error.
discussion
in this paper we investigated the changes in the patterns of molecular evolution evolution of sex determining genes associated with the recruitment of sxl to the top of the drosophila sex determining cascade.
we analyzed the evolution of sxl itself, its drosophila paralogue ssx, and the downstream targets tra and dsx, using sequences from species of drosophila and their sister clade the tephritidae, as well as m. domestica.
drosophila sxl is thought to have originated through duplication on the branch leading to the drosophila clade  <cit> .
the ancestral function of sxl, and its current function in the diptera outside drosophila are not known to be associated with sex determination  <cit> .
two hypotheses have been put forward as to how new and ancestral functions were shared between the two drosophila paralogues sxl and ssx.
traut et al.
<cit>  proposed that sxl neo-functionalized to its sex determining role whereas the paralogue ssx would have maintained the ancestral functions.
alternatively, cline et al.
<cit>  suggested sxl would take on a new sex determining function while simultaneously both sxl and ssx would sub-functionalize to share non sex-specific functions ancestrally performed by sxl.
based on our analyses and including previous findings, it is now possible to weigh up the relative merits of these two evolutionary scenarios.
the fact that sxl has undergone significant changes is not contentious.
it is clear that the gene has adapted to its new sex determining role by the addition of a new domain and the evolution of sophisticated rna splicing.
our analyses have shown that sxl has undergone adaptive evolution in its coding sequence at a limited number of amino acids, followed by a tightening of purifying selection on the protein sequence.
it seems furthermore likely that sxl has retained an ancestral function, an interpretation that is supported by the fact that one of the sxl transcripts in drosophila lacks the sxl-specific domain and is expressed in both sexes  <cit> .
but in the light of our findings it is now also clear that ssx has undergone adaptive evolution.
thus, we have shown that the gene shows a signature of adaptive change as well as a release from purifying selection on its coding sequence, resulting in a protein that differs significantly from both its paralogue in drosophila and its orthologue in the tephritidae.
this finding is in line with cline et al.
's  <cit>  hypothesis of sub-functionalization.
adaptation in both genes could further indicate that the duplication of sxl allowed for the alleviation of 'adaptive conflict'  <cit>  previously imposed by the double function of the ancestral gene.
establishing whether this is the case, however, will require more detailed information on the non sex-specific functions of drosophila sxl and ssx and their orthologue in other dipteran species.
our analyses were also able to shed some light on the repercussions of sxl recruitment in the patterns of molecular evolution of genes further down the sex determining cascade.
the protein evolution observed in drosophila tra is characterized by extensive neutral evolution and high rates of indels.
these results echo those found by a previous study using a smaller number of species  <cit> .
the evidence for sequence degradation adds to the inferred loss of the putative auto-regulation domain in drosophila tra  <cit> , and corroborates the view that the recruitment of sxl as the main sex switch gene relieved the pressure of purifying selection on tra.
whether the relaxation of selection on drosophila tra outside the specific auto-regulatory domain is due to the loss of the sexual memory function is difficult to ascertain.
the tra/tra <dig> binding sites in drosophila dsx and fru are well conserved  <cit> , implying that tra's regulatory function is still required.
there are, however, suggestions that the auto-regulation of tra is more complicated than its regulation of dsx  <cit> ; rather than forming an enhancing complex with tra <dig> as for dsx pre-mrna, the tra protein silences expression in tra pre-mrna.
regions of the protein only involved in these specific auto-regulatory mechanisms would be free to erode after recruitment of sxl in drosophila.
there is also the additional  possibility that the relaxation of purifying selection on tra sequence is the result of sxl taking over other sex-specific regulatory functions.
over thirty potential functional binding sites for sxl have been found in drosophila  <cit> , some of these may have been ancestrally regulated by tra.
the loss of these functional links from tra could have relieved it from selection pressure.
since drosophila sxl was sex specifically spliced by tra before it was promoted to top regulator in the sex determining cascade  <cit> , there has been a relatively long evolutionary time for sxl and tra to exchange various functions, potentially selected for their effectiveness of specific target splicing.
in that light it would be interesting to compare the putative targets of sxl in drosophila with those of tra outside of drosophila.
overlap between these two sets would support this hypothesis.
taken together, our results indicate that the adaption of tra to its new regulatory role in somatic sex determination , did not require positively selected amino acid substitutions, but rather the degradation of redundant parts of the protein-coding sequence.
this partial erosion was complemented with selective changes elsewhere in the gene sequence.
thus, we observe changes in the non-coding sequence, where we see the emergence and conservation of a sxl binding site in intronic sequences of drosophila tra .
the evolution of sxl and tra in drosophila can be compared with a different change in the top regulator in honeybees.
in this group, female development is driven complementary sex determiner , a switch gene specific to the genus apis.
sex determination in honeybees is haplodiploid, with females heterozygous and males hemizygous at the csd locus.
similar to drosophila sxl, csd arose by duplication of feminizer , the ancestral top regulator and orthologue of tra  <cit> .
in contrast to drosophila, where sxl underwent a short bout of adaptation on its recruitment and tra shows evidence of relaxed selection, csd in honeybees has undergone continued positive selection since its creation by duplication, whereas fem has experienced tightening purifying selection.
presumably, it is the requirement for heterozygosity in females that drives continued change in the amino acid sequence of csd  <cit> .
the strong purifying selection on fem has been attributed to potentially deleterious effects of unspecific protein-protein interactions that could arise from amino acid changes  <cit> .
our results suggest that such deleterious effects either play a lesser role in drosophila or are compensated by the benefit of mutations degrading tra functions that have become redundant since the recruitment of sxl.
we also found evidence for positive selection and relaxed purifying selection in dsx, the transcription factor translating the sex determining signal into sex-specific gene expression and differentiation.
this was detected both in the drosophila and in the tephritidae .
furthermore, a preliminary analysis found evidence for positive selection in fruitless , a gene with a similar position to dsx in the sex determining cascade that is directly regulated by tra .
the evidence for widespread adaptive evolution in the downstream target genes of sex determination in drosophila is surprising as neither dsx nor fru interact with sxl and both should therefore be unaffected by the recruitment of sxl.
in the tephritidae, adaptive change is even more surprising, as it occurs in the absence of any  topological change in the sex determining cascade.
the results therefore suggest that although dsx is conserved in function and sequence across a large part of the animal tree  <cit> , continuous evolutionary change occurs independent of topological changes in the network.
it is unclear what forces might generate positive selection on downstream sex determining genes  <cit> .
CONCLUSIONS
in this study, we have shown that the recruitment of sxl to the drosophila sex determining cascade has coincided with changes in the evolution of the sxl gene itself, its paralogue ssx and the downstream genes involved in sex determination, tra, dsx and fru.
studying a well-known and relatively simple gene cascade has enabled us to relate and confront the evolution of a network structure with the direction of selection on the amino acids of the genes participating in that network.
patterns of molecular evolution of amino acids in relation to network changes  in drosophila emerge from our analysis, notably the sub-functionalization of sxl and ssx, and the degeneration of tra, along with the ongoing evolution of dsx in drosophila and the tephritidae.
future experimental work will hopefully shed more light on this issue, notably by investigating the molecular function of sxl splice forms that are produced equally in both sexes and so may perform one the of the ancestral function of the gene.

 sex determination is the process by which an individual makes the developmental decision to become male or female. unlike other fundamental processes in development, such as body patterning by hox genes, the molecular mechanisms responsible for sex determination have not been conserved. instead, a plethora of sex determining strategies exist, varying greatly in the primary signal used in sex determination. this diversity can be seen across the diptera alone, where the initial signal is genetic in drosophila melanogaster, environmental in sciara ocellaris and maternal in chrysomya rufifacies. variation and fast turnover also occur in the genetic implementation of sex determining mechanisms. the housefly musca domestica provides a striking example for evolutionary lability at this level. in some populations, male development is triggered by the presence of masculinizing alleles with varying genomic location in some populations, whereas in other populations these factors are fixed and sex is based on the presence of a dominant feminizing allele at another locus. dipteran sex determination probably provides the best studied model for understanding the evolution of sex determining mechanisms. particularly well described is the genetic cascade of d. melanogaster, in which sex is determined by a primary signal that is transmitted through a short cascade of regulatory genes and translated into sexual phenotypes via downstream transcription factors. in d. melanogaster, the primary signal is provided by a gene counting mechanism sensing the number of x chromosomes. this primary input is translated into differential expression of splice forms of the switch gene sex-lethal. female embryos express a fully functional sxl protein while males produce a shorter peptide that lacks an rna-binding domain. the female protein sxlf maintains the master signal through an auto-regulatory self-splicing loop. at the same time, sxlf transmits the female signal further down the cascade by ensuring that transformer transcripts are spliced into a female-specific, functional, form. the female traf protein, in turn, forms a heterodimer with tra protein to regulate the splicing of the transcription factor doublesex mrna. the resulting female variant dsxf regulates female differentiation of somatic tissue. in males, the truncated sxlm has no regulatory effect, leading to the production of an equally inactive default splice variant of tra. the presence of tram, results in the production of default male forms of the downstream target dsx, dsxm. tra also regulates the splicing of another transcription factor fruitless. a sex-specific mrna of this gene is produced in males that contributes to differentiation of male nervous tissue. a comparison between the drosophila sex determining cascade and those of the closely related families tephritidae and muscidae illustrates how sex determining cascades evolved from the bottom up. the downstream genes tra and dsx are used by all three groups. only drosophila uses the switch gene sxl which appears to have been recruited recently to the top of the cascade. the ancestral condition is present in the tephritidae and muscidae, which uses tra and a tra-orthologue, respectively, as the switch gene. the tra gene in these species maintains its signal through a self-splicing loop operated by the tra/tra heterodimer. this mechanism is common among the diptera and might be an ancestral element of the sex determining cascade across the insects, as indicated by the discovery in honeybees of a conserved gene with homology to tra. outside the insects, there is no evidence for tra involvement in sex determination. homologues of the downstream target dsx, however, have been identified not only in other insects but also in worms and mammals. this suggests that dsx has been involved in sex determination for a very long time. it is unclear what general principles underlie the bottom-up evolution of sex determining mechanisms or whether indeed such general principles exist. however, adaptive scenarios have been proposed that provide plausible adaptive scenarios for the the recruitment of sxl to the drosophila cascade. in this paper, we investigate the molecular changes to the drosophila sex determining cascade due to the recruitment of sxl. we use sequences from twelve drosophila species, a sample of species from the tephritidae, as well as musca domestica to infer patterns of selection on the coding regions of sex determining genes. thanks to the detailed molecular knowledge of sex determination in d. melanogaster and the simple structure of the genetic cascade, we are able to formulate clear hypotheses for the consequences of recruitment of sxl on the molecular evolution of sxl itself and its downstream targets. hypotheses about the patterns of molecular evolution in drosophila sxl can be derived from the evolutionary origin of the gene. evidence suggests that the recruitment of sxl coincided with a gene duplication event that gave rise to sxl and its paralogue cg now named sister-of-sex-lethal. both drosophila genes and their orthologue in the tephritidae contain two rna recognition motifs. drosophila sxl encodes an additional n-terminal protein domain, the'sxl-specific domain'. truncated proteins lacking this domain show the same binding affinity as the full sxl protein, but fail to induce female-specific self-splicing of sxl transcripts. the presence of the sxl-specific domain in drosophila, together with the fact that neither ssx in drosophila nor the sxl orthologue in the tephritidae and muscidae show sex-specific expression or splicing suggest neo-functionalization of the drosophila sxl duplicate. according to this hypothesis, the common ancestor of drosophilidae and tephritidae would have employed a sex determining mechanism similar to that used by the tephritidae today; following duplication in the drosophila lineage, sxl then adapted to its new role in sex determination while the paralogue ssx retained the ancestral, non-sex specific function. based on this scenario, we would expect a signature of adaptation under positive selection in drosophila sxl but comparable levels of purifying selection on tephritid sxl and drosophila ssx. a recent study has put forward an alternative scenario for the evolution of sxl and ssx, whereby sxl would have acquired a new role in sex determination while retaining its ancestral, sex-independent function, whereas ssx would have neo-functionalized to take on roles not previously performed by sxl. this scenario is based on the observations that loss of ssx had no significant negative effect in fly viability or fertility combined with the discovery of a conserved, non-sex-specific splice variant of sxl. under this scenario, we would expect signals of positive selection in both ssx and drosophila-sxl, while tephritid sxl would have evolved under purifying selection. we also predict an effect of sxl recruitment on the evolution of the downstream genes in the sex determining cascade. in drosophila, sxl took over the memory function previously held by tra. this should have led to evolutionary change at two levels. first, we expect relaxation of selection on amino acids involved in the now obsolete self-splicing of tra. whether this will result in changes in the tra coding sequence depends on the degree to which the self-splicing mechanism differs from the interaction of tra/tra with its regulatory targets dsx and fru. the high degree of similarity between tra/tra binding sites in the intronic sequences of tra outside of drosophila and in dsx and fru within and outside of drosophila suggest similar splicing mechanism. the evolutionary loss of tra self-splicing in drosophila then might not have resulted in changes in its amino acid sequence. however, there is also evidence that the self-splicing mechanism involves a protein complex including not only tra/tra and rbp but also an as yet unknown factor. tra coding regions involved in the interactions with these proteins would then be free to erode after sxl recruitment rendered tra self-splicing redundant. second, we expect adaptive change to accommodate the new splicing regulation of tra through sxl. as this regulation in drosophila occurs via the binding of sxl to a non-coding region of tra transcripts, adaptation of tra is expected to have occurred at the level of non-coding rather than coding sequences. adaptive evolution in response to the recruitment of drosophila sxl is not expected at the bottom gene of the cascade, as dsx does not directly interact with sxl and the functional link between tra and dsx is unaffected by sxl recruitment. if at all, the recruitment of sxl might have allowed fine-tuning of the sex-specific signal of dsx in drosophila, which would be evident in its relative expression in males and females rather than in changes in the coding sequence.  molecular evolution of sxl we analyzed patterns of molecular evolution by applying phylogenetic maximum likelihood models implemented in paml to sequence alignments of sex determining genes. the mode of selection acting on coding sequences was inferred by estimating the ω = dn/ds ratio that compares the rates of non-synonymous and synonymous mutations. an ω ratio smaller than one indicates that sequences are under purifying selection, where non-synonymous mutations are eliminated from the gene-pool and hence fixed at a lower rate than synonymous mutations; an ω ratio equal to one occurs in neutrally evolving sequences where drift affects synonymous and non-synonymous mutations to the same extent; finally, an ω ratio greater than one occurs in sequences under positive selection, where non-synonymous mutations have a greater chance of reaching fixation than synonymous mutations. we first inferred selection on sxl associated with its recruitment to the sex determining pathway of drosophila by analyzing an alignment of sxl sequences from the drosophila species, the tephritidae and m. domestica. before analyzing evolutionary patterns specifically associated with sxl recruitment, we tested for global patterns of neutral evolution and positive selection along all branches of the tree. we detected a proportion of amino acids that evolve neutrally, but there was no evidence for the evolution of amino acids under positive selection across all taxa studied. a alternative and null models, see additional file table s for more information on models and log-likelihood values, b p value calculated from a χ distribution, c number of sites significant in bayesian post-hoc tests, d clade consisting of all species excluding drosophila. the alignment, after deleting gaps, was composed of codons. tests that we deemed weakly significant because bayesian post-hoc tests did not detect relevant aa are shown in italics. we then looked for signatures of selection during sxl's recruitment to the sex determining cascade. we tested for a signal of relaxed selection on the basal branch leading to the drosophila clade, i.e., identifying amino acids that evolve neutrally on the basal branch but are under purifying selection on the rest of the tree. this test was significant revealing an evolutionary shift from purifying selection to neutral evolution on the branch leading to the drosophila clade. given the signature of relaxed purifying selection, we then tested for the signal of positive selection on the basal drosophila branch, seeking to identify sites that are under positive selection on that branch but evolve neutrally or are under purifying selection on the rest of the tree. we found significant evidence of positive selection. furthermore, posterior bayesian analysis provided evidence for adaptive fixation of amino acids. taken together, these tests indicate that the recruitment of sxl to the drosophila sex determining cascade coincided with release from selective constraint and adaptive changes in the protein sequence. as a comparison, the same tests were applied to assess selection specific to the basal branch of the tephritid clade. the test for positive selection was significant, but bayesian analysis did not identify any site under positive selection. the failure to identify selected codons by bayesian estimation does not provide reliable evidence for positive selection on the branch leading to the tephritidae. inconsistent results of this type can occur whenever codons cannot be unambiguously allocated to a particular class of sites. our data therefore provide, at best, weak evidence for positive selection at the root of the tephritidae, in contrast to strong evidence for positive selection at the root of the drosophila clade. the previous tests investigated the selective signatures of substitutions along the branch coinciding with sxl's recruitment to the sex determining cascade. we also performed tests to investigate patterns of evolutionary change following the recruitment to sex determination. a first test sought to identify sites that are under relaxed selection along all branches of the drosophila clade but under purifying selection elsewhere in the tree. this test was significant, but again no individual amino acid was identified by site-specific bayesian tests. evidence for relaxed selection of sxl in the drosophila clade is therefore inconclusive. in contrast to this, we obtained highly significant results for the mirror model, which identified amino acids that are under purifying selection in drosophila but evolve neutrally across the rest of the clade. moreover, bayesian posterior tests provided robust evidence for relaxation of purifying selection affecting sites. tests for positive selection either along the internal branches of the drosophila clade or the rest of the tree were non-significant. together this evidence suggests that the main evolutionary change to sxl after its recruitment to drosophila sex determination was a relative strengthening of purifying selection. the absence of recurrent positive adaption within the drosophila clade indicates that adaptive change of sxl to its new role in sex determination occurred prior to the divergence of the drosophila species. molecular evolution of the sxl paralogue ssx we investigated selection pressures associated with the duplication of sxl in drosophila by analysing an alignment including drosophila sxl and ssx as well as their orthologue sxl in the tephritidae. analysis of selection on specific sites along all branches provided evidence for neutrally evolving sites over the whole tree but the test for tree-wide positive selection was not significant. branch-site models on the branch leading from the sxl/ssx split to the ssx clade in drosophila provided evidence for the adaptive fixation of amino acids on the ancestral branch. in addition, the test for local relaxation across the ssx clade, rather than the basal branch only, was significant and identified codons that evolve under purifying selection in sxl, but neutrally in ssx. so we find evidence from two different tests: adaptive fixation of some amino acids on the ancestral branch of ssx which is followed by neutral evolution of some amino acids in the clade. because nine of the amino acids that were inferred by bayesian analysis to have been positively fixed at the sxl/ssx split were also found to evolve neutrally once fixed in the ssx clade, they are likely characteristic of sxl evolution rather than ssx evolution. there remains consistent evidence of nine amino acids fixing under positive selection for ssx. our results suggest that adaptive evolution following the gene duplication in drosophila was not restricted to sxl, as extensive ancestral adaptive evolution was observed for amino acids of the paralogue ssx. a alternative and null models, see additional file table s for more information on models and log-likelihood values, b p value calculated from a χ distribution, c number of sites significant in bayesian post-hoc tests. the alignment, after deleting gaps, was composed of codons. molecular evolution of downstream sex determining genes we performed analyses designed to detect changes in the pattern of molecular evolution of the downstream sex determining genes tra and dsx, coinciding with the recruitment of sxl in drosophila. for tra, we analyzed an alignment of drosophila and tephritid sequences. we found evidence for site-specific neutral evolution. the likelihood ratio test for local relaxation on the basal branch was significant, but no amino acid was found to have evolved neutrally on that branch, so the overall evidence for relaxation on the basal branch alone is weak. tests of local relaxation of selective constraint were significant for both clades. the effect was quantitatively stronger in the drosophila clade than in the tephritidae; sites were inferred to evolve neutrally in drosophila, but only in the tephritidae. taken together, these results show that the recruitment of sxl to the sex determining cascade coincided with a significant loosening of selective constraint in the drosophila clade. a alternative and null models, see additional file table s for more information on models and log-likelihood values, b p value calculated from a χ distribution, c number of sites significant in bayesian post-hoc tests. the alignment, after deleting gaps, was composed of codons. tests that we deemed weakly significant because bayesian post-hoc tests did not detect relevant aa are shown in italics. the evidence for a relaxed purifying selection in drosophila tra is corroborated by the pattern of insertions and deletions for tra that is not taken into account by paml's analysis of coding sequences. first, the coding sequence of the tra protein is on average much shorter in drosophila than in the tephritids. whilst some indels appear to be species-specific, we observe four substantial domains that are conserved in all tephritid species but absent in all drosophila species. these represent indel events that have most likely taken place on the ancestral branch dividing the two clades. the difference in mean coding length between the two clades is nucleotides, so the ancestral indels make up a significant share of this length difference. these important structural changes in the protein provide further evidence for the relaxation of purifying selection on tra coinciding with the recruitment of sxl in the sex determination network. a indel rate was calculated for each pair of species within a clade by dividing the number of indel sites by the number of nucleotides in the pairwise alignment, then further dividing by the branch length between the two species estimated using the dsx gene. in addition to a general shortening, we observe much greater variance in the length of the tra protein between drosophila than between tephritid species. this again suggests weaker purifying selection against indels, or less consistent selection across drosophila species. the comparison between drosophila and the tephritidae is potentially confounded by differences in branch length between the clades. to control for this effect, pairwise comparisons were made within each clade, and the number of indels per site was scaled by the branch lengths separating each pair of species. based on these data, we found that the rate of indels is higher in the drosophila than the tephritid clade. in addition, the variance in the indel rate was much higher in the drosophila than the tephritid clade. from a statistical point of view these tests are not entirely rigorous, as they do not take into account the inter-dependence between the data points derived from overlapping pairs of species. however, the large difference observed, in particular in the variance in indel rates, suggests that the evolutionary processes are not identical in the two clades, with lower evolutionary constraint in the drosophila clade. we finally analyzed patterns of molecular evolution in the dsx gene. the lower rate of change in dsx allowed us to include the gene sequence from m. domestica in our analysis, without removing an excess of amino acids due to alignment gaps. as with sxl and tra, analyses based on site models revealed that some sites evolve neutrally across the entire tree, but there was no evidence for consistent positive selection. including the sequences from m. domestica allowed us to root the split between the drosophila and tephritid clades. a alternative and null models, see additional file table s for more information on models and log-likelihood values, b p value calculated from a χ distribution, c number of sites significant in bayesian post-hoc tests. the alignment, after deleting gaps, was composed of codons. applying tests to infer changes in selection on the basal branches leading to the drosophila and tephritid clades, we detected evidence for positive selection along both branches, with and sites being identified as targets in drosophila and the tephritidae, respectively. comparing the evolution of the gene within and outside of drosophila, we found evidence for relaxation of purifying selection at a small proportion of sites within drosophila and in the outgroup. type i error in the inference of positive selection although our analyses provide evidence for adaptation at some point in the phylogeny of every gene except tra, caution is required when inferring past selection from dna sequences. when sequences are very divergent, the occurrence of multiple substitutions at a site can cause the rate of synonymous substitutions to be under-estimated. this, in turn, results in an inflated dn/ds ratio and the inference of spurious positive selection. problems of this kind are unlikely to affect our results because the mle methods used here estimate the most likely dn/ds ratio based on patterns of substitutions along all branches of a tree and have been shown to be significantly more powerful and reliable for inferring ancestral positive selection than counting methods comparing pairs of sequences. in order to formally rule out effects of saturation on our results, we performed extensive simulations in an approach previously taken by studer et al.. these simulations seek to estimate the type i error in a conservative scenario. we generated artificial alignments by simulating sequence evolution along the tree of the original sequences using the parameters of the null models for all genes. to make the test conservative, the risk of saturation was artificially increased by multiplying the number of substitutions per codon on the tested branch by a factor of. for each gene, a set of simulated alignments was analyzed for positive selection using the same tests as in the original analyses. the highest rate of false positives observed in our conservative approach was 1%, indicating that our inferences of positive selection are extremely unlikely to be due to type i error. discussion in this paper we investigated the changes in the patterns of molecular evolution evolution of sex determining genes associated with the recruitment of sxl to the top of the drosophila sex determining cascade. we analyzed the evolution of sxl itself, its drosophila paralogue ssx, and the downstream targets tra and dsx, using sequences from species of drosophila and their sister clade the tephritidae, as well as m. domestica. drosophila sxl is thought to have originated through duplication on the branch leading to the drosophila clade. the ancestral function of sxl, and its current function in the diptera outside drosophila are not known to be associated with sex determination. two hypotheses have been put forward as to how new and ancestral functions were shared between the two drosophila paralogues sxl and ssx. traut et al. proposed that sxl neo-functionalized to its sex determining role whereas the paralogue ssx would have maintained the ancestral functions. alternatively, cline et al. suggested sxl would take on a new sex determining function while simultaneously both sxl and ssx would sub-functionalize to share non sex-specific functions ancestrally performed by sxl. based on our analyses and including previous findings, it is now possible to weigh up the relative merits of these two evolutionary scenarios. the fact that sxl has undergone significant changes is not contentious. it is clear that the gene has adapted to its new sex determining role by the addition of a new domain and the evolution of sophisticated rna splicing. our analyses have shown that sxl has undergone adaptive evolution in its coding sequence at a limited number of amino acids, followed by a tightening of purifying selection on the protein sequence. it seems furthermore likely that sxl has retained an ancestral function, an interpretation that is supported by the fact that one of the sxl transcripts in drosophila lacks the sxl-specific domain and is expressed in both sexes. but in the light of our findings it is now also clear that ssx has undergone adaptive evolution. thus, we have shown that the gene shows a signature of adaptive change as well as a release from purifying selection on its coding sequence, resulting in a protein that differs significantly from both its paralogue in drosophila and its orthologue in the tephritidae. this finding is in line with cline et al.'s hypothesis of sub-functionalization. adaptation in both genes could further indicate that the duplication of sxl allowed for the alleviation of'adaptive conflict' previously imposed by the double function of the ancestral gene. establishing whether this is the case, however, will require more detailed information on the non sex-specific functions of drosophila sxl and ssx and their orthologue in other dipteran species. our analyses were also able to shed some light on the repercussions of sxl recruitment in the patterns of molecular evolution of genes further down the sex determining cascade. the protein evolution observed in drosophila tra is characterized by extensive neutral evolution and high rates of indels. these results echo those found by a previous study using a smaller number of species. the evidence for sequence degradation adds to the inferred loss of the putative auto-regulation domain in drosophila tra, and corroborates the view that the recruitment of sxl as the main sex switch gene relieved the pressure of purifying selection on tra. whether the relaxation of selection on drosophila tra outside the specific auto-regulatory domain is due to the loss of the sexual memory function is difficult to ascertain. the tra/tra binding sites in drosophila dsx and fru are well conserved, implying that tra's regulatory function is still required. there are, however, suggestions that the auto-regulation of tra is more complicated than its regulation of dsx; rather than forming an enhancing complex with tra as for dsx pre-mrna, the tra protein silences expression in tra pre-mrna. regions of the protein only involved in these specific auto-regulatory mechanisms would be free to erode after recruitment of sxl in drosophila. there is also the additional possibility that the relaxation of purifying selection on tra sequence is the result of sxl taking over other sex-specific regulatory functions. over thirty potential functional binding sites for sxl have been found in drosophila, some of these may have been ancestrally regulated by tra. the loss of these functional links from tra could have relieved it from selection pressure. since drosophila sxl was sex specifically spliced by tra before it was promoted to top regulator in the sex determining cascade, there has been a relatively long evolutionary time for sxl and tra to exchange various functions, potentially selected for their effectiveness of specific target splicing. in that light it would be interesting to compare the putative targets of sxl in drosophila with those of tra outside of drosophila. overlap between these two sets would support this hypothesis. taken together, our results indicate that the adaption of tra to its new regulatory role in somatic sex determination, did not require positively selected amino acid substitutions, but rather the degradation of redundant parts of the protein-coding sequence. this partial erosion was complemented with selective changes elsewhere in the gene sequence. thus, we observe changes in the non-coding sequence, where we see the emergence and conservation of a sxl binding site in intronic sequences of drosophila tra. the evolution of sxl and tra in drosophila can be compared with a different change in the top regulator in honeybees. in this group, female development is driven complementary sex determiner, a switch gene specific to the genus apis. sex determination in honeybees is haplodiploid, with females heterozygous and males hemizygous at the csd locus. similar to drosophila sxl, csd arose by duplication of feminizer, the ancestral top regulator and orthologue of tra. in contrast to drosophila, where sxl underwent a short bout of adaptation on its recruitment and tra shows evidence of relaxed selection, csd in honeybees has undergone continued positive selection since its creation by duplication, whereas fem has experienced tightening purifying selection. presumably, it is the requirement for heterozygosity in females that drives continued change in the amino acid sequence of csd. the strong purifying selection on fem has been attributed to potentially deleterious effects of unspecific protein-protein interactions that could arise from amino acid changes. our results suggest that such deleterious effects either play a lesser role in drosophila or are compensated by the benefit of mutations degrading tra functions that have become redundant since the recruitment of sxl. we also found evidence for positive selection and relaxed purifying selection in dsx, the transcription factor translating the sex determining signal into sex-specific gene expression and differentiation. this was detected both in the drosophila and in the tephritidae. furthermore, a preliminary analysis found evidence for positive selection in fruitless, a gene with a similar position to dsx in the sex determining cascade that is directly regulated by tra. the evidence for widespread adaptive evolution in the downstream target genes of sex determination in drosophila is surprising as neither dsx nor fru interact with sxl and both should therefore be unaffected by the recruitment of sxl. in the tephritidae, adaptive change is even more surprising, as it occurs in the absence of any topological change in the sex determining cascade. the results therefore suggest that although dsx is conserved in function and sequence across a large part of the animal tree, continuous evolutionary change occurs independent of topological changes in the network. it is unclear what forces might generate positive selection on downstream sex determining genes.  in this study, we have shown that the recruitment of sxl to the drosophila sex determining cascade has coincided with changes in the evolution of the sxl gene itself, its paralogue ssx and the downstream genes involved in sex determination, tra, dsx and fru. studying a well-known and relatively simple gene cascade has enabled us to relate and confront the evolution of a network structure with the direction of selection on the amino acids of the genes participating in that network. patterns of molecular evolution of amino acids in relation to network changes in drosophila emerge from our analysis, notably the sub-functionalization of sxl and ssx, and the degeneration of tra, along with the ongoing evolution of dsx in drosophila and the tephritidae. future experimental work will hopefully shed more light on this issue, notably by investigating the molecular function of sxl splice forms that are produced equally in both sexes and so may perform one the of the ancestral function of the gene. 
the pattern of molecular evolution we observe for sex-lethal and its paralogue sister-or-sex-lethal is not characteristic of a duplication followed by neo-functionalization. rather, evidence suggests a sub-functionalization scenario achieved through the evolution of sophisticated splicing. sequences of the paralogue sister-or-sex-lethal, in contrast, show a signature of rampant positive selection and relaxation of purifying selection. in addition, doublesex shows a signature of positive selection and relaxation of purifying selection in the drosophila clade. the recruitment of sex-lethal as top regulator and memory gene is associated with a significant release from purifying selection in transformer throughout the drosophila clade. we find that the recruitment of sister-or-sex-lethal was associated with a number of adaptive amino acid substitutions, followed by a tightening of purifying selection within the drosophila clade.
 sex determining mechanisms are evolutionarily labile and related species often use different primary signals and gene regulatory networks. this is well illustrated by the sex determining cascade of drosophila fruitflies, which have recruited sex-lethal as the master switch and cellular memory of sexual identity, a role performed in other insects by the gene transformer. here we investigate the evolutionary change in the coding sequences of sex determining genes associated with the recruitment of sex-lethal. we analyze sequences of sex-lethal itself, its drosophila paralogue sister-or-sex-lethal and downstream targets transformer and doublesex.  we find that the recruitment of sister-or-sex-lethal was associated with a number of adaptive amino acid substitutions, followed by a tightening of purifying selection within the drosophila clade. sequences of the paralogue sister-or-sex-lethal, in contrast, show a signature of rampant positive selection and relaxation of purifying selection. the recruitment of sex-lethal as top regulator and memory gene is associated with a significant release from purifying selection in transformer throughout the drosophila clade. in addition, doublesex shows a signature of positive selection and relaxation of purifying selection in the drosophila clade. a similar pattern is seen in sequences from the sister tephritidae clade.  the pattern of molecular evolution we observe for sex-lethal and its paralogue sister-or-sex-lethal is not characteristic of a duplication followed by neo-functionalization. rather, evidence suggests a sub-functionalization scenario achieved through the evolution of sophisticated splicing. as expected, we find that transformer evolves under relaxed purifying selection after the recruitment of sex-lethal in drosophila. finally, the observation of doublesex adaptation in both drosophila and tephritidae suggests that these changes are due to ongoing adaptation of downstream sex-specific regulation, rather than being associated the recruitment of sex-lethal and the resulting change in the topology of the sex determining cascade. 