In late spring 2017, Andrea Ganna approached his boss, Ben Neale, with a pitch: He wanted to investigate the genetics of sexuality. Neale hesitated. One of the top geneticists in the country, Neale and his colleagues at the Broad Institute, a pioneering biotech hub in Boston, had a decade earlier developed software that made it much easier for scientists to study the vast amounts of genetic data that were beginning to flood in. It was the kind of tool that helped illuminate a person’s risk of developing, say, heart disease or diabetes. And now, as Ganna was proposing, the approach could be applied to the foundations of behavior, personality, and other social traits that in the past had been difficult to study.

Ganna wanted to pounce on a new opportunity. A giant collection of carefully cataloged genomes, called the UK Biobank, was about to become available to researchers. A scientist could apply and then gain access to data from 500,000 British citizens—the largest public repository of DNA on the planet. To Ganna, the genetic origins of being gay or straight seemed like the kind of blockbuster question that might finally get an answer from a data set of this size.

Neale wasn’t so sure. As a gay man himself, he worried that such research could be misconstrued or wielded to advance hateful agendas. On the other hand, a better understanding of how genetics influences same-sex attraction could also help destigmatize it.

Then Ganna mentioned that another group was already pursuing the question using the UK Biobank: a geneticist named Brendan Zietsch, at the University of Queensland, and his colleagues. In 2008, Zietsch published a study suggesting that the genes straight people shared with their gay twins made them more successful at bedding heterosexual partners. Now he was going to further test this “fecundity hypothesis” with a much more powerful data set. He’d also proposed investigating the genetic associations between sexual orientation and mental health. Thinking his lab could add expertise coupled with caution to such a project, Neale agreed they should try to team up with Zietsch.

“Armed with the knowledge that this research was going to be done, I thought it was important that we try and do it in a way that was responsible and represented a variety of different perspectives,” he says, noting that, because there is so much genetic data to work with these days, collaborations in his field are commonplace “But it was also important to me personally, as a gay man, to get involved.”

From the outset, Neale expected some pushback and misunderstandings. That’s why he involved LGBTQ+ groups along the way, something not technically required for the kind of research he was doing. But he wasn’t prepared for scientists within his home institution to rise up and challenge the value and ethics of his work. And he was even less prepared for a company to exploit the results of the study—just a few weeks after it was published in the journal Science—to sell an app purporting to predict how attracted someone is to the same sex.

Sold as infotainment on a website called GenePlaza, the How Gay Are You? app might have seemed harmless to some. But it’s easy to envision how it could be abused, especially as more and more people get their DNA tested at younger and younger ages. Imagine the app getting passed around a middle school slumber party and stigmatizing results getting posted to social media. Or being used to screen applicants looking to rent an apartment or buy a condo (which would be perfectly legal under current US federal law and prohibited in only 22 states). In places with fewer civil rights protections, it’s even easier to see how such a tool could be wielded as an instrument of oppression. A state could surreptitiously collect DNA in order to persecute LGBTQ+ people, similar to how China has used genetic information to identify and imprison more than a million Uighurs, an ethnic Muslim minority in China. “It all depends on who’s using the data and why,” says Mildred Cho, a biomedical ethicist at Stanford who specializes in genetics. “Even if you don’t get sent to the gulag, there are lots of direct harms that can come out of ascribing labels to people based on their DNA.”