There are many cultural and social factors involved in making a baby into a man or a woman. But biologically speaking, sex starts when you’re just a tiny group of cells in your mother’s uterus.

We have a pretty good general idea of how “maleness” or “femaleness” develops in a human embryo, and how this is translated into the capacity to make eggs or sperm.

We’re also beginning to understand how many other genes contribute to the amazing variation in human sexual development, behaviour and identity.

The early flexibility in this system is fascinating. It reminds me of author Hugh Lofting’s iconic Pushmi-pullyu (“push-me-pull-you”), a two-headed character in the Doctor Dolittle stories, who is in a tizz to decide which way to go.

Germ cells and gonads

Most cells in our bodies are destined to die. But set aside in an embryo are a few cells that retain their ability to become a whole person. These cells – called “primoridal germ cells” ultimately develop into sperm or eggs.

But they have a long journey to get there. About three weeks after conception, 50 primordial germ cells are set aside in membranes outside the embryo. They multiply and make an epic march into the embryo, moving right through the embryonic gut. These cells arrive in the embryonic gonads by six weeks.

Later they receive signals that direct them to become sperm (that are made in their billions throughout the life of a man), or to become the 20,000 eggs a girl is born with.

Eggs and sperm are unique in that each has half the number of chromosomes as other cells. People have two copies of the human genome in every body cell, one from mum and one from dad. Germ cells need to cut this back to a single genome which is a mixture of the two parents’ genes. This is accomplished by a clever type of cell division called “meiosis” in which the 46 chromosomes replicate once, but the cell divides twice.

Meiosis is the process of cell division that creates 23 chromosomes in eggs and sperm. Shutterstock

The organs in which all this happens are gonads: testes in men, ovaries in women.

Gonads start off as a ridge of cells on either side of the backbone-to-be at about five weeks after conception. This “genital ridge” starts off the same in all embryos.

But in embryos destined to be boys, the genital ridge receives a signal called the “testis determining factor” at ten weeks after conception. This signal kick-starts development of testes and suppresses ovarian development.

If it doesn’t get the testis signal, the genital ridge waits a few more weeks, and becomes an ovary.

Then factors from the testis or ovary push the germ cells one way or the other, into developing as either sperm or eggs.

The gonads don’t just make sperm or eggs. They also pump out hormones that affect the whole development of the embryo. The embryonic testis makes testosterone which directs male development, fashioning a penis and scrotum. Estrogen has the opposite effect – supporting the development of female genitalia, and priming the future breasts.

What and where is the signal that initiates testes?

We know the signal that leads to testis development comes from sex chromosomes.

The human genome is cut up into 23 long DNA molecules that we see as chromosomes under the microscope. All babies have 22 pairs of ordinary chromosomes (one set of 22 from mum, and one set from dad).

But boys and girls differ in the 23rd pair of chromosomes: girls have two copies of a medium-sized chromosome called the X. Boys have a single X and a tiny chromosome called the Y. The names have nothing to do with their shapes but reflect the mystery of their difference (“X” for unknown).

At meiosis in the testis, the X and Y chromosomes get segregated into different sperm – 50% of sperm will carry an X, 50% a Y. All eggs have a single X chromosome.

So on fertilisation, half the embryos start off with XX, and half with XY sex chromosomes.

We know that the Y bears the testis signal, because people with only a single X are female, and people with two X chromosomes and a Y are male.

So the signal must come from a gene on the Y chromosome. In 1990 the signal was pinpointed near the top of the Y chromosome. This section of the Y was present in males and absent in females who had only part of a Y chromosome.

A gene called SRY was identified in this little bit of Y. It was proved to be the “testis determining factor” by analysis of some girls who had a normal looking Y, but a mutant SRY, and by inserting SRY into an XX mouse embryo that developed as a male.

The presence of male genitals usually indicates that the child has a Y chromosome Shutterstock

How does SRY work and what can go wrong?

Once the SRY gene was identified we all thought it would be just one or two steps between SRY and the activation of other genes that make a testis.

But it turns out there is a complex web of reactions controlled by at least 30 genes. Some promote testis development. Some promote ovary development. Some antagonise testis formation, others antagonise ovaries. It’s a real push-me-pull-you situation.

There are also genes (one example is DMRT1) that keep gonads on a clear pathway of development. If you knock such genes out, cells in the testis start behaving like ovary cells, or cells in the ovary start acting like testis.

But it doesn’t stop here. Remarkably, this one gene SRY, through its networks and hormonal influences, affects the activity of more than 6,500 genes (of our total 20,000) differently in men and women.

So males and females really are genetically very different both in the genes they have, and how active they are.

A mutation in any one of the 30 genes involved in the complex web of gonad-differentiating reactions can lead to sex reversal (XY females or XX males), or incomplete gonad differentiation. For instance, some females have a Y chromosome and an intact SRY gene, but lack the protein that receives signals from male hormones.

And some XY females are missing a bit of chromosome 4 that contains the gene DMRT1: you need two copies of this gene to be male, even with an SRY gene.

Other genes control sex characters

There are hundreds of genes needed to make sperm. Some lie on the Y chromosome near SRY, but others are on the X or scattered throughout the genome (but active only in males). The same is probably true of making eggs.

There are also many other genes involved in sexual differentiation, making organs like penises and breasts.

Some gene variants are involved in choice of sexual partner. There are probably hundreds of so-called “gay genes” that I have suggested are really “male-loving” genes, and there may also be hundreds of “female-loving” genes. These gene variants are common because in the other sex they express as especially male-loving females and female-loving males, who seem to mate earlier and have more children.

I think the same may be true of genes that affect gender identity. Gene variants that promote a strong male identity might not always go along with a Y chromosome, and genes that promote a female identity may be incongruously partnered with a male-determining Y. Transgender identity may be common because, like “gay genes’, such gene variants would be strongly selected in the other sex – women with a strong female identity and males with a strong male identity might mate more enthusiastically and have more offspring.

It is extraordinary that something so fundamental and critical for species survival as sex should be controlled by such a complicated and variable web of genes.

We have to thank evolution for providing us with such complexity, and learn to celebrate the fantastic variation that nature has ensured.

By Jenny Graves – 2017 recipient of the Australian Prime Minister’s Prize for Science

The winners of the 2018 Prime Minister’s Prizes for Science will be announced on October 17.

This article is republished from The Conversation under a Creative Commons license. Read the original article.