EDINBURGH is the world capital for the red-hair gene according to DNA research which is also shattering popular beliefs about the origins of the trait.

Scientists working on Scotland's DNA project have discovered that variants of the red-hair gene are carried by 40% of the population in the south-east region, compared to rates of 35% in the west and 37% in north-east Scotland. In north-west Scotland, taking in the isle of Lewis, the proportion of carriers drops to just 29% - putting it on a par with Devon and Cornwall in England.

The researchers behind the DNA project now believe that the red-hair gene emerged in Scotland thousands of years ago, contradicting commonly-held beliefs that it was brought here by the Vikings or successive waves of Celtic migration.

The place where the gene is found in the highest frequency is its likeliest country of origin, and nowhere else in Britain or Ireland has matched the 40% rate detected in Scotland.

The gene spread and became rife: the 1st-century Roman historian Tacitus described the tribal people living in the north of Britain, known as Caledonians, as "red-haired and large-limbed".

The reason the gene took hold so strongly is believed to be its role in increasing vitamin D absorption from sunlight in the dull and cloudy climate of northern Britain.

People carrying the gene had the fairest skin and could therefore soak up more UV rays than anyone else, helping to generate more vitamin D in their bodies and in turn develop stronger teeth and bones - giving carriers a reproductive advantage.

Katie Barnes, geneticist for Scotland's DNA project, said: "Because it's so cloudy in Scotland you need to be able to pick up as much vitamin D as possible and having red hair affects your skin type and allows you to absorb more vitamin D from the sun.

"We don't really know when it first emerged. It's a much debated concept, but we're not quite sure. When Scotland first started to be populated, people would have adapted to the climate."

Modern humans are believed to have first settled in Scotland around 10,000 years ago, suggesting that the red-hair gene probably emerged at some point between 8000-3000BC.

However, researchers were surprised when their initial findings from the Scotland's DNA project appeared to confound this connection with sunlight.

Instead of an expected increase in the gene as the population from southern to northern Scotland, peak rates were actually identified in the south-east corner of the country.

They now believe that this has come about because Scotland's indigenous red-hair gene has been diluted in the north by the influx of stronger Viking genes and drowned out in the west by waves of Celtic DNA.

In that sense, red hair is a remnant of ancient Scotland.

Since the gene is recessive, most carriers will not actually have red hair - but they could pass it on to their children.

There are around 37 variants - or mutations - of the gene, ranging from weak to strong. Someone with two weak variants may be barely noticeable as a redhead but will probably be prone to sunburn. So if you've ever wondered why your milk-bottle white Scottish skin fails to tan even though your hair is dark, the red-hair gene is probably to blame - and it was once an evolutionary advantage.

Ms Barnes added: "It's interesting to see how different human invasions have influenced the genetic population of Scotland.

"We expected to find a clear correlation between sunlight and red hair, so in the north we were going to find more people with red hair or the red-hair gene. But what we actually found was that it had been diluted.

"That's something that's come from our study already which we've been able to draw up on a map and see where these invasions have occurred and correlate them with historical events.

"The main aim now is to get more Scots to take the DNA test. The more people who take part, the more we understand about the genetic history of Scotland."

l More revelations from the Scotland's DNA project will be published in The Herald next month.