Computers have been taught to tell deadly food poisoning bugs apart - a breakthrough that could save hundreds of lives a year.
Machine learning can identify bacteria, such as E.coli, that is likely to cause outbreaks, say scientists.
The study may help public health officials target interventions and reduce risk to human health.
More than a million food poisoning cases are diagnosed in England and Wales each year, although the number of deaths has fallen to around 500.
E. coli is normally spread through traces of animal waste. Some strains are more toxic than others, producing a powerful poison called verocytotoxin which can cause kidney failure and death.
So researchers at the University of Edinburgh's Roslin Institute used software that compares genetic information from bacterial samples isolated from both animals and people.
The software learns the DNA signatures that are associated with samples that have caused outbreaks of infection in people.
It can then pick out the animal strains that have these signatures, which are therefore likely to be a threat to human health.
Most E. coli strains live in the guts of people and animals without causing illness but E. coli O157, for instance, is linked with more serious human infections.
Cows also carry E. coli O157 and serve as the main reservoir for these toxic bacteria. The animals excrete the bacteria in their faeces but do not become ill.
This makes it difficult to spot which herds and animals are carrying strains that are likely to cause disease in people.
The team trained the software on DNA sequences from strains isolated from cattle herds and human infections in the UK and the US.
Once trained, the computer is able to predict whether an E. coli strain is likely to have come from a cow or a person.
Using this approach, the team predicts that less than ten percent of the E. coli O157 cattle strains are likely to have the potential to cause human disease.
Interventions to stop the spread of the disease - such as vaccines - could be targeted at herds with these strains to minimise the risk of outbreaks in people, the team says.
E. coli O157 causes stomach cramps, vomiting and severe diarrhoea in infected people.
A recent outbreak of the illness in Scotland resulted in the death of a child and a further 19 cases of serious food poisoning. The infection is believed to have originated from an unpasteurised cheese source.
Professor David Gally said: "Our findings indicate the most dangerous E. coli O157 strains may in fact be very rare in the cattle reservoir, which is reassuring.
"The study highlights the potential of machine learning approaches for identifying these strains early and prevent outbreaks of this infectious disease.
"We hope by investigating the genes the software uses to discriminate the strains, we can learn why certain isolates are more of a threat to human health."
Researchers say their approach could be adapted to test samples of other types of bacteria isolated from animals - such as salmonella and campylobacter - to identify strains with the potential to cause human disease.
The study, funded by Food Standards Scotland and the Food Standards Agency, is published in the Proceedings of the National Academy of Sciences.
Why are you making commenting on The Herald only available to subscribers?
It should have been a safe space for informed debate, somewhere for readers to discuss issues around the biggest stories of the day, but all too often the below the line comments on most websites have become bogged down by off-topic discussions and abuse.
heraldscotland.com is tackling this problem by allowing only subscribers to comment.
We are doing this to improve the experience for our loyal readers and we believe it will reduce the ability of trolls and troublemakers, who occasionally find their way onto our site, to abuse our journalists and readers. We also hope it will help the comments section fulfil its promise as a part of Scotland's conversation with itself.
We are lucky at The Herald. We are read by an informed, educated readership who can add their knowledge and insights to our stories.
That is invaluable.
We are making the subscriber-only change to support our valued readers, who tell us they don't want the site cluttered up with irrelevant comments, untruths and abuse.
In the past, the journalist’s job was to collect and distribute information to the audience. Technology means that readers can shape a discussion. We look forward to hearing from you on heraldscotland.com
Comments & Moderation
Readers’ comments: You are personally liable for the content of any comments you upload to this website, so please act responsibly. We do not pre-moderate or monitor readers’ comments appearing on our websites, but we do post-moderate in response to complaints we receive or otherwise when a potential problem comes to our attention. You can make a complaint by using the ‘report this post’ link . We may then apply our discretion under the user terms to amend or delete comments.
Post moderation is undertaken full-time 9am-6pm on weekdays, and on a part-time basis outwith those hours.
Read the rules here