Analyzing the bacteria that live in our bodies, the scientists identified genes for making over 3,000 previously unknown molecules that may prove to be useful drugs.

“Nobody had thought to look that close to home,” said Dr. Fischbach.

Finding these small molecules — known as natural products — has traditionally been a slow affair. Microbes typically make natural products in exquisitely tiny amounts, and they don’t rely on a single gene to do so. Instead, microbes need dozens of different proteins made by different genes to craft a natural product.

Dr. Fischbach and his colleagues set out five years ago to speed up the search. They wrote a software program that learns how to recognize the genes for natural products.

Those genes tend to sit together in a cluster in a microbe’s DNA, and they are very similar to one another. By shuffling them into different combinations, microbes can produce a staggering range of molecules.

To train the software, Dr. Fischbach and his colleagues introduced it to 732 gene clusters that are already known to make natural products. As the software examined cluster after cluster, it came to recognize distinctive patterns. Eventually the program got so good that it could accurately pinpoint new gene clusters in DNA sequences it had never encountered before.