For diseases like tuberculosis and cancer, there is no one-size-fits-all treatment. The most effective regimen will depend on the disease's DNA: Genetic sequences can reveal whether a TB infection is resistant to certain antibiotics, or whether a tumor has mutations that render some drugs useless.

To unravel these sequences, physicians must ship patients' samples to independent laboratories for testing—an inconvenient, time-consuming, and expensive process. But a new device, which enables a phone to detect mutations in a cell's DNA, may let doctors bypass the hassle.

Don't mistake this machine for a smartphone case. Its 3D-printed exterior contains two lasers, a white LED, a lens, and a filter that turn your smartphone's camera into a molecular microscope.

To use it, researchers first take a sample of a patient's cells. By treating the sample with chemicals, scientists can attach fluorescent molecules to specific genetic mutations. The phone-turned-microscope then examines the sample. If it can detect those glowing tags, it means the cells' DNA contains the mutation in question.

The result, published in Nature Communications, presents a cheaper, faster way to dissect a disease and thus tailor a better treatment for it. The device's developers, a team of researchers from UCLA, Stockholm University, and Uppsala University, suggest that a mass-produced version could hit the market for roughly $500 per unit. A high-end microscope designed for the same function can run as high as $50,000.

In remote locations and impoverished countries, the laboratories that sequence DNA may be inaccessible or simply charge too much. With this device, doctors could analyze a disease's genome themselves. Preparing the sample is a relatively simple process that doesn't require high-tech lab equipment. And after that, all they need is a phone.