We all get lonely from time to time, but for some, the ache of isolation is partly genetic. That's the finding of a new study that looked at the risk of loneliness as a lifelong trait as opposed to a temporary feeling.

While it’s normal for anyone to feel down when they’re by themselves in certain circumstances (say, after your roommate has moved out, or you've just landed in a new city), the researchers wanted to know if certain people were predisposed to feel this way more often. So they looked at genetic and health information from more than 10,000 Americans ages 50 and older, including their answers to three questions designed to measure loneliness:

How often do you feel that you lack companionship?

How often do you feel left out?

How often do you feel isolated from others?

(The questions did not directly ask about loneliness, the researchers say, because many people are reluctant to admit feeling that way.)

After they looked at a variety of genetic variations—and controlled for gender, age, and marital status—the researchers, from the University of California San Diego School of Medicine, found that the tendency to feel lonely over a lifetime is “modestly heritable.” They estimate that it's 14% to 27% genetic, but that the rest is based on a person’s upbringing, surroundings, and other modifiable factors.

In other words, some people are genetically programmed to feel lonely in the same situations in which others would feel content. “For two people with the same number of close friends and family, one might see their social structure as adequate while the other doesn’t,” said lead investigator Abraham Palmer, PhD, professor of psychiatry and vice chair for basic research at UC San Diego, in a press release.

Other scientific estimates for loneliness have found that the trait is 37% to 55% heritable, but this new study was much larger than previous ones. It did look at fewer genetic variations, however—earlier analyses included rare variants that were not studied here—which could also explain the difference in findings, the authors wrote.

The new study, published last week in the journal Neuropsychopharmacology, also concluded that loneliness tends to be inherited along with neuroticism, defined as a long-term negative emotional state. It also found weak links between loneliness and schizophrenia, bipolar disorder, and clinical depression.

Palmer says that loneliness is part of the body’s biological warning system that has evolved to alert us of threats, in the same way that physical pain alerts does. But it’s clear that not everyone perceives these threats in the same way.

Unlike in previous, smaller studies, Palmer’s team did not find any specific gene variants to be responsible for loneliness. (Scientists have speculated that genes involved in regulating brain chemicals, such as dopamine and oxytocin, may play a role.) The group is working to find these so-called genetic predictors, in hopes of gaining more insight into how, exactly, loneliness is passed down on the molecular level.

Although the study does not provide advice for people who are perpetually lonely, it may be reassuring to know that the feeling isn’t entirely predetermined by genetics. It also reinforces the idea that loneliness isn’t always at it appears.

“It’s important to note that someone can be alone, or have only a handful of close friends, and not be lonely,” Bruce Rabin, MD, director of the University of Pittsburgh Medical Center Healthy Lifestyle Program, previously told Health. “Or you can be a social butterfly and out with friends every night of the week and still feel isolated.”