The date palm may have been cultivated as a source of food for as long as 8,000 years, but until now scientists and farmers have been stumped by a simple issue: how to tell apart males and females.
In fully grown trees, the answer is simple: only the females produce the fruit that have provided sustenance to desert dwellers for such a long time, which is exactly why the question matters.
Yet to find out which gender a germinating seed belongs to is a long and expensive process. It requires as many as five years of patient watering and feeding with fertiliser until it becomes apparent whether a plant will be a date-producing female or a male that never bears fruit.
But now scientists in Qatar, after only a year of research, have a genetic answer that means it will no longer be necessary to grow plants to adulthood.
First, the researchers at Weill Cornell Medical College in Doha's Education City had to draw up the first proper map of the date palm's genome. That map, released in April 2009, represented a 1,000-fold improvement in the level of detail compared to what was available before.
With that done, they set themselves to the task of finding the genes that control gender.
The result, published recently in the journal Nature Biotechnology, is a test to identify a plant's gender just a few weeks after gestation. All it takes is a sample of leaf.
"Before ... people thought sex was not determined genetically, but ... by other factors such as the environment, because no one had found a genetic link," says Joel Malek, director of genomics at the campus and senior author of the recently published paper. "It was quite small, so it was hard to find."
It is now clear that genes, not factors such as nutrients or temperature, determine gender in the date palm.
The genetic test offers great benefits not only directly to farmers, but to breeders trying to craft improved types of date palm.
In humans, genetic tests are simple. The sex chromosomes, one of the 23 pairs in the human genome, give the game away - men have one X-shaped sex chromosome and another, smaller one that looks like a Y, while women have two X-shaped sex chromosomes.
"In humans you can just look through the microscope and see the difference - the Y is much smaller than the X," says Mr Malek.
With date palms, that is not possible.
Instead, the new test uses a process called polymerase chain reaction (PCR) in which the relevant section of the plant's deoxyribonucleic acid (DNA) - the genetic material of all living organisms - is amplified many times and sequenced. The result of this sequencing reveals whether the plant is male or female.
A simpler test is being perfected where PCR amplifies the important section of the plant's DNA before the sample is run on a gel. The male, Mr Malek says, shows up as two bands on the gel while the female produces just one band.
Researchers have yet to map the genetic region linked to gender to a particular one of the plant's eighteen pairs of chromosomes, although fluorescent markers could be used to do this later.
Until now, instead of crossing male and female date palms, growing the offspring for several years and selecting the females, farmers have cloned existing females.
A technique known as offshoot propagation is commonly used, with buds taken from a female and planted to produce new trees.
While this guarantees another female plant, and gives farmers a uniform crop of dates, there is a downside: with fields of genetically identical plants, the whole crop is vulnerable to the same disease. There is no genetic variability to make some plants resistant to disease as others fall victim.
The ability to select and grow only females will make it much easier to grow a more diverse crop of trees.
"In a lot of Gulf countries, probably 90 per cent of the date palms will have come from clones of very, very few varieties," says Mr Malek.
"We would like to identify many genetically diverse trees and to sexually breed these trees and produce female trees that can be used in these countries."
By doing this, they hope to increase dramatically the genetic diversity of the region's date palms.
While it is likely to be some time before farms start using date palms produced by sexual crosses, the new technique could be of benefit to large planting projects such as anti-desertification schemes, where females are needed but uniformity is not critical.
It should also be possible, using genetic markers, to produce more uniform plants from sexual crosses. The group is developing genetic markers for useful traits in the main varieties it studied - khalas, deglet noor and medjool. It has already identified regions of variability that contain genes linked to fruit flavour, colour and ripening time.
Six people in Qatar and another half-dozen international collaborators took part in the project. Funded by the Qatar Foundation, the government organisation that set up Education City, the work cost "in the low hundreds of thousands of dollars", which is "significantly less than anybody would expect", according to Mr Malek.
Until recently, the date palm had not been as extensively studied as many other plants, since it is of little economic value in North America or Europe, where much scientific research is concentrated.
However, samples of date palm leaves from a Californian date palm research project that ended in the 1970s, but from which a line of trees is still cultivated, provided the best samples for the researchers.
Much of the work was based on the genetic sequences of nine trees, six females and three males.
One further step is to refine the test so it can be carried out on a sample of the seed - removing the need to germinate.
"Until we can work out a drill or something like that to get inside the seed, we'll have to wait a few weeks after it sprouts to do the test," Mr Malek says.
"It's an engineering issue, it's not a science one - how to extract from the embryo from the inside of the seed while maintaining its viability."
@for more on FRONTIERS visit thenational.ae/topics