In order to survive in complex and interesting environments in the wild, bacteria have a whole arsenal of chemical products that they make within the cell. These chemicals are used for signalling, defence and communication between bacterial cells. One particular group of these chemicals is called the polyketide group, which I have a particular fondness for as I studied polyketides for my degree project. Several antibiotics are polyketides, so they are useful things for bacteria to have.
Polyketides don't just exist in bacteria, they are also present in plants, fungi, protists and even some animals. They are most commonly found in organisms that are sharing mutualistic relationships, such as colonies of sponges, and the symbiotic bacteria of insects. This may be due to their usefulness as a signalling molecule. In particular lichenised fungi, i.e fungi sharing a relationship with algae or green-bacteria (cyanobacteria) contained a large number of polyketides. When examined closer however, it was found that only 10% of these were related to plant polyketides, the rest were more unique.
As polyketides are modular genes, it is relatively easy to evolve new ones. Accidental duplication of sections of the genomes can add in a bunch of new modules, which can then diversify to new and exciting purposes. If one gene adds a -COOH group, and another adds a -CH3, duplication of those genes means that your molecule suddenly has two -COOH groups and two -CH3 groups and a bunch of new properties as a molecule. While many of the new fungal polyketides will have evolved within the fungi, it is also strongly suggested that a group of them originally came from bacteria. The genes for making polyketides are very close to genes called "mobile elements", bits of DNA that are particularly good at jumping in and out of cells. Also the codons (the code by while DNA is turned into protiens) of the polyketides genes more closely resemble those of bacteria than of other fungi or plants.
For anyone interested in taxonomy there are some interesting clade diagrams in the paper (reference below). What they seem to show is that a group of polyketide genes from bacteria were picked up by the fungi, and the evolved within it to form new groups of polyketides unique to lichenised fungi. These genes are not in all types of lichenised fungi, suggesting that they have been lost from species where they are not needed. As polyketide genes tend to be quite large and bulky (at least for bacteria, it might not matter so much inside the larger eukaryote genomes!) it does make sense that they would be quietly dropped if found not to be useful.
It's not unlikely for fungi to be stealing bits of the bacterial genome either. Fungi and bacteria occupy many of the same niches in nature and can live in very close semi-mutualistic partnerships. There's even fossil evidence to suggest ancient lichen-like organisms formed by a symbiotic interaction between fungi and cyanobacteria. While it is tempting to think that the fungi took the polyketide genes from the cyanobacteria they were next to, the genes seem to be more similar to those of soil bacteria rather than cyanobacteria. Like any other organism though, lichen do not exist as isolated entities but surrounded by soil, dirt, parasites, other fungi and other bacteria. Which will include a healthy dollop of soil bacteria in close proximity to the fungi, certainly close enough to be swapping genes around.
As an overall picture therefore, it looks like the fungi picked up a group of very useful signalling and defence molecules from soil bacteria. Within the fungi, these genes then continued to evolve and develop, to form a fungal-specific and very useful little group of genes.
Credit link for image 1
Credit link for image 2
Schmitt I, & Lumbsch HT (2009). Ancient horizontal gene transfer from bacteria enhances biosynthetic capabilities of fungi. PloS one, 4 (2) PMID: 19212443