“He began to discern patterns in the data — unanticipated constancies, conserved ratios, numerical rhythms,” Mukherjee writes. “He had tapped, at last, into heredity’s inner logic.” After almost eight plodding years he wrote a paper, which he read in 1865 to a room of farmers and botanists in Brno and published in the yearly “Proceedings of the Brno Natural Science Society.” And then — nothing. The history of science is a tangled web, not a logical arc, and for four decades Mendel’s pioneering work — “the study that founded modern biology,” as Mukherjee describes with only a touch of hyperbole — effectively disappeared.

The founding of modern biology had to wait till the turn of the century. Mendel’s forgotten paper was discovered by biologists in Amsterdam, Cambridge and elsewhere. Mendel had discovered the basic unit of heredity, had proved there must be such a unit, and finally a Danish botanist, Wilhelm Johannsen, gave it a name: “gene,” he suggested — “a very applicable little word.”

What is the gene? First it was an abstraction, an enigma, “a ghost lurking in the biological machine,” Mukherjee writes. By definition the gene was the carrier of any trait that is heritable or partly heritable. One would say there are genes for eye color, height or even intelligence. But some traits are better defined than others. People have long bred dogs, for example, to be “short-haired, longhaired, pied, piebald, bowlegged, hairless, crop-tailed, vicious, mild-mannered, diffident, guarded, belligerent.”

In the 20th century, new technologies and new disciplines brought this abstract and hypothetical idea into sharper and sharper focus. The epiphany came in the discovery by James Watson, Francis Crick and Rosalind Franklin of a vivid physical form, the famous double helix, the winding base pairs of DNA. Genes are strung along chromosomes like beads on strings (the common metaphor). Scientists isolated them and counted them: 21,000 to 23,000 to make a human being.

The gene is a message. It is an instruction for building a protein. It can be a blueprint encoding the design for a structure, or more accurately, as Richard Dawkins has suggested, a recipe encoding a process. The genome is an algorithm, and at the same time, it is a code, which had to be laboriously and ingeniously deciphered. It is the beginning and ending of an endless circle of life: A gene is a message, which builds a protein, which creates form and function, which regulates the gene.

Mukherjee arranges his history not just chronologically but thematically. This is necessary. Science seldom progresses in a neat logical order anyway, but genetics, especially, encompasses and influences many subjects at once: biology, information science, even psychiatry. Genetics has also played its part in the darkest currents of 20th-century history. One need only remember that Nazi genetics is a subject of its own, aimed at the improvement of Übermenschen by the elimination of the feebleminded and “degenerate.” But the social impulse for eugenics started earlier, in England and in the United States. More recently, we have lived through debates tinged with poorly understood notions of race. In the 1980s, James Q. Wilson and Richard Herrn­stein linked criminal violence to “bad genes” in “Crime and Human Nature.” Herrnstein returned in the 1990s with the incendiary “The Bell Curve,” written with Charles Murray, which claimed that whites and Asians had a genetic advantage over people of African descent in “intellectual capacity.”