Doublesex

Doublesex (dsx) is a gene that is involved in the sex determination system of many insects including the fruit fly "Drosophila melanogaster".
Sex determination.
The gene is expressed in both male and female flies and is subject to alternative splicing, producing the protein isoforms "dsxf" in females and the longer "dsxm" in males. The production of "dsxf" is caused by the presence of the female-specific version of the "transformer" ("tra") gene. 
In a sense, the isoform of "dsx" informs a cell about the organism's sex; for instance, female genitals only develop if "dsxf" is present. In conjunction with the gene "fruitless", "dsx" also causes differences in the brain structure and behavior of males and females.
Although the details of sex determination differ in the various species, there is a gene related to "dsx" in vertebrates (DMRT1) and in nematodes (MAB-3). All of these are transcription factors with a zinc finger DNA-binding domain (known as the DM domain) and are involved in sex-specific differentiation.