Many a beer drinker has stared into the bottom of a glass, belched and gone blearily philosophic wondering just where that golden gift of brew came from.

The University of Colorado School of Medicine can do Homer Simpson one better. When the docs are done with the belching, they stick a nice lager into a genetic-sequencing machine.

They search for something deeper than the foam in a freshly tapped keg — yeast holds keys to human evolution because of similarities in the organisms’ DNA.

And now those CU researchers have solved an ancient, beer-soaked mystery — how 15th-century Bavarian monks stumbled upon a yeast from halfway around the world that allowed them to brew lager beer in the cold.

Two strains of yeast helped the monks invent lager, which, unlike ale-style beers, can ferment in a cool cave. Brewers and scientists have long known one of those strains, but the other was a puzzle.

A Patagonian puzzle, it turned out. An Argentine researcher collecting yeast strains for wider experiments came across one from his home country that largely matched present-day brewers yeast.

The sequencing team speculates the extra, cold-friendly yeast strain came to Europe at the start of ship trading more than 500 years ago. Until then, the dominant ale-style beer was fermented in the traditional warm-yeast method.

The new yeast rode — perhaps — as slime in a ship cask or in the belly of a fruit fly.

Monks failing at making cold beer taste good unknowingly brewed a batch “contaminated” with the new yeast, discovered a quality lager by accident and have been repeating it ever since.

The goal is not to change your beer. Major brewers are far more interested in adding lime or taking away calories than genetically modifying their yeast. The point of the CU research is to show how yeast evolves over time because human genes follow similar patterns.

Gene sequencing is getting medical researchers closer to “personalized medicine,” where drugs and other treatments can be fine-tuned to a patient’s unique DNA patterns.

Yeast is “one of the best organisms to look at in finding out how things work,” said Mark Johnston, chairman of the medical school’s department of biochemistry and molecular genetics. “It required work on simpler organisms like yeast to get the human genome done,” Johnston said.

Yeast geeks and brewing wonks “have been searching for this for decades,” said Chris Todd Hittinger, a former postdoctoral colleague of Johnston’s and now a professor at the University of Wisconsin-Madison. The discovery appears this week in the Proceedings of the National Academy of Sciences.

Johnston, an ale man, and Hittinger, a lager fan, conducted “research” after golf outings. Johnston had a plain old Budweiser, the populist American lager, and realized that a lesser yeast is still “quite tasty.”