A lot of recent research has shown that the community of gut microbes acts almost like another organ in your body — they're that crucial. They exert a pronounced effect on the nutrients and energy that get pulled out of food. And the bacteria are thought to play a big role in a slew of health conditions, including obesity and diabetes.

But a study just published in the journal Science shows that the bugs don't have all the power in this symbiotic relationship. The dominant species in the gut are linked to — and potentially controlled by — your eating habits.

Microbiologist Frederic Bushman of the University of Pennsylvania and his co-authors compared detailed lists of what 98 people ate with bacterial DNA from stool samples that they provided. "The kinds of bacteria that are there sort of fell into groups, and we see an association between these groups and long-term diet," Bushman told Shots.

Two diet categories emerged as important. People who eat more animal protein and fat had gut microbes dominated by one genus of bacteria (Bacteroides, if you're keeping track), while high-fiber eaters tended to have more of a different genus (Prevotella). These results line up with a smaller study comparing the diets of kids in Europe, where people eat more animal products, with kids in Burkina-Faso, where the diet is primarily vegetable-based.

The study found these microbial communities are pretty stable in the short-term. The researchers changed the diets of 10 people for 10 days and took stool samples to monitor changes in gut microbes. Although they could detect small changes in the bacterial mixture after only a day (shorter than the time it took for food to completely go through the intestines), each subject's basic gut ecosystem remained relatively unchanged even after 10 days on an altered diet.

Bushman and colleagues say that this means that it's long-term eating habits, rather than short-term lapses, that are linked with gut microbial communities and health.

The health connection is why our gut microbes have drawn the interest of heavy hitters like the National Institutes of Health, which launched the Human Microbiome Project in 2008. The bacterial cells in or on the average person outnumber human cells 10 to 1, and according to Bushman, it's an even greater divide in stool samples. "The DNA that's there is overwhelmingly bacterial," he says, estimating that less than 1% of the DNA in a stool sample is human.

These results tell us that there's a difference between general types of gut bacteria, but they don't tell us which is good or bad. That's the next step, according to Bushman, who is involved with applying these results to a study of kids with inflammatory bowel diseases, such as Crohn's disease.

The step beyond that might be trying to change your gut ecosystem to improve your health, through probiotics, so-called "poop transplants," or, taking a tip from this study, an old-fashioned apple a day.