In recent years, scientists have found out all sorts of remarkable things about a group of creatures that are entirely invisible to the naked eye: the trillions of bacteria that colonize every surface of our bodies.

These organisms—collectively known as the microbiome—deeply affect our health, governing our intake of fat, our likelihood of developing allergies and even how often we get bitten by mosquitoes.

New science, though, is indicating that the relationship goes both ways. These microorganisms affect us, but our underlying genetics also control which species of bacteria are able to thrive in and on our bodies.

One of the most striking examples of this was published today in the journal PLOS ONE. In the study, a group of researchers from Ohio State University analyzed the species of bacteria that lived in the mouths—either in saliva, on tooth surfaces or under gums—of 192 volunteers.

By sequencing all of the bacterial DNA present in a sample swabbed from each person’s mouth, the researchers detected 398 different bacteria species in total. Each volunteer, on average, harbored 149 different species of oral bacteria.

But perhaps the most interesting finding was that there was a tremendous amount of diversity between individuals—only 8 species were present in every single participant’s mouth. “No two people were exactly alike. That’s truly a fingerprint,” Purnima Kumar, the study’s lead author, said in a press statement.

This bacterial diversity, though, wasn’t entirely random: It correlated with the ethnic group of the volunteer. In other words, people from each of the four different ethnic groups represented in the study (all participants self-identified as either Caucasian, African-American, Chinese or Latino) generally had similar species of bacteria, especially underneath the gums.

As a result, simply by counting which varieties of bacteria appeared in this area, the researchers developed a model that was able to guess a person’s ethnicity with an accuracy significantly better than chance—it got it right 62 percent of the time. Some groups were even easier to identify via the bacteria than others: It could correctly identify Latinos 67 percent of the time and African-Americans with 100 accuracy.

The variation along ethnic lines, they believe, is a reflection of genetics, not environment. That’s because, if you assumed that the mouth microbiome is totally dependent on environmental factors, you’d expect that members of the same ethnic group would have different mixes of bacteria depending on whether they were first-generation immigrants to the U.S. or had family histories that stretched back generations in the country. Instead, people’s background—in terms of foods they ate and other lifestyle trends—didn’t seem to have any correlation with the bacterial communities in their mouths. But their ethnicity and thus their similar genetics matched their microbiome more often than chance.

Interestingly, the original goal of this research wasn’t to find new differences between people from different ethnic groups, but to examine the bacterial traits shared between people with good oral health (the researchers are mostly from OSU’s School of Dentistry). But when the researchers analyzed the data, they were struck by the ethnic similarities. Although they sampled bacteria from all regions of the mouth, those found under the gumline had the strongest correlation to ethnicity (and thereby genetics), likely because they’re the least disrupted by environmental factors such as diet or smoking.

The surprising ethnic finding could yield benefits for oral health. The fact that people of different ethnicities harbor different sorts of oral bacteria could lead to medical treatments that are tailored to a patient’s genetic background. If research eventually reveals that someone with certain oral bacteria species in high quantities is predisposed to certain ailments, for example, he or she could be proactively screened for these diseases.