A new study of more than 160,000 Americans shows how complex our racial and ethnic mix really is.

The United States is often described as a nation of immigrants. Most of us do not have to trace our family history back more than a few generations to find an immigrant ancestor. We, or our ancestors, may come from West Africa or Vietnam or Germany or Mexico. And we usually think of ourselves as white or African-American or Latino or Asian.

But the details are a lot messier than those neat categories.

A California genetics company called 23andMe analyzes customers’ DNA to provide them with information about their ancestry. The company's senior research director, Joanna L. Mountain, and her colleagues aggregated that data to tease out the complicated ancestry Americans have written in their DNA.

“We have, now, hundreds of thousands of people who’ve contributed their genetic information as well as answered survey questions about how they self-identify and where they were born, and so on," Mountain said. “And so we put all that information together to create a genetic portrait of the United States.”

She said the major ethnic groups do not have the clear-cut ancestry their names imply.

“If you look at African-Americans, European-Americans and Latinos, people in all of those groups can have ancestry from any of those three continental regions. Even all three.”

About one in 30 Americans who identify as white has 1 percent or more African ancestry. European ancestry is much more common among African-Americans, the study found, reflecting in part a history of white men having sex with enslaved women in the 1700s and 1800s.

“The genetic data that we are looking at really kind of fit with those stories about interactions between these groups hundreds of years ago,” Mountain said.

People in this study who call themselves African-American had on average almost one-quarter European ancestry. The DNA of Latinos reflected almost two-thirds European ancestry.

The study by Mountain, lead author Katarzyna Bryc and colleagues is published online by the American Journal of Human Genetics.

One caution about this study: The 23andMe customers whose genetic information was used are not necessarily representative of all Americans.