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 European Molecular Biology Laboratory group leader at the Institute of Molecular Medicine in Finland, said the research reinforces the understanding that same-sex sexual behavior is simply “a natural part of our diversity as a 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, who is also an instructor at Massachusetts General and Harvard, 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. And 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 percent 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.”

Previous studies have suggested that sexual orientation and same-sex behaviors may be, at least in part, genetic. For instance, research has shown patterns in families with multiple men in the same family identifying as gay. There is some evidence of a correlation between left-handedness and same-sex attraction, and left-handedness has both genetic and environmental influences. Environmental effects may be a factor for some people; for instance, having older brothers increases the odds that younger brothers will be gay, which researchers suspect may have to do with changes to the mother’s immune system in response to the earlier pregnancies.

Zeke Stokes, chief programs officer for GLAAD, said in a statement that the new research on the genetics “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. The identities of LGBTQ people are not up for debate. This new research also reconfirms the long established understanding that there is no conclusive degree to which nature or nurture influence how a gay or lesbian person behaves.”

There are limitations to the new research. Vilain, chair of the Department of Genomics and Precision Medicine at George Washington University, 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.

Read more:

Seeking a scientific explanation for trans identity could do more harm than good

Families of gay kids were once seen as the enemy by support groups. That’s changing.

A scientific look at the damage parents do when they bully their gay kids