Mice love cocaine. Can't get enough of it. Get a mouse hooked on the drug, and it will do anything to get its fix. Scientists in America set up a special cage in which mice would have to step on an electrified grid to get a dose of cocaine. They did. A lot.

This is a story that David McCartney, the clinical head of Scotland's latest drug treatment programme, tells to his patients. "They really relate to it," he said yesterday. And so they should: the latest cutting-edge research into addiction shows drugs hit the little animal in our brains, the most primitive part of our heads.

"Drugs of abuse don't directly affect our frontal cortex, the bit of the brain we use for thinking," Dr McCartney explained. "They affect the mid-brain, the bit of the brain that is in charge of survival, the bit we have in common with animals."

The research is crucial to the way Dr McCartney, in the first project of its kind in Scotland, is treating his patients at the Lothians and Edinburgh Abstinence Programme, or Leap.

Gone is the old moral disapproval of weak people who fall foul of narcotics or alcohol. In its place comes a new understanding that the cravings for drugs, like those of the mice standing on the electrified grid to get cocaine, are as strong as the unconscious will to survive in each of us.

That, Dr McCartney reckons, is why addicts appreciate the scientific evidence of mice prepared to be electrocuted to get drugs. "Addicts continue to use drugs, despite horrendous things happening, and a big bit of their brain saying this is not right, I feel miserable about this'.

"Another bit of their brain is saying I've got to continue because if I don't I am going to die'. They are not going to die, of course, but that's what it feels like."

Dr McCartney and his colleagues at Leap believe their patients need to know how they got where they are.

He said: "We teach them what we know about the science of addiction. We tell them why they have ended up doing things they are not proud of.

"We don't tell people that their addiction is their responsibility. We tell people their recovery is their responsibility. This message is reinforced again and again."

Leap opened for business earlier this month in a handsome old kirk building in Edinburgh's upmarket Stockbridge (neighbours include the Dowager Marchioness of Bute). It is the only Scottish programme trying to replicate the successes of residential treatment in a community setting.

Leap, part of NHS Lothians, is a two-year pilot project aiming to support 80 patients a year through the crucial first three months of detoxification and rehabilitation. It will do so at a cost of around £400-£500 a week per patient, a fraction as much as residential units.

Dr McCartney believes Leap can get the same kind of results as the better residential facilities, which, according to research led by Neil McKeganey of Glasgow University, keep around one-third of their clients drug or alcohol-free three years after their treatment ends.

Dr McCartney said: "We would like to see half of our patients still clean and sober six months post-treatment. That's a tall order."

Professor McKeganey would love to see Dr McCartney get his wish. "That would be brilliant," he said. "I am really encouraged that the Scottish Government is supporting David with his abstinence-based treatment.

"We know it works in residential units. Hopefully, the pilot will show it can work in the community too."

Dr McCartney's goal, however ambitious, already has policy-makers excited. Only a tiny minority of Scotland's addicts can get a place in a residential unit, private or publicly funded. Residential rehab can cost tens of thousands of pounds.

Most heroin users in Scotland are treated in the community using methadone, a substitute drug that helps to manage, rather than cure, their disease.

Professor McKeganey's research found that fewer than 4% of those treated with methadone achieved abstinence within three years.

Holyrood's think tank, Scotland's Futures Forum, has already had a close look at Leap. The think tank is currently working on a major project to find ways to halve drug and alcohol abuse in Scotland by 2025. It wants to challenge politicians to come up with long-term strategies to achieve their aim.

Could Leap fit that bill? Dr McCartney doesn't claim his programme offers some kind of magic bullet. It is aimed at addicts who have already made the tough decision to give up.

Usually referred by their GP or other health professional, patients will already have gone some way to get themselves clean. But the Leap model could help an awful lot more people, he believes.

"It would be eminently easy to scale up," he said. "We have chosen staff who've a long track record of abstinence-orientated treatment. If we were to expand, we could do training as well."

Residential treatment remains unobtainable for most addicts. Expensive in the private sector, scarce in the public sector, there just aren't enough beds.

A study for the Scottish Government published this June struggled to say exactly what kind of residential capacity there is in Scotland, given significant differences in the treatments on offer.

There are just 22 sites offering some kind of detox, rehab or a combination of them both, according to a June study from the Scottish Government. Scotland, officially at least, can cater for 1679 drug or alcohol abusers in residential centres every year - 822 for detox, 415 for rehab and 442 in facilities that offer both detox and rehab.

Three-quarters of Leap's clients will stay in special accommodation provided by Edinburgh counCil in the capital's New Town. For three months, they will make their way to Stockbridge (in threes to help avoid temptations) for a gruelling day of group therapy, treatment and even rudimentary vocational training. When they finish their course (graduation ceremonies are planned) they will continue to be supported, not least by groups like Narcotics Anonymous.

Dr McCartney stressed how tough the treatment is. Scientists - armed with scanners - now know why.

Drugs light up the mid-brain, activating the pleasure receptors buried deep inside our heads, the simple instruments that reward things that are good for the body's survival, like eating.

Drug-taking, of course, eventually kills off many of the receptors. The hits from drugs diminish with time. So too does the pleasure from the normal little treats of life; music, chocolate, sex.

Scans also show what happens to other parts of brains of addicts. The bit that gives us judgment, the frontal cortex again, dims down when we take drugs. After treatment, addicts' brains can recover. Pleasure comes back: coffee smells nice, so do roses. But conscience comes back too: memories are painful.

"We have a saying in drug treatment," said Dr McCartney. "The good news about recovery is that your feelings come back. And the bad news about recovery is that your feelings come back."

Sometimes being clean can be too much. Drug addiction remains a relapsing disease (although not more relapsing than many others, including diabetes and asthma).

Dr McCartney knows the consequences better than most. A GP in Glasgow's Maryhill for two decades, he saw his fair share of patients lose their battle with drugs.

"We had instances in the health centre when patients died in the toilet, overdosed," he said. "It was devastating."

There's another story about mice that helps explain why so many addicts fail to stay clean. US researchers wanted to see whether stressing animals weaned off drugs would make them more vulnerable to relapse. So they threw them in buckets of water. The mice swam like mad, terrified. And then went back for more cocaine.