One of the most fascinating things about the history of life is the way distantly related species can look alike. In some cases, the similarities are superficial, and in other cases they are signs of a common ancestry. And sometimes–as in the case of our brain and the brains of worms–it’s a little of both.

The biggest feature of our brains is a massive stack of densely woven neurons called the cerebral cortex. Once our brains take in sensory information, it’s the cortex that integrates it, makes sense of it, learns from it, and decides how to respond. If you compare our cortex to those of our close relatives, the apes, they’re nearly identical in structure, although our cortex is very big for our body size. If you look further afield, you’ll find the same basic architecture of the cortex in all vertebrates, although different parts are different size in different species. Because these similarities are so consistent in so many different ways, and because you can trace the changes to the cortex along different lines of descent, they’re strong evidence that the common ancestor of all vertebrates had a cortex.

Vertebrates are not the only animals with a nervous system, however. Insects, crustaceans, worms, and other invertebrates have nervous systems that are also organized around a central cord. These invertebrates typically have a large cluster of neurons at the front of the cord that functions like our brain does: it’s where sensory information goes in, and various commands go out. And in some invertebrates, such as insects and spiders, these brains have tightly packed clumps of neurons that are essential for letting these animals learn associations between odors and food and other important lessons. These clumps are known as mushroom bodies.

The similarities between mushroom bodies and our cortex are not overwhelming, but they are tantalizing. The cortex and mushroom bodies play similar roles, and their arrangements are somewhat similar. Mushroom bodies are even parceled up into distinct regions, just as we have regions for handling sight, smell, and other tasks.

On the other hand, mushroom bodies are missing a lot of the landmarks of the vertebrate cortex. The brain regions they connect to don’t have counterparts in our brains. And while all vertebrates have a cortex, a lot of invertebrates have no known mushroom bodies.

Traditionally, scientists have concluded that mushroom bodies and the cortex are an example of convergence. Birds and bats both have wings, for example, but their common ancestor did not. Instead, both lineages evolved different wings much later. After many of the major branches of animals split apart between 600 and 550 million years ago, the vertebrate lineage evolved a brain with a cortex, and some invertebrates evolved mushroom bodies.

Over the past thirty years, scientists have added a new line of evidence to the search for the origin of brains and other traits. They can now identify the genes that build the traits. As a mouse embryo develops, certain genes switch on in the brain to start building the cortex. The same genes build up our own brains as well, which is not surprising given all the other evidence that the common ancestor of mice and humans had a cortex.

But scientists have had some wonderful surprises when they’ve compared genes of more distantly related species. Jellyfish, grasshoppers, and humans all have eyes, for example, but they’re radically different from each other–at least anatomically. Yet they also share some of the same genes for building light receptors and other parts. So they’re actually a mix of convergence and a shared ancestry. I wrote about the evolution of eyes in The Tangled Bank, in a section excerpted by the New York Academy of Science here.

The cortex now turns out to follow the same story as the eye. Detlev Arendt of the European Molecular Biology Laboratory and his colleagues decided to compare the genes that build the cortex in mammals to the genes that build mushroom bodies in invertebrates. They studied a pretty little creature called the ragworm. They chose it because it has huge, easy-to-study mushroom bodies, and because it has evolved more slowly since the vertebrate-invertebrate split than flies and other well-studied species. The scientists carried out an exquisitely detailed survey, mapping where a number of genes were becoming active in the developing ragworm brain, down to the individual cell.

The figure here shows a remarkable similarity. On the left is a developing mouse cortex. Below it is a chart showing where a group of genes are expressed. The colored strip on the brain matches the vertical axis of the chart. And to the right is a diagram of the developing ragworm brain. If you duplicate the strip in the mouse cortex and join two ends together into a fork, you get a region in which many of the same genes are being expressed in a nearly identical pattern. And that forked regions–da dum!–eventually becomes the mushroom bodies.

So our cortex turns out to be a lot older than previously thought. The common ancestor of us and ragworms–a wormy creature that lived 600 million years ago–not only had a brain, but had an ur-cortex. And it probably used that ur-cortex to learn about its world–most likely learning about the odors it sniffed. That animal’s descendants diverged into different forms, and the ur-cortex changed along the way. Yet they still used many of the same genes their ancestor did long ago. So next time you splat a fly against a wall, remember: there was a cortex in there.

Originally published September 3, 2010. Copyright 2010 Carl Zimmer.