To limit antibacterial resistance and treat deadly viruses, researchers need better tools to diagnose the root causes of illnesses.

Do you have a bad cold or the flu? A viral sinus infection or a bacterial one? There’s no current concrete way for doctors to know.

The hunt is on, though, for a test that could quickly tell doctors whether an illness is viral or bacterial.

As it stands, just 5 percent of antibiotics given worldwide are correctly prescribed, a problem whose proportions have become even more significant as antibiotic-resistant bacteria have emerged as a serious health threat.

A study published today in the journal Immunity hopes to take the science behind a diagnosis to a new level. Many other studies have found differences in immune response to a small set of viruses and bacterial illnesses in relatively small groups of test subjects. The newer research includes more than 3,000 blood samples that come from a dozen countries and multiple viral and bacterial respiratory infections.

Such a broad set of samples allowed the researchers to look for a telltale immune response that would apply to a range of viral infections —“something that shows up over and over and over again,” Purvesh Khatri, Ph.D., author of the study, and a research professor at Stanford University School of Medicine, said.

Read More: Chlorine in Water Treatment May Be Breeding Drug-Resistant ‘Superbugs’ »

The blood samples in this research came from a number of different studies. Some patients provided multiple blood samples over a small window of time, which made it possible for researchers to watch their immune responses unfold.

According to Ephraim Tsalik, M.D., Ph.D., an assistant professor of medicine at Duke University who did some of the studies that were re-analyzed in the new study, putting previous findings through a single process “does a great job of adding confidence to the work that some of these other groups have done.”

Khatri and his colleagues identified genetic cell responses that are a hallmark of the body’s reaction to a viral and bacterial infection.

“Despite all this heterogeneity we could find a gene signature that’s common across all the respiratory viruses we looked at, including SARS, flu, enterovirus and adenovirus,” Khatri told Healthline.

The gene signature could also identify people who had been infected with a respiratory virus up to 24 hours before they showed any signs of illness.

It was as if the body was also sorting pathogens to determine how to defeat them; one bucket for bacterial invaders and a second bucket for viral invaders. When a pathogen goes into the viral bucket, it triggers a certain basic response as the body identifies which virus it’s dealing with and fine-tunes its reaction.

The genetic signature for viruses — the bucket response — involved 136 genes. That’s too much for a doctor to use as a quick lab test. The goal, Khatri said, is to pare down the findings to a smaller set of genes without losing accuracy.

To that end, the researchers first focused on flu infections.

“We found an 11-gene signature that now actually was able to distinguish influenza virus from all other respiratory viruses,” he said.

Research participants who received flu vaccines — which usually consist of a dead virus — mounted the same response over time. That showed the vaccine working.

In the short term, the findings could be used to test whether older patients were responding to a flu vaccine enough to provide protection from a live virus.

Read More: Do Antibacterial Soaps Do More Harm Than Good? »

There are two Holy Grails that this area of research is tracking. First, allowing doctors to tell patients with certainty whether they do or don’t need antibiotics.

Khatri’s work would allow them to confirm a viral infection. The big loophole is that some patients have both viral and bacterial infections. Looking only for the signature of a viral infection is limiting, because a healthy patient and one with bacterial pneumonia look the same, Tsalik cautioned.

“What clinicians really need to know is, ‘Do I need to give antibiotics or not?’ Unfortunately a lot of what’s driving overuse of antibiotics is that clinicians are aware of the possibility of co-infection,” he said.

But in the longer term, the Stanford researchers hope their findings can point the way to broad-spectrum antiviral drugs.

There are only a handful of antiviral drugs widely available, and they work by targeting the virus itself. The trouble is that viruses often mutate. The researchers hope to find out if targeting some part of the body’s immune response that all or most viruses have adapted to use to their advantage, would combat issue.

“The core motivation for this study came from the hypothesis that we would be able to find pathways that multiple viruses are using,” Khatri said. “If we can find those pathways, then we could use drugs that would target those pathways.”

Such drugs would likely have more side effects because they may destroy human cells. Drugs that kill human cells are called cytotoxic. But depending on the circumstances — which could include deadly outbreaks — even cytotoxic drugs can be useful.

“The disadvantage is it could increase cytotoxicity, but when you have dengue and Ebola, do you want to worry about cytotoxicity or do you want to worry about life?” Khatri said.

Read More: Zoloft Could Be a Treatment for Ebola »