Brazilian cocoa trees had very little genetic variation since they were introduced to the country in the mid-1700s, according to Science Daily. That made them more susceptible to pathogens. In 1989, a fungus called Moniliophthora perniciosa wiped out 70 percent of Brazil's chocolate trees, affecting the country's socio-economic stability.

It all starts with a pretty pink mushroom.

The Moniliophthora perniciosa attaches to the tree and releases millions of spores that sneak in through stomata (tiny natural gaps) and infect the tree, according to Science Daily. The trees develop growths that resemble green brooms, which is where the nickname "witches' broom disease" comes from. Two months post-infection, the "brooms" turn brown and more spore-producing mushrooms appear. There is no known cure for this tree fungus.

In 2000, scientists from Universidade Estadual de Campinas in Brazil started the Witches' Broom Genome Project hoping to discover a cure for the disease. The team used dual RNA-sequencing analysis to distinguish between the trees' functions and the interaction with the fungus.

"Knowing the molecular and physiological basis of a disease is an important step towards developing effective control strategies," says study author Paulo Teixeira, according to Science Daily.

The scientists discovered thousands of genes active in the "witches' broom."

"The discovery of sets of fungal genes that are most likely involved in pathogenicity paves the way for the development of targeted treatments of the disease," study author Daniela Thomazella said, according to Science Daily.

This study will not only create understanding of this particular fungus, researchers said, according to Science Daily, but "this work provides an important basis for future studies that aim to improve agricultural sustainability and global food security."