(CNN)Next time you pour back a sour beer, you might like to know that tart and tangy goodness is the result of an immensely complex set of microbial interactions that chemists are only just beginning to figure out.
Sour beer: The chemistry behind this wondrously complex craft brew
"We know the beers taste amazing and look beautiful," said Teresa Longin, a professor of chemistry at the University of Redlands in California, who is presenting the new research this week at the American Chemical Society.
Her husband, David Soulsby, also a Redlands professor of chemistry, kept urging her to use her expertise to help explain the seemingly endless varieties and complexities of sour beer.
The two researchers performed a chemical analysis to find out which molecules were springing up during sour beers' brewing and fermenting processes, and to get a sense of how densely or sparsely a given compound was dispersed in the mix.
While scientists have previously studied the chemical makeup of a finished batch of sour beer, it's rare to get a look into the ways the microbes and chemicals are playing off each other as the beer actually is being made.
"As far as we're aware, people haven't done this before," Longin said. "Each individual barrel is its own ecosystem. It's a very parallel process to the way wine is made."
Sour beers are created with a process in which wild yeast and bacteria are able to colonize freshly brewed beer, and that mixture undergoes spontaneous fermentation. Brewers cool the mixture and place it in barrels so that it can age for months or years.
The process has been used in Europe for centuries and is popular in the exploding American craft beer scene.
"The Belgians are experts at aging," Soulsby said. Sours often include fruit additives, such as peaches or blackberries, which help contribute to the far-flung tastes they're known for.
Various chemical processes occur in sour brewing including the interactions between acetic acid, found in vinegar, and lactic acid, which is cultured to make yogurt.
"When it ages, those flavors blend together," Soulsby explained. "Over time sugar is released, and it can become more balsamic."
In practice, though, the process is wildly unpredictable, subject to innumerable microscopic whims.
"Some batches of beer made three or four days apart could end up with different concentrations," he said.
For fans, the allure of a sour comes in its uniquely tangy aroma and taste.
"That's what hooked me. I still get that every time I open a barrel," said Bryan Doty, who co-founded with his wife, Chintya, the brewery Sour Cellars in Rancho Cucamonga, California, about 40 miles east of Los Angeles.
Sour Cellars gave the Redlands researchers access to the beers fermenting in its barrels.
After he began home brewing around 2011, Bryan Doty's passion for sour beers was born after only a few batches. He was captivated by the many ways the beers could be crafted as well as the unique flavor possibilities when they reached a connoisseur's lips.
"It was a hobby that got out of control," he said.
Today, that hobby has fermented into a warehouse housing upward of 300 oak barrels, formerly used for red and white wines, each now incubating a batch of original sour beer during some stage of its lifestyle. Sour Cellars produces about 20 different beers each year, depending on which fruits might be available or in season.
The brewery seeks to follow "laborious and time-consuming traditional Belgian methods, combined with modern technologies to create more interesting aromas and flavors."
Through practice, Bryan Doty has found that fiddling with one variable or another can result in vastly different tastes once the beer is ready for bottling.
For instance, at the beginning, differences in a batch's pH level or mtemperature are key details to monitor or tweak. He also likes to experiment with rapidly cooling some or all of a particular batch. He documents weather patterns to keep track of how overall atmospheric conditions might be influencing the taste of a brew. And using different yeasts contributes mightily to how sour a particular beer might become.
For sours, the length of time the beer has to age is one of the key ways Sour Cellars creates the more complex and nuanced flavors for which it's known.
"I like to keep it in the barrel for at least a year," Bryan Doty said.
Unlike other more common types of beer, the brewing process for sours is lengthier, allowing beers more time to age, not unlike a good wine. Some of Bryan Doty's brews age for three or four years. This year, for instance, Sour Cellars is finally letting customers take swigs from a blend that the team began brewing in 2016, just after the brewery officially opened its doors.
So far, the collaboration between Sour Cellars and the Redlands researchers is in its nascent stages.
"All of the stuff we did was following one barrel from one batch over a year," Longin said. That means there's nearly an endless number of ways she and Soulsby can keep investigating sour beer.
The scientists plan to continue delving into the dizzying chemical complexities that sours offer, in an effort to help Brian Doty, and brewers everywhere, to design methods to improve their process.
For Brian Doty, working at the frontiers of molecular science is a long way from the proverbial bathtub where many brewers get their start. He plans to keep working with the scientists to glean more direct insights into the types of concoctions he can pour for visitors to the Sour Cellars tasting room in years to come.
"Bryan is working with us so he can make better beer," Longin said.