The Black Death that ravaged Eurasia and North Africa in the 14th century had a profound effect on our balance of genes, one that according to a new study is still deciding our fate today.

Those effects are a mix of good and bad news. While the genetic variations that helped our ancestors survive the plague continue to offer some protection against similar respiratory diseases today, they also leave us prone to damaging autoimmune conditions.

Last year researchers published a comparison of genomes taken from individuals who lived before, during, and after the outbreaks of Yersinia pestis infections that swept across Europe. They'd found those who had two identical copies of a gene called ERAP2 were around 40 to 50 percent more likely to survive than those with two variants of the gene.

To better understand how the current state of ERAP2 variation in modern populations might still be influencing our ability to cope with infection, another team of researchers sifted through three large study databases: the UK Biobank, FinnGen, and GenOMICC. These databases each have information on hundreds of thousands of participants, enabling the study authors to see if combinations of ERAP2 are related to any other health issues.

The team found that same double-up of identical ERAP2 copies bestowed a lower risk of respiratory diseases such as COVID-19. More surprisingly, those with two of the same copy also faced a higher risk of the autoimmune diseases Crohn's disease and Type 1 diabetes.

"This gene essentially chops up proteins for the immune system," says infections specialist Fergus Hamilton from the University of Bristol in the UK.

"Although we don't know the exact mechanism influencing disease risk, carriers of alleles that provide more protection against respiratory disease seem to have an increased risk of autoimmune disease."

To assess the relationship between ERAP2 and health conditions we deal with today, the researchers used a technique called Mendelian randomization: the approach is designed to use the genetics we're born with to factor out environmental and lifestyle conditions, in order to then more strongly suggest cause and effect.

There was no relationship between the genetic variation and sepsis, the team found – a curious finding considering the role sepsis is thought to have had in plague deaths. There was some association with reduced parental lifespan as well, perhaps as a result of the autoimmune disease link. Each discovery will require further research to better understand their role in our immunity.

"It is potentially a great example of a phenomenon termed 'balancing selection' – where the same allele has different effects on different diseases," says Hamilton.

This balancing act is important to bear in mind when it comes to developing treatments too. Work is already underway to target ERAP2 to treat diseases like Crohn's and cancer, but this research suggests targeting ERAP2 could lead to knock-on effects on other diseases.

The study authors say that the effects of these genetic variations are likely to change as the environmental pressures on us also change – life today is dramatically different to how it was in 14th century, be it diet, exposure to illness, or medical care.

That extends to medical research of course: large genetic databases such as the ones used here were not available to scientists in the Late Middle Ages, and it can also be tricky to identify diseases and infections that weren't known about or defined in centuries past.

"This is a theoretical story of balance – relating to historical and contemporary disease profiles – which reflects our past and is rarely seen in real human examples," says genetic epidemiologist Nicholas Timpson, from the University of Bristol.

The research has been published in the American Journal of Human Genetics.