The wealth of sequenced fungal genomes has enabled comparative phylogenomics and these comparisons have found that fungi can adapt to new environments by changing the size of gene families. The ancestral state of fungal nutrition to eat plants, so we compared the genomes of several “green” fungi, those that eat plants, to the genomes of several “red” fungi, those that eat animals. The most dramatic discovery about the red fungi was that families of genes that deconstruct plant cell walls decrease to none, while those that eat keratin increase several fold. Our favored interpretation is that fungal genomes are dynamic and selection acts to retain gene duplications or gene deletions that increase fitness in fungi adapting to a new food.
You can learn more about this work from this publication [Sharpton et al. 2009]