If you pull an all-nighter or stay up late to binge watch Game of Thrones, you will probably be grumpy the next day. But if you don’t get enough sleep for weeks or months on end, you may develop depression or other lasting mood problems, and Howard Hughes Medical Institute (HHMI) researchers have now discovered a possible reason why.

A team led by HHMI investigator Louis Ptáček and Ying-Hui Fu of the University of California, San Francisco, identified a gene that might serve as a molecular intersection between our mood and the biological, or circadian, clock that determines when we are awake and when we sleep. The research was published on February 22, 2016 in the journal, Proceedings of the National Academy of Sciences.

“If we don’t get enough sleep, it has myriad health consequences,” including for our mental health, says Ptáček. People who work the graveyard shift, for example, are more susceptible to a variety of illnesses, including mood disorders such as depression. So far, scientists haven’t been able to pinpoint a molecular mechanism that can explain how alterations in our circadian clock promote mood disorders.

The researchers’ interest was piqued by their studies of three members of a family who have familial advanced sleep phase (FASP). Individuals with FASP are extreme morning people, naturally waking up before 5:30 AM–and sometimes as early as 2 AM. Because these folks get a normal amount of sleep, FASP isn’t considered a disease, Ptáček notes. In fact, some people with FASP revel in their ability to start working before everyone else. However, rising so early has its downsides, especially in a world where most people get up–and stay up–later than individuals with FASP. By early evening, “their head is falling onto their dinner plate,” says Ptáček. In addition, all three family members examined by the researchers showed signs of seasonal affective disorder, a mood disorder in which people become depressed at the same time every year, usually when the days get shorter during winter.

Ptáček, Fu, and colleagues found another similarity among the family members–all of them carried faulty versions of PER3, a circadian clock gene. To investigate the gene’s role in the subjects’ seasonal affective disorder, the researchers genetically modified mice to carry two copies of defective PER3. Unlike humans, mice mainly sleep during the day and move around at night. Scientists track their activity by measuring when they start and stop scurrying in their running wheels.

When the rodents were exposed to 12 hours of light per day, the genetically altered mice were active at the same times as control mice. Then the researchers simulated what happens during those short winter days that can provoke seasonal affective disorder, providing the rodents with only four hours of light each day. The modified mice started and stopped running in their wheels four hours later than did unaltered mice, suggesting that the faulty version of PER3 shifts the animals’ circadian rhythms.

The team next tried to evaluate the mood of the mice. Determining whether a person is depressed requires an in-depth examination by a psychologist or psychiatrist, and researchers can’t make the same diagnosis for a rodent, Ptáček says. Mice can show some of the same behaviors as people who have depression, however. One way to gauge a rodent’s mood is by dangling it by its tail. A “depressed” animal will stop struggling sooner than a normal mouse. The team found that the genetically modified mice gave up more quickly in this test than did their unaltered brethren. Also like depressed people, the mice that carried faulty PER3 showed abnormal sleep patterns. “Humans in the short day-lengths of winter develop a mood disorder, and the mice recapitulated that,” Ptáček says. “It’s quite a dramatic finding.”

But the mice the researchers used in these experiments differ from people with FASP in an important way. Along with two faulty copies of PER3, the mice also sport two normal copies of the gene. To confirm their findings in rodents that more closely mimic human subjects who have FASP, the researchers analyzed a different group of mice that lack PER3. When these animals were exposed to four hours of light per day, they also exhibited depression-like symptoms. For example, depressed people often stop enjoying activities they once relished. Rodents missing PER3 showed a similar apathy, drinking less sweetened water than did their normal counterparts. “It seems that the mice are not taking pleasure in something that is pleasurable,” says Ptáček.

“Everybody believes that there are connections between sleep and depression, but nobody has been able to find a biological link,” he says. “We think PER3 is a connection between pathways related to mood and the biological clock.” Exactly how the gene bridges these pathways remains uncertain, but it may help control how mice and humans respond to different amounts of light as the seasons change, Ptáček says. He notes that although the findings of the study don’t suggest a specific therapy for mood disorders, they may steer researchers in the right direction. “As we learn more, our understanding of the biology will allow us to be more rational in searching for drugs to treat, say, seasonal affective disorder.”