A simple spit test could identify thousands of children with severe asthma who are taking medication which will never help them, scientists say.
One in seven people will not respond to salmeterol, found in purple or green inhalers, which is given to tens of thousands of children in with a high prevalance of asthma, such as New Zealand and Britain.
A study of 62 British children showed those patients could be identified and given effective treatment.
The results were published in the journal Clinical Science.
Salmeterol, which is found in Seretide and Servent inhalers, is used to relax the airways in the lungs. It is taken by children who cannot control their asthma just with a blue inhaler, which is given to all children when they are diagnosed with asthma.
The reason why some children do not respond to salmeterol is hidden in their genetic code. The drug acts on beta-2 receptors in the airways, however, one in seven people have a genetic mutation resulting in their receptors being a slightly different shape, which the drug struggles to recognise.
DNA taken from a child's spit can be tested to reveal the shape of their beta-2 receptor and whether salmeterol will work.
The study, by the Brighton and Sussex Medical School and the University of Dundee, looked at 62 children with the mutation.
Half were given salmeterol and the other half were given an alternative asthma drug, montelukast.
The researchers said the difference was "pretty striking" as symptoms improved and children had less time off school.
Prof Somnath Mukhopadhyay said: "For almost every clinical outcome we were looking at we found that salmeterol either wasn't working or was working very poorly. Montelukast was very much better.
"We've shown for the first time that personalised medicine can work in the field of childhood asthma."
He said the test, which is not yet available for use in GPs surgeries, would cost about $NZ29 and that it was "unacceptable" to give children drugs which did not work.
Prof Mukhopadhyay added: "It's a common disease affecting a million children in this country, a common medicine is probably not working in a significant proportion of the population.
"I think we need to get some guidance from lead charities and from the Department of Health."
The exact number of children who have the mutation and are taking the drug is unknown, but could be up to 15,000 in the UK.
Doctors believe they have now demonstrated the first use of personalised medicine in childhood asthma and it's likely similar tests will be developed for a range of diseases.
Anna Murphy, consultant pharmacist and Royal Pharmaceutical Society spokesperson, said: "The study itself was designed to prove that a child's genetic make-up can have an impact on the effectiveness of treatment rather than to advise on the specific treatments we use for children with asthma.
"Therefore it would not be responsible to change prescribing practice at this time."
She said parents who were concerned should speak to their pharmacist or doctor.
Prof Stephen Holgate, from the University of Southampton, said the results were "impressive" and were a "wonderful example" of personalised medicine getting closer to the GPs surgeries.
"The gene-based test is not yet available to doctors, but should become so if larger trials are equally positive."