(CNN) If you diet and hit the gym regularly but are not seeing the results you hope for, it could be down to your genes.

In a new study, thin people were shown to have specific gene regions in their DNA keeping them slim, while also having fewer gene variants that have been linked to being overweight.

"We've found that there are genes associated with thinness," said Sadaf Farooqi, professor of metabolism and medicine at Cambridge University, who led the study.

In the study , published Thursday in the journal PLOS Genetics, different genetic variants were added up to create a genetic risk score, which was found to be lower in thin people and higher in obese people.

The motivation behind the study was to help people who are struggling with weight. "It's easy to rush to judgment and criticize people for their weight, but the science shows that things are far more complex," said Farooqi. "We have far less control over our weight than we might wish to think," she said.

Previous research, using twins for example, has shown that body weight differences found in the same environment can be down to genes, write the authors. "Genes play at least 40% of a role in people's weight," Farooqi told CNN. "It's much more than people realize."

Genetic risk score

In order to look into the link between genes and weight, Farooqi's team compared the DNA of around 14,000 people.

A group of 1,622 thin participants with a body mass index of 18 or less but no eating disorders or medical conditions were recruited. They were compared to 1,985 severely obese people, with a body mass index over 40, and 10,433 people of normal weight, who ranged in body mass index from 19 to 25.

DNA samples were collected from the saliva or blood of participants and the team looked for genetic variants previously identified as being associated with being overweight or obese.

By adding up the over 100 different genetic variants the team came up with a genetic risk score and found that obese people had a larger genetic risk score than normal weight or thin people, which is not surprising, said Farooqi.

On the other hand, this risk score was "very low in thin people," so they have much less of the genes that contribute to people being overweight, compared to the rest of the population she explained. "They dodged a bullet."

"Thinness is a heritable trait"

Farooqi's team also found new genetic regions involved in healthy thinness. So thin people not only stay slim "by not having the obesity genes, but they also have different genes that protect them" from gaining weight, she said.

The research concludes that "thinness, like obesity, is a heritable trait."

Obesity related conditions, such as heart disease, stroke or type 2 diabetes, are among the leading causes of mortality globally, states the study.

A possible limitation of the study, according to Farooqi is that her team found genetic regions rather than pinpointing "specific genes that keep people thin."

The next step is to find these specific genes, she said. If we can find the genes that prevent people from putting on weight "we may be able to target them to find new weight loss strategies and help people who do not have this advantage," Farooqi said.

Get CNN Health's weekly newsletter Sign up here to get The Results Are In with Dr. Sanjay Gupta every Tuesday from the CNN Health team.

Tim Spector, professor of genetic epidemiology at King's College London, agreed that the study highlights what we have known for the last 15 years from twin studies. "Namely that genetics are important in your propensity to be thin or obese. Generally thin people are more likely to have several thin relatives and obese people obese relatives."

Spector, who was not involved in the research, added that the genes found in this study "add to the list found from larger studies and are helpful for understanding mechanisms." But "don't help" in individual predictions of obesity, he said in an email to CNN.

"About a third of people in most countries manage to remain thin despite exposure to poor food environments. Some of this is down to genes, but other factors like individual differences in lifestyle or gut microbes are likely to also be responsible," said Spector.

Challenging assumptions about weight

The new paper "challenges the automatic assumption by some that overweight people are lazy or lack willpower, and that's a positive thing, but we do know that there are a host of other factors, other than genetics, at play in determining a patient's weight, such as diet and how often they exercise," said Dr Steve Mowle, honorary treasurer at the Royal College of GPs in the UK, in an email to CNN.

He warned that although the study suggests that more slender people are genetically predisposed to a reduced risk of obesity, "the risk factors of an unhealthy lifestyle are the same."

"GPs will always recommend maintaining a healthy lifestyle to all of their patients, regardless of their weight or genetic predisposition, including making sure patients are eating a well-balanced diet, taking regular exercise, drinking alcohol in moderation, not smoking, and getting enough sleep," said Mowle, who was not involved in the research.