Ketchup enthusiasts, rejoice! Scientists have cracked the tomato's genetic code and hope to use its secrets to breed hardier, heartier crops that can withstand global warming and disease.

Scientists from the Tomato Genome Consortium published genome sequences for two kinds of tomato in the journal Nature on Wednesday: Heinz 1706, one of the primary ingredients in Heinz ketchup, and its wild relative Solanum pimpinellifolium, a Peruvian native also known as the Currant Tomato.

The tomato turns out to have 7,000 more genes than humans, and the sequences of the Heinz tomato and its wild cousin are only .6 % different.

The scientists also found that the tomato has copied its entire genome in triplicate twice - once 130 million years ago, and another time 60 million years ago.

Several of the genes 'born' at that second triplication stayed in the genome for tens of millions of years, lead researcher Giovanni Giuliano told Nature News. Then, relatively recently, they changed their function - this brought about the appearance of the fleshy fruit as we know it today.

Those genes that plump up the tomato could have counterparts in other fleshy fruits like bananas, melons and apples, so now researchers have a road map to exploring those fruits as well.

The new study does show that the tomato's genome sequence is about 92% similar to potatoes, but does not undermine the fact that tomatoes are technically fruits, since the part we eat is an ovary containing the seeds of the tomato plant.

Don't tell that to the U.S. Supreme Court though. In 1893, the high court declared in Nix v. Hedden that tomatoes are vegetables rather than fruits, choosing to follow the common notion of the tomato rather than its botanically correct identity.

Tomato-as-vegetable became an unexpected political issue in the 1980s, when the U.S. Department of Agriculture proposed classifying condiments like ketchup and relish as vegetables in order to allow school cafeterias to cut out cooked or fresh vegetables from lunches while still meeting federal nutrition requirements.

The Reagan administration argued the proposed change was merited by the fact that children weren't eating the standard vegetables, and reclassification would cut down on wasted food and money. But the effort fizzled after a storm of criticism from nutritionists.

The US Congress revived the issue last year when it blocked the Obama administration's effort to change nutritional guidelines pertaining to tomato paste in school lunches. For years, an eighth of a cup of tomato paste has been credited with the same nutritional value as a half a cup of vegetables. The president had sought to remove that special treatment, making half a cup of tomato paste equal to half a cup of vegetables.

Cracking the tomato's genome has taken about nine years to finish, but it's only a start.

Now we can start asking a lot more interesting questions about fruit biology, disease resistance, root development and nutritional qualities, Cornell University researcher James Giovannoni said in a statement on Wednesday.