What if a gene from an insect insinuated itself straight into your DNA? What if more than a hundred genes from bacteria did? Would that make you some kind of horrible Franken-human?

No. It would make you exactly what you are today.

It turns out that genes are quite capable of hopping from one organism into a completely different species. Not only do these genes jump, but when they land in a new host they can actively change it. This can give the host species new abilities, sending it down a new evolutionary path. Even humans play host to alien genes, and it seems they have shaped our evolution.

Genes have to keep copying themselves into new hosts, or they will be destroyed when their current host dies.

Darwin drew a sketch of a branching tree, where each new twig was a new species

The usual route is to pass straight down the generations. When you have children, you pass on some of your genes to them, and so those genes find a new host.

Sometimes the genes get altered along the way. These changes, known as mutations, help ensure that the offspring are different to their parents. Over many generations, enough mutations can build up to create a whole new species – and in the long run, all the diversity of the natural world.

In On the Origin of Species, Charles Darwin laid out how this process of evolution works. He drew a sketch of a branching tree, where each new twig was a new species born of accumulated mutations. This is what biologists call the "tree of life".

But there's another way for genes to find a new host.

Sometimes a gene can jump directly from one organism to another organism, which might belong to a completely different species. This process is called horizontal gene transfer.

The tree of life looks a bit like a strangling fig

That means Darwin's image of the tree of life isn't quite right. If genes can hop about between organisms that are on different branches of the tree, we have to draw lines linking those separate branches.

As a result, the tree becomes a convoluted network of branches and twigs, all knotted together. "The degree of horizontal gene transfer we're finding means the tree of life looks a bit like a strangling fig," says Alastair Crisp of the University of Cambridge in the UK.

That said, these gene transfers are rare. That's because any gene trying to move into a new organism faces a lot of barriers.

Imagine a rogue gene, a loose strand of DNA, is trying to get into a pigeon.

First it has to get inside one of the pigeon's cells intact. Then the cellular machinery might incorporate it into the cell's DNA.

That's a lot of ifs

But the gene actually faces a bigger challenge than that. If it is to be transferred to the pigeon's offspring, and stand a chance of long-term survival, it has to get into an egg or sperm cell, or an early embryo. These are buried deep inside the pigeon's body.

Even if the gene does get into an embryo, the embryo still has to survive to adulthood and reproduce, passing the gene on. Only then does the gene have a chance of spreading to the wider population.

That's a lot of ifs, so it's far from easy for a jumping gene to become established in another animal's DNA. But if species live close together for long enough, genes can start moving.

Some genes seriously get around. Scientists have tracked some genes from a virus that first jumped into parasitoid wasps called braconids, and then into the wasps' prey: caterpillars.

The virus DNA jumped into the tiny parasitoid wasps around 100 million years ago. It wasn't just one or two stray genes: almost the entire virus genome was incorporated into the wasp's DNA.

Very occasionally, a caterpillar survives a wasp encounter

Braconid wasps lay their eggs inside the young of other insects, such as caterpillars. The young hatch inside the caterpillars and eat them from within. Once they are mature enough, they eat their way out of the dead caterpillar.

The wasps have evolved to make use of the viral genes. Each female makes virus-like particles, which she injects into a caterpillar along with her eggs.

These particles incapacitate the caterpillar's immune system, rather like HIV in humans. That allows the wasp's offspring to munch their way through the caterpillar unimpeded.

But very occasionally, a caterpillar survives a wasp encounter.

"One interesting feature is when wasp development inside the larva fails for some reason," says Michael Strand of the University of Georgia in Athens. "Many of these wasps attack insects that are not ideal hosts for them."

These lucky caterpillars can sometimes develop normally and metamorphose into adult butterflies. But they don't always manage to get rid of the wasp's viral genes.

Some gene jumps can have huge ramifications

"Occasionally a viral gene gets transferred into a moth or a butterfly, and it's there," says Strand. "It's like it escapes from the wasp and the virus, literally changing host populations."

This illustrates a key point: transferred genes are sometimes just along for the ride. Wasp hosts have a use for their viral genes, but caterpillar hosts might not get any benefit.

"There are lots of transfer events, most of which don't have adaptive significance that anybody knows of," says Strand.

That said, some gene jumps can have huge ramifications. One species-hopping gene encodes lethal weapons.

In a 2014 study, a team led by Seth Bordenstein of Vanderbilt University in Nashville, Tennessee, found a gene in a virus that shouldn't have been there.

New viruses then burst out of the cell and can go to infect more victims

Viruses are tiny packets of genetic information encased in a microscopic shell. They are so simple, they can't even replicate themselves. Instead, they must infect an organism that has the tools they need.

A virus will barge its way into a living cell and make thousands or millions of copies of itself. These new viruses then burst out of the cell and can go to infect more victims.

Bordenstein's group were studying the way a particular virus breaks down the cell walls of bacteria in order to infect them. They found that the gene the virus used to do this had spread to other life forms, including fungi, plants and insects.

The gene had even settled in single-celled organisms called archaea that live by boiling hot, pitch-dark and acidic deep-sea vents.

It's a gene with a universal function

"Our theory is that this kind of transfer is probably a lot more common than we thought," says Bordenstein. "This could be the tip of the iceberg for understanding transfers across the tree of life."

The group conducted a series of experiments to check that the organisms hadn't simply evolved the gene independently.

It's clear why this gene has been so popular. "An antibacterial gene looks quite obviously like something that could cross the domains of life and spread quite easily," says Bordenstein. "It's a gene with a universal function in all organisms: to compete with bacteria."

Rather ironically, this gene that is used to destroy bacteria originally came from bacteria.

The gene encodes a complex molecule called a lysozyme, which chemically weakens cell walls. Bacteria use lysozymes, in moderation, when they divide into two new cells.

Another gene may have profoundly influenced its new host's evolution

But when other organisms got hold of the gene, they found it was even more useful. They used it to make enough lysozyme to make bacteria burst.

Even humans have a gene for lysozyme, which we secrete in tears, mucus and milk. However, it's not clear whether this gene also came from bacteria or whether it's something we evolved for ourselves. "The science isn't there yet," says Bordenstein.

Regardless, the lysozyme gene has evidently changed a lot of organisms. But it only made one change, giving them one extra ability. Another gene may have gone further, and profoundly influenced its new host's evolution.

In May 2015, it emerged that a single bacterial gene had jumped into the sweet potato genome around 10,000 years ago. This might be somehow linked to our ancestors' domestication of sweet potatoes.

It causes abnormal growths called galls

Professor Jan Kreuze at the International Potato Center in Lima, Peru and his colleagues were studying how sweet potatoes fend off viral infections.

"While I was looking through my data, I found these genes that actually came from bacteria," says Kreuze. "When I looked a bit closer, I saw they were genes only usually found in Agrobacterium."

Agrobacterium is a common bacterium that causes diseases in plants. It causes abnormal growths called galls, which are visible as lumpy swellings on tree trunks.

To do this it transfers its own DNA into its plant host.

"At some point Agrobacterium must have infected an ancestral sweet potato," says Kreuze. "Those cells that were infected and were transgenic might have formed a gall. But they also generated a new plant, which was then able to transfer these Agrobacterium genes to the next generation."

Maybe the genes somehow helped to make sweet potatoes tasty

His group tested nearly 300 types of modern sweet potato, and they all had genes from Agrobacterium.

Those genes aren't found in any of the sweet potato's wild relatives. So Kreuze thinks they are linked to the plant's domestication. "Why else would you find them present in all domesticated varieties but not in the wild ones?"

Maybe the genes somehow helped to make sweet potatoes tasty. But for now we don't know for sure that Kreuze is right. "It's not proof," he says. "Correlation is not causation."

Even if the Agrobacterium genes really did contribute to the domestication of sweet potatoes, transferred genes can never be as important as those passed from parent to offspring.

At least for complex organisms like animals and plants, parents are still the most important source of genetic information. Among multicellular organisms in particular, horizontal gene transfer is the exception rather than the rule.

In other words, these genes are very few compared to the ones we've evolved for ourselves. But even in humans, horizontally transferred genes can be found, and in surprisingly large numbers.

These genes from other organisms are making proteins which are useful to us

In 2015, Crisp and his colleagues found that there are about 145 alien genes nestling in the human genome. They seem to have arrived relatively recently from plants, animals, fungi and bacteria.

Horizontal gene transfer is "being detected more and more", says Kreuze. "It's been an important part of the evolution of different species across the whole planet, including ourselves."

The genes Crisp found aren't just along for the ride: they are active. "These genes from other organisms are making proteins which are useful to us," says Crisp. "That's why these genes can persist."

Some of the genes are involved in determining our blood type, while others are important in metabolism. But there are others performing even more intimate jobs.

In the first few days of your life, you may have been churning out copies of one of the newest viruses to integrate into our genome.

The HERV-K virus infected humans about 200,000 years ago, around the time of the origin of our species. However, it had been infecting primates long before, and made its way into our ancestors many times.

HERV-K could be protecting the embryo from infections from viruses

Not everyone has it. But in those who do, it seems to play a role in the early development of embryos.

Edward Grow of Stanford University in California and his colleagues studied unused IVF embryos. They found that HERV-K genes were turned on for a short time after the egg was fertilised, but before the embryo implants into the wall of the mother's womb.

It's not clear what the viral genes are doing, but one idea is that they protect the embryo from other viruses. 

"We're being infected by them all the time," says Grow. "HERV-K could be protecting the embryo from infections from viruses expressed in other cells or new viral infections."

Viral genes also seem to be crucial in the next stage of pregnancy.

One of the big problems with giving birth to live young, as we do, is controlling what goes into the foetus while it's developing. The mother needs to send the foetus nutrients and oxygen, but not harmful chemicals.

Genes from viruses have shaped our evolution

In humans and in other mammals, the mother uses an organ called the placenta to share useful chemicals with the foetus. The placenta has a special layer called the syncytiotrophoblast, made up of cells fused together, that acts as a protective barrier for the foetus.

In 1999, it emerged that the syncytiotrophoblast expresses viral genes that our ancestors picked up over 45 million years ago. One of these genes codes for a protein called syncytin, which helps the cells fuse together.

Clearly, genes from viruses have shaped our evolution.

"There is a massive cloud of virus genetic information, which is raining down and modifying us," says Luis Villarreal of the University of California, Irvine in the US. "It's not just transmitting information from one host to another, but it's actually originating novelty."

Our relationships with the other life-forms on Earth are much closer than we thought

Everything from viruses to insects has given us genes, and those genes have changed the ways our bodies work and helped us evolve. Even our most distant cousins have been involved in the evolution of our species.

Horizontal gene transfer tells us that our relationships with the other life-forms on Earth are much closer than we thought. However different from us an organism may be, it seems their genes can often be remarkably useful to us.

We are only starting to discover just how many alien genes we have and what they are doing for us.