SAN DIEGO – Scientists are hustling on behalf of the weed industry to find new ways to produce the most valuable compounds in marijuana, ditching greenhouses in favor of big steel vats of yeast that can "brew" cannabis like Budweiser brews beer.

The science, once brought to market, would be a gold mine for those who perfect it, giving two separate industries — pharma and legal weed — stable, potent and cheap sources of the ingredients they need.

Right now, the industry's two most in-demand ingredients are THC, the compound in marijuana that gets you high, and CBD, another cannabis compound used for its medicinal effect. Today, we get those compounds by growing weed plants in large greenhouses, then extracting and isolating the active ingredients. It's a big, dirty and expensive process.

A boom in the cannabis industry, however, has driven a need to find cheaper and faster way of getting THC and CBD. Legal weed in particular has increased demand for products that will appeal to nonsmokers. Instead of the traditional lump of dried green "flower," pot dispensaries are selling oils, foods and drinks infused with THC and CBD. The food and drink items (called "edibles") have seen significant growth, now making up 40 percent of dispensaries' marijuana sales, said some estimates. They can't grow cannabis fast enough, which is why scientists are trying to produce it in labs.

And biotech companies are trying to deliver.

Instead of growing plants, these researchers have found a way to get yeast to do the dirty work. In the simplest terms, scientists insert the genes of a cannabis plant into the DNA of yeast. These mutant strains of yeast then manufacture cannabinoids like THC and CBD. This type of bioreactor isn't a new idea; yeast and other organisms have long been used to create and isolate drugs and substances. But using yeast to produce specific cannabinoids is a new branch of the science, and those in the field are still sorting out how to manufacture the stuff on an industrial scale.

Startups have been fighting naysayers from the start. "I was pitching this idea in San Diego a few years ago," said 31-year-old Sher Ali Butt, co-founder and CEO at CB Therapeutics. "Before legalization in California, nobody wanted to even take my phone call. I would go places and people would laugh me out of the room."

The laughs have died down. The idea is now out of the bag, and biotech companies across the nation are racing to patent yeast strains and the manufacturing methods of their weed biofactories. Whoever figures it out first could snag the biggest slice of the $10 billion cannabis industry's pie.