There is no one gene that determines a person's sexual orientation, but genetics — along with environment — play a part in shaping sexuality, a massive new study shows.

Researchers analyzed DNA from hundreds of thousands of people and found that there are a handful of genes clearly connected with same-sex sexual behavior. The researchers say that, although variations in these genes cannot predict whether a person is gay, these variants may partly influence sexual behavior.

Andrea Ganna, lead author and an instructor at Massachusetts General Hospital and Harvard Medical School, said the research reinforces the understanding that same-sex sexual behavior is simply "a natural part of our diversity as species."

The new study, published Thursday in the journal Science, is not the first to explore the link between genetics and same-sex behavior, but it is the largest of its kind, and experts say it provides one of the clearest pictures of genes and sexuality.

Ganna and an international team of scientists examined data from more than 470,000 people in the United States and the United Kingdom to see whether certain genetic markers in their DNA were linked to their sexual behavior. Specifically, the researchers used data from the UK Biobank study and from the private genomics company 23andMe, which included their DNA data and responses to questions about sexual behaviors, sexual attraction and sexual identity.

More than 26,000 participants reported at least one sexual encounter with someone of the same sex. Earlier studies, the researchers said, weren't large enough to reveal the subtle effects of individual genes.

The researchers were able to find five genetic variants that were statistically associated with same-sex sexual behaviors, but none had a large effect and none could itself predict same-sex behaviors. One of the variants was found in a stretch of DNA that includes several genes related to the sense of smell. Another one of the genes is related to male pattern baldness, which the authors said could suggest that sex hormone regulation may somehow be involved.

These variants, along with thousands of others in the human genome that have even smaller effects, together accounted for 8% to 25% of variation in same-sex sexual behavior, the analysis showed. Some of the variants were correlated with same-sex sexual behavior in men, others in women, and some in both.

Eric Vilain, director of the Center for Genetic Medicine Research at Children's National Health System, said the study marks the end of "the simplistic concept of the 'gay gene.' "

"It just shows us that same-sex sexual behavior is much more complex than this idea of having just one gene influencing it all," said Vilain, who was not involved in the study. "It shows that there are genetic factors, which we had suspected long ago … but it also shows those genetic factors do not tell the whole story."

Zeke Stokes, chief programs officer for GLAAD, said the new research "provides even more evidence that being gay or lesbian is a natural part of human life, a conclusion that has been drawn by researchers and scientists time and again."

There are limitations to the new research. Vilain noted that the study's authors placed all participants who had reported even one same-sex sexual event into the same group. "The problem with this is that it might dilute the efficiency of a search for genetic factors that may be present only in individuals who have exclusive same-sex attraction throughout their lives," he said.

That said, Vilain added, "it does capture the complexity of same-sex attraction. It captures real-life experiences rather than trying to put people into bins that are always arbitrary."

Also, Vilain said the study, which includes mostly European-American participants, lacks key diversity. "It's missing out on what's going on in other populations," he said.