This topic all started over dinner at a scientific conference in Sweden. Researchers from the U.S. and Europe were enjoying a meal that included some fine spring asparagus, and the conversation soon veered towards one of the great scientific mysteries of our time: Why can some people smell an odor in their urine after eating asparagus while others cannot?

Researchers from the Harvard T.H. Chan School of Public Health decided to find out. They asked nearly 7,000 individuals whether they could smell asparagus pee, then ran genetic tests to see how their genes differed.

The malodorous smell arises when our bodies digest the vegetable and break down asparagusic acid into a number of sulfur-containing compounds. Previous studies have shown people who cannot smell their own asparagus pee are also unable to smell the odor in other people’s urine. In 2010, a genetic study with 4,727 participants identified a single genetic mutation linked to the inability to smell the odor. That study also found that not everybody produces the distinctive scent.

But the Harvard research looked at the entire genome and found 871 unique genetic variations associated with the inability to smell asparagus pee, all of them contained on a chromosomal region associated with the sense of smell.

Some 40 percent on the test subjects could smell the odor, while 60 percent could not — a condition known as asparagus anosmia. Men were slightly more likely to get a whiff than women. The researchers suggested that may be because women were less likely to admit their pee smelled, or because their position during urination might reduce their exposure to the odor.

While the study did not measure the nutritional benefits of eating asparagus, the authors noted that the vegetable is rich in iron, fiber, zinc, folate and vitamins A, E and C. As part of a diet rich in vegetables, it has been linked with a lower risk of cancer, cognitive impairment and cardiovascular disease.

The authors, led by research associate Sarah Markt, said the study, published this week in the British Medical Journal, raises further questions.

“First and foremost perhaps is: why such a delicious delicacy as asparagus results in such a pernicious odor,” said Lorelei Mucci, an associate professor of epidemiology and senior author of the study. “And what are the selective pressures driving genetic variation that lead to asparagus anosmia?”

The researchers also questioned whether scientists would take the results of their study and use new gene-editing techniques to convert smellers to nonsmellers. But they were probably joking.