From sophisticated imaging tools to cancer-sniffing dogs, researchers are constantly seeking better ways to detect disease, which could lead to earlier and more effective treatment. In recent years, genetically manipulated bacteria seemed like promising indicators, but they never made it to the clinical setting because they couldn’t reliably distinguish important chemical signals in complex samples. Now, two research teams have engineered E. coli bacteria to accurately detect the telltale chemical signs of diabetes and liver cancer in urine. The two studies were published today in Science Translational Medicine.

In the first study, researchers manipulated E. coli‘s genes to make the bacteria reliably detect high glucose levels in urine–an indicator of diabetes. Once the glucose levels reach a certain threshold, the bacteria turn red. When the researchers tested these “bactosensors” in samples from 13 patients, the bacteria indicated problematically high glucose levels just as reliably as conventional urine dipsticks. The researchers hope that this same sort of bacterial genetic manipulation could help detect other diseases.

In the second study, researchers from the University of California, San Diego manipulated E. coli to identify the early stages of metastatic liver cancer. Special bacteria live in and around tumors, possibly due to cancer’s ability to quiet the immune system. This could be helpful in detecting liver cancer, which is particularly difficult to identify in its early stages because imaging techniques like MRI often can’t catch the tiniest tumors. The researchers modified the E. coli‘s genes so that, when fed to mice with liver cancer, it secretes a particular enzyme. The enzyme creates a molecule that glows, but it’s hard to see inside the mice, so the researchers modified a second type of bacteria that turns mouse’s urine red if the glowing molecule—and, thus liver cancer—is present. The technique didn’t cause any serious side effects in mice after a year of monitoring. The researchers hope this technique can be used to help diagnose other types of cancers, but they want to run more tests to be sure that it’s safe before trying it in humans.

Overall, these two new studies show that synthetic biology is helping researchers identify disease non-invasively and reliably. Maybe, once these techniques are more developed and tested, clinicians will be able to diagnose patients with a simple urine sample.