In 1891, a French physician named Albert Calmette opened a research outpost in what was then Saigon (now Ho Chi Minh City, Vietnam) to develop new vaccines for rabies and smallpox. Then the Indian cobras showed up.

The invaders sank their fangs into several of Calmette’s new neighbors, injecting molecules that rotted muscles, ruptured blood vessels, and paralyzed the nerves that told their hearts to beat and lungs to breathe. Their grisly deaths prompted him to drop infectious disease and focus on snake venom. When he returned to France, he injected Indian cobra venom into rabbits in small doses and discovered that the animals produced a serum with a protective effect: the first antivenom. Calmette began producing his anti-cobra cocktail of antibodies in donkeys and horses and in 1895, for the first time, successfully treated a human snakebite victim.

Calmette’s method still dominates antivenom production today—a practically medieval process of snake milking and horse blood harvesting that is laborious, expensive, and error-prone. What scientists have needed in order to modernize this operation is the source code for a snake’s noxious protein soup, the actual genes and nearby DNA that turn them on or off.

After two years of work, an international team of scientists has now published, in Nature Genetics, an atlas of all 38 of the Indian cobra’s chromosomes, the most complete snake genome ever assembled. It contains information no one has ever been able to piece together before: the genetic recipe for the snake’s deadly venom cocktail. They’re hoping it will serve as a roadmap to bring antivenom production into the 21st century.

“It seems like something we should have figured out 20 years ago, but until now those areas of the snake genome have been total black boxes,” says Todd Castoe, an evolutionary geneticist at the University of Texas at Arlington who was not involved in the work. Initially, scientists believe, the genes that generate venoms carried out totally different functions, usually some innocuous cellular housekeeping task. But along the way they duplicated, a common DNA-copying error. And then the extra copies acquired mutations. That happened over and over, and the proteins they produced became deadly in different ways. The result of all this evolution is that the stretches of DNA that code for venom toxins are full of repetitive sequences, making them exceedingly difficult to properly assemble. Imagine trying to solve a jigsaw puzzle where the same fluffy clouds are scattered six, eight, a dozen times in the same corner of the sky. How do you know which piece goes where?

To finally fit together these elusive sections of the genome, Somasekar Seshagiri, a geneticist and president of the SciGenom Research Foundation in Bangalore, and his collaborators used a combination of older sequencing methods with new ones that read out very long stretches of DNA. They also employed a technique that detects the 3D shape of DNA to further refine their guesses about how exactly to stitch together the structurally finicky venom regions. With the full genome in hand, the researchers then analyzed which sections of it are turned on in the venom gland but not in other tissues. That allowed them to identify the code that spells death or disablement for anyone who encounters the cobra’s bite.

“Antivenoms will no longer just be like some magic potion we pull out of a horse.” Somasekar Seshagiri

Indian cobra venom isn’t just one poison; it consists of more than a dozen toxins and other substances that together launch a coordinated attack on the snake’s prey (or a hapless human victim). In the Nature Genetics paper, Seshagiri’s team identified 19 genes key to producing this lethal brew. For the first time, it establishes the links between a snake’s toxins and the genes that encode them.

The achievement not only shows scientists how to use the same methods to sequence other venomous snake species, it also unlocks the door to modernizing antivenom production. “The value of genomics is that it will allow us to produce medicines that are more concretely defined,” says Seshagiri. “Antivenoms will no longer just be like some magic potion we pull out of a horse.”