Around 500 species such as clownfish made famous by Finding Nemo, the kobudai from Blue Planet II, and the Caribbean bluehead wrasse, routinely change their sex in adulthood as a natural part of their life cycle.
Most bluehead wrasses begin life as females, but can become males later in life in a process that takes 10 to 21 days, researchers say.
Dr Erica Todd, of the Department of Anatomy in New Zealand, said: “When a dominant male is lost from a social group, the largest female transforms into a fertile male in 10 days flat.
“Females begin this transformation within minutes, first changing colour and displaying male-like behaviours.
“Her ovaries then start to regress and fully functional testes grow in their place.
“How this stunning transformation works at a genetic level has long been an enigma.”
A study published in Science Advances used the latest genetic approaches, high-throughput RNA-sequencing and epigenetic analyses, to see how and when specific genes are turned on and off to allow the change.
Researchers found the sex change in bluehead wrasse involves a complete genetic rewiring of the gonad.
Genes needed to maintain the ovary are first turned off, and then a new genetic pathway is steadily turned on to promote testis formation, the University of Otago-led study suggests.
This chain reaction begins when a gene called aromatase, which is responsible for making the female hormone oestrogen, is turned off.
What triggers this reaction is unknown, but the stress of losing the existing dominant male may be an important signal in turning off the genetic pathway that maintains the ovary.
Co-lead author, PhD candidate Oscar Ortega-Recalde, said: “In fish and other vertebrates, including humans, cells use chemical markers on DNA that control gene expression and remember their specific function in the body.
“Our study is important because it shows that sex change involves profound changes in these chemical marks.”
Dr Todd added: “Understanding how fish can change sex may tell us more about how complex networks of genes interact to determine and maintain sex, not only in fish but in vertebrate animals generally.”