It may be hard to imagine a link between the Civil War and the science of heredity, but a provocative new study of the offspring of Union soldiers adds to a growing body of evidence that suggests that traumatic events experienced by one generation can have profound effects on the next.

It’s all part of the growing field of human epigenetics, which examines how our health is shaped by interactions between DNA and our environment.

The study, based on an analysis of National Archives records of Civil War prisoners of war and their families, turned up stories like those of Ellsey Sloan and John Lawson, who survived captivity in the notorious Andersonville prison in Georgia, where crowding, starvation and poor sanitation were rampant.

The Andersonville prison in Georgia was notoriously brutal, with captives facing problems of overcrowding, starvation and poor sanitation. Library of Congress

The findings show that sons of Union soldiers who were held in Confederate prisons had shorter lifespans than the sons of soldiers who avoided imprisonment. But if the research turned up heartbreaking stories, it also showed that some sons of the POWs had normal lifespans — perhaps because their mothers were well nourished during pregnancy. This suggests that it’s possible to mitigate the effects of privation in subsequent generations — a message as relevant today as it was in the 19th century.

“What happens to your ancestors can determine what happens to you, but the effects are reversible,” says Dora Costa, an economist at the University of California, Los Angeles, and lead author of a paper about the research that was published Oct. 15 in the journal Proceedings of the National Academy of Sciences. “It’s not destiny.”

Peering back in history

For their research, Costa and her collaborators combed through the records of nearly 20,000 children of Union soldiers from the Civil War, which was fought from 1861 to 1865. The researchers looked at the lives of men in three groups: sons of POWs whose imprisonment had been especially brutal; sons of POWs whose imprisonment had been less extreme; and sons of Union soldiers who had avoided imprisonment.

Ellsey Sloane survived captivity in the Andersonville prison in Georgia. WikiTree

A striking pattern emerged. Of sons who lived at least to the age of 45, those in the unlucky first group had a 9 percent higher probability of dying in any given year than those in the second group, and an 11 percent higher probability of dying than sons fathered by men who hadn’t been captured. The early deaths were caused mostly by stroke and cancer, according to the researchers.

Previous studies turned up similar cases in which people whose parents survived a harrowing ordeal had an unusually high risk of health problems. For example, it’s well documented that the offspring of survivors of the Dutch Hunger Winter of 1944-45 — In which German forces cut off food supplies to the Netherlands near the end of World War II — experienced high rates of diabetes, schizophrenia and other chronic ailments.

In recent years scientists have started to piece together how this might happen. It’s not that ordeals like starvation changed these people’s genomes (the sum total of a person’s DNA). Rather, it’s that the traumatic events triggered chemical changes in certain compounds attached to DNA, which collectively are known as the epigenome. Scientists think some of these epigenetic changes, which affect which genes are activated and which are silenced, could be passed on to the next generation from the mother or father.

Randy Jirtle, an epigeneticist at North Carolina State University in Raleigh, offers a helpful analogy: An individual’s genome is like computer hardware, while the epigenome is like software that tells the hardware what to do. If the software has been corrupted, the hardware doesn’t produce the expected result.

It’s possible the Civil War POWs’ hardships triggered epigenetic changes to the Y chromosomes in the men’s sperm, as only the men’s sons and not their daughters had shortened lifespans. So far, the evidence for this epigenetic link is indirect. Costa and her team won’t know for certain that this is the correct explanation until they examine the genes of the living descendants of the sons, in whom traces of the trauma might still linger.

Changing an epigenetic legacy

It’s not exactly clear why many sons of POWs lived normal lifespans while others died young, but indirect evidence suggests that for some it might be a matter of timing. The sons who were born toward the end of the year fared better than those born in springtime. Costa thinks that may be because their mothers had plenty to eat during the critical months of pregnancy, which for those sons would have been during the summertime — when food was bountiful.

Studies in animals have shown that a mother’s diet can protect her offspring from harmful epigenetic marks. The new findings indicate that the same could hold true for people, Jirtle says.

“Can we do anything to make our life and the lives of our children better, or are we just stuck with these epigenetic programs that are altered for generation upon generation?” he says. “This is a tantalizing possibility.”

Of course, encouraging people to get enough to eat during pregnancy “is not a particularly striking new type of recommendation,” says Jean-Pierre Issa, a medical oncologist at the Lewis Katz School of Medicine at Temple University in Philadelphia.

Issa looks forward to a time when epigenetics can bring more specific guidance on good nutrition and other health-promoting tools. Eventually, he said, doctors may be able to help their patients protect their epigenomes by getting plenty of food during certain stages of life while restricting what they eat during others. It might even be possible to offer a blood test that would reveal epigenetic problems, which could then be corrected with medication, exercise or better nutrition.

“You can think about this as a 23andMe for the epigenome,” he says. “The bottom line is that there is promise, but there’s a lot more work to be done.”

WANT MORE STORIES ABOUT GENETICS?

FOLLOW NBC NEWS MACH ON TWITTER, FACEBOOK, AND INSTAGRAM.