Scientists at the University of California, San Francisco discovered that rejected male flies have a tiny neuropeptide F molecule in their brain that pushes them to drink far more than their sexually satisfied counterparts.

The levels of the molecule were higher in sexually satisfied males than in those who got no sex, leading scientists to speculate that their work could shed light on brain mechanisms behind human addiction.

A similar human molecule - neuropeptide Y - may also link social triggers to behaviours such as heavy drinking and drug abuse, according to the study published in Science journal.

"If neuropeptide Y turns out to be the transducer between the state of the psyche and the drive to abuse alcohol and drugs, one could develop therapies to inhibit neuropeptide Y receptors," lead researcher Ulrike Heberlein, a professor of anatomy and neurology at UCSF, said.

She said clinical trials were underway to determine whether neuropeptide Y can alleviate anxiety and other mood disorders as well as obesity.

For the experiment, male fruit flies were placed in a container with females flies, including both virgins and some that had already mated.

Virgin females were receptive to courting males and readily mated, but females flies who had mated lost interest in sex for a time because of sex peptide, a substance that males inject with sperm during the encounter.

Rejected males then stopped trying to mate, even when placed in the same cage as virgin flies.

But when they were placed by themselves in another container that had two straws - one containing plain food and the other containing food with 15 per cent alcohol - the rejected males binged on the alcohol.

The scientists said the behaviour was predicted by the levels of neuropeptide F in their brains.

"It's a switch that represents the level of reward in the brain and translates it into reward-seeking behaviour," lead author Galit Shohat-Ophir said.

Rejected flies had lower levels of neuropeptide F and sought an alternative reward through intoxication.

The scientists found that they could induce the same behaviours in the flies by genetically manipulating the levels of neuropeptide F in their brains.

Activating neuropeptide F production in the brains of virgin male flies caused them to behave as though they were sexually satisfied, and thus they were less keen to drink.

And lowering the levels of the molecule in sexually satisfied flies made them behave as though they were rejected, inciting them to drink more.