Some boys turn homosexual during childhood because of genetic changes triggered by their environment, scientists have suggested in findings that are likely to prove highly controversial.
Factors ranging from exposure to certain chemicals to childhood abuse, diet and exercise may affect the DNA controlling sexuality, according to research being presented at a US conference on genetics.
In some cases, the genetic changes could be used to determine whether a man is straight or gay, the scientists suggested, raising concerns that medical records might one day reveal a person's sexuality.
The research by scientists at the University of California has not yet been published, but is being discussed at the annual meeting of the American Society of Human Genetics in Baltimore.
Researchers studied 37 sets of male identical twins - born with the same genetic blueprint - but where only one brother was gay, to tease out which genes were associated with homosexuality. Only 20 per cent of identical twins are both gay, leading researchers to believe there must be causes which are not inherited.
They found that it was possible to identify tiny changes in how a person's DNA functions as they develop, that allowed them to predict whether a man was gay or straight.
While DNA works as an instruction manual for inherited characteristics, such changes in function, known as epigenetics, determine which parts of the text are acted on and which can be ignored. Epigenetic changes are known to be triggered by environmental factors. Researchers identified nine areas in the genetic code where genes functioned differently when a twin was homosexual.
They believe they can predict with 70 per cent accuracy whether a man is gay or straight, simply by looking at those parts of the genome.
"To our knowledge, this is the first example of a predictive model for sexual orientation based on molecular markers," said Dr Tuck Ngun, the lead author. "Sexual attraction is such a fundamental part of life, but it's not something we know a lot about at the genetic and molecular level. I hope that this research helps us understand ourselves better and why we are the way we are."
British scientists said the work was intriguing but should be treated with caution until a scientific paper was published.
Tim Spector, professor of genetic epidemiology at King's College London, said: "It has always been a mystery why identical twins who share all their genes can vary in homosexuality.
"Epigenetic differences are one obvious reason and this study provides evidence for this. However, the small study needs replicating before any talk of prediction is realistic."
Prof Darren Griffin, of the University of Kent, added: "While there is strong evidence in general for a biological basis for homosexuality my personal impression has always been one of a multiple contributory factors, including life experiences.
"My gut feeling is that, as the complete story unfolds, the association may not be quite as simple as suggested.
"To claim a 70 per cent predictive value of something as complex as homosexuality is bold indeed."