You have about 20,000 genes in your DNA.
They encode the molecules that make up your body,
from the keratin in your toenails, to the collagen at the tip of your nose,
to the dopamine surging around inside your brain.
Other species have genes of their own.
A spider has genes for spider silk.
An oak tree has genes for chlorophyll, which turns sunlight into wood.
So where did all those genes come from?
It depends on the gene.
Scientists suspect that life started on Earth about 4 billion years ago.
The early life forms were primitive microbes
with a basic set of genes for the basic tasks required to stay alive.
They passed down those basic genes to their offspring
through billions of generations.
Some of them still do the same jobs in our cells today, like copying DNA.
But none of those microbes had genes for spider silk or dopamine.
There are a lot more genes on Earth today than there were back then.
It turns out that a lot of those extra genes were born from mistakes.
Each time a cell divides, it makes new copies of its DNA.
Sometimes it accidentally copies the same stretch of DNA twice.
In the process, it may make an extra copy of one of its genes.
At first, the extra gene works the same as the original one.
But over the generations, it may pick up new mutations.
Those mutations may change how the new gene works,
and that new gene may duplicate again.
A surprising number of our mutated genes emerged more recently;
many in just the past few million years.
The youngest evolved after our own species broke off from our cousins, the apes.
While it may take over a million years for a single gene to give rise
to a whole family of genes,
scientists are finding that once the new genes evolve,
they can quickly take on essential functions.
For example, we have hundreds of genes for the proteins in our noses
that grab odor molecules.
The mutations let them grab different molecules,
giving us the power to perceive trillions of different smells.
Sometimes mutations have a bigger effect on new copies of genes.
They may cause a gene to make its protein in a different organ,
or at a different time of life,
or the protein may start doing a different job altogether.
In snakes, for example, there's a gene that makes a protein for killing bacteria.
Long ago, the gene duplicated and the new copy mutated.
That mutation changed the signal in the gene
about where it should make its protein.
Instead of becoming active in the snake's pacreas,
it started making this bacteria-killing protein in the snake's mouth.
So when the snake bit its prey, this enzyme got into the animal's wound.
And when this protein proved to have a harmful effect,
and helped the snake catch more prey,
it became favored.
So now what was a gene in the pancreas makes a venom in the mouth
that kills the snake's prey.
And there are even more incredible ways to make a new gene.
The DNA of animals and plants and other species
contain huge stretches without any protein coding genes.
As far as scientists can tell, its mostly random sequences
of genetic gibberish that serve no function.
These stretches of DNA sometimes mutate, just like genes do.
Sometimes those mutations turn the DNA into a place
where a cell can start reading it.
Suddenly the cell is making a new protein.
At first, the protein may be useless, or even harmful,
but more mutations can change the shape of the protein.
The protein may start doing something useful,
something that makes an organism healthier, stronger,
better able to reproduce.
Scientists have found these new genes at work in many parts of animal bodies.
So our 20,000 genes have many origins,
from the origin of life, to new genes still coming into existence from scratch.
As long as life is here on Earth, it will be making new genes.