Imagine a tiny enzyme inside bacteria that acts like a light-activated switch, flipping back and forth between two different shapes depending on whether it's in light or darkness. That's exactly what researchers at the University of Bayreuth and Forschungszentrum Jülich in Germany have been studying — and they've just figured out how this shape-shifting works.

Their discovery, published in the journal Science Advances, focuses on proteins called sensor histidine kinases, or SHKs for short. These enzymes help bacteria do everything from turning genes on and off to deciding whether they should cause disease. Scientists also use engineered versions of these proteins in a field called optogenetics, where light is used to control living cells with incredible precision.

The research team, led by Ulrich Krauss from the University of Bayreuth and Renu Batra-Safferling from Forschungszentrum Jülich, combined three different methods to solve the puzzle. They used crystallography — a technique that reveals the 3D structure of proteins — along with analyzing the proteins floating in solution and testing how the enzymes actually function. This combination let them watch the switch in action.

Here's what they found: when the enzyme sits in darkness, it curls into an asymmetric, bent shape. But zap it with light, and it straightens out into a symmetrical form. That change isn't just cosmetic — it completely changes what the enzyme does. In its bent form, the enzyme acts like a kinase, adding phosphate groups to other molecules. In its straight form, it flips to become a phosphatase, removing those same phosphate groups instead.

"Put simply, in the asymmetrical form, key parts of the enzyme are oriented in such a way that kinase activity is possible," Krauss explained. "The transition to the symmetrical, straight form changes this arrangement and renders the components incompatible with the kinase function."

Those phosphate groups matter a lot. They're part of a chain of chemical signals that ultimately controls which genes are active inside the cell. So by changing shape, the enzyme essentially decides whether to turn genes on or off — all because of a flash of light.

The researchers say this new understanding could help create better optogenetic tools for medicine and biotechnology. Instead of crude genetic engineering, doctors might one day use precisely targeted light to control cells in the body — turning off harmful bacteria, for instance, or activating healing processes at the flip of a switch. The team is now studying how universal this mechanism might be across other similar proteins, hoping to unlock even more applications.