A test which tells women if they are unlikely to get pregnant through IVF could spare years of heartache and the expense of costly procedures which will never work.

Doctors have been puzzled why some women still fail to conceive even when a healthy embryo is implanted through assisted fertility techniques.

But now they have discovered that women who never become pregnant carry a specific genetic ‘fingerprint’ in the womb which appears to hinder pregnancy.

In trials, all women suffering from the problem tested positive for the genetic signature and 81 per cent of those who did not have it were given the all clear after a biopsy of their womb lining.

Professor Nick Macklon, medical director of Complete Fertility Centre Southampton, which is based at the city’s Princess Anne Hospital, said: “Many women undergo a number of IVF cycles without success despite having good quality embryos and, up to now, it has been unclear whether or not the lining of the womb may be the cause of that.

“We have now shown that an abnormal gene expression in the lining can be identified in many of these women and that a specific gene 'fingerprint', when present, is always associated with failure, which is very significant in aiding our understanding of IVF failure.”

Prof Macklon said it could also lead to the development of a new test to help patients understand how likely they are to achieve a pregnancy before they embark on the treatment process – and to guide others on whether or not they should continue even after a number of unsuccessful cycles.

Under NHS guidelines, women should be offered three rounds of IVF, but budget cuts mean around 80 per cent of trusts do not offer the full allocation, meaning many women are forced to go private, which can cost thousands of pounds per cycle and lead to years of heartbreaking attempts which will never be successful.

To find out if there were gene changes driving recurrent implantation failure, doctors at University Medical Center Utrecht and Academic Medical Centre in Amsterdam took biopsies from 43 women with the condition and compared them with 72 women who had gone on to have babies through IVF.

During analysis of the biopsies in Utrecht and Southampton, scientists found an abnormal gene profile in the lining of the womb in 100 per cent of women with recurrent implantation failure that was not present among women who had given birth after IVF treatment.

Professor Frank Holstege, head of the genomics laboratory at University Medical Center Utrecht, said: “What this tells us is that a large proportion of women who suffer recurrent implantation failure may be infertile due to a problem with the receptivity of their uterus.

“Their chances of achieving successful pregnancy are likely to be very small and this information gives clinicians much more clarity in counselling patients as to the wisdom of investing further time, effort and money in ongoing treatment.

“At the same time, those patients who have undergone a number of unsuccessful cycles of IVF but do not have the genetic pattern could be advised to persist as they have a much better chance of achieving a pregnancy.”

Prof Macklon, a consultant gynaecologist at University Hospital Southampton NHS Foundation Trust added: “While we believe this finding to be a very significant development in international fertility research, the next stage is to trial it as a clinical test to study its effectiveness on a wider scale.”

Dr Geoffrey Trew, consultant in Reproductive Medicine and Surgery at Hammersmith Hospital, London said the test, showed promise.

"This could be very useful for a small amount of patients who have repeated implantation failure with good embryos and no other cause identified. It will have to go through more trials to validate it, but the basic science is good - and promising."