Urine offers a non-invasive test
A urine test could help doctors decide which drugs will be most effective for their patients, scientists have shown.
In trials the test predicted how well men would respond to paracetamol.
It works by analysing levels of different by-products of metabolism - the chemical reactions the body uses to make energy.
The experts from Imperial College London and the drug giant Pfizer report their findings in Proceedings of the National Academy of Sciences.
The researchers say this kind of "metabolic profiling" could ultimately allow doctors to work out perfect drug matches for individuals, with no risk of side effects.
They trialled a prototype of the urine test in 99 men taking one dose of the commonly used painkiller paracetamol.
The results showed that a compound in the urine , called para-cresol sulphate, predicted how well the men were able to metabolise the drug.
Those with higher levels of para-cresol sulphate, made from para-cresol produced by bacteria in the gut, metabolised paracetamol less effectively than those with lower levels.
The scientists suggest that this is because the body uses compounds containing sulphur to process drugs like paracetamol effectively and para-cresol can deplete sulphur compounds in the body.
Many other drugs also rely on sulphur.
It may be possible to alter the make-up of the bacteria so that the body can process a variety of drugs more effectively and safely, say the researchers.
Senior author of the work, Professor Jeremy Nicholson, said: "This result is very encouraging.
"Pre-clinical studies had suggested it might be possible to predict how individuals would react to drugs by looking at their pre-dose metabolite profiles, but this is the first time that anyone has been able to show convincingly that such a test could work in humans.
"The beauty of the pre-dose metabolite profiling is that it can tap into both genetic and environmental factors influencing drug treatment outcomes."
Jayne Lawrence, of the Royal Pharmaceutical Society, said the findings were exciting and potentially very useful, but added: "More work needs to be performed on larger populations and on different drugs to say whether the methodology is going to be predictive and therefore useful to prescribers."