A series of bizarre events and biological errors over evolutionary history were responsible for the intoxicating medicines found inside the humble poppy, new research published in Science reveals.

Opiates and humanity go way back. The first evidence of the cultivation and use of the poppy (Papaver somniferum) is from Neolithic villages in Switzerland, and history records cultivation five thousand years ago by the Sumerians. Similarly, the Egyptians grew a variety, and derived what was known as Theban opium – referred to by Geoffrey Chaucer – remnants of which has been found in ancient tombs.

The Greeks and the Romans, from Hippocrates and Theophrastus (Aristotle’s plant-loving sidekick) to the great physician Galen, knew and used the sap of the poppy for its miraculous properties.

Over history, the powerful plant, both scourge and salve, has never strayed far from our side. Which is just as well, because, thus far, modern science has been unable to synthetically duplicate its active ingredients, and worldwide supply of the drugs derived from it relies on poppy farmers in India, Turkey and Tasmania.

Now a team of researchers from China, Britain and Australia have unveiled the complete poppy genome, while also delving into it to understand the origin of opiates.

And therein lies a tale.

The poppy genome contains what researchers call the “BIA gene cluster”, a collection of genes responsible a range of compounds known as benzylisoquinoline alkaloids (hence BIAs).

These are a chemical class that contains the various branches of the family of powerful opiate compounds, notably morphine, codeine and a non-analgesic cough-suppressant known as noscapine. The first two belong to the “morphinan” branch while noscapine belongs to a branch of its own.

The cluster is made up of 10 genes that encode for enzymes responsible for noscapine production, four genes responsible for the synthesis of a morphinan alkaloid called thebaine, and a Frankenstein gene-mash-up called STORR that produces reactions which pushes the products of the other genes away from making noscapine and toward making morphinans such as morphine and codeine.

It is this cluster that gives Papaver somniferum its medicinal properties.

But how did it come to be?

The evolutionary tale behind morphinans, involves deletion, fusion and duplication. In fact, the poppy genome has duplicated itself entirely, not once, but twice. At least.

Lead author Li Guo, from the Xi’an Jiaotong University in China, and colleagues argue that the noscapine branch component of the BIA gene cluster came into being after an ancient “whole genome duplication” (WGD) that occurred some 110 million years ago, before the poppy family split from the order of Ranunculales, a larger group that contains flowers such as buttercups and columbines.

The genes responsible for the morphinan branch compounds, however, came about through a more recent WGD event that took place only 7.8 million years ago.

More important than these, however, is STORR itself – a fusing of two separate genes to form a single novel one.

Discovered in 2015 by five of the current paper’s authors, STORR is responsible for the preferential production of morphinans in P. somniferum, and seemingly came about via a partial deletion of genetic material following a duplication event. Oddly, though, this event seems to be only a partial one that took place between the two whole ones.

These evolutionary contingencies not only provide an understanding of the lineage of the poppy, but also provide a window into the chemistry of opiates. Together with the fully sequenced genome, the authors hope they will “provide a foundation for the further improvement of this medicinal plant”.