AbstractFungi are ubiquitous in the environment and some of the basal lineages found within the kingdom date back to the earliest known divergences in the eukaryotic tree of life. Such ubiquity is manifested in a myriad of different lifestyles and morphologies which are ultimately an expression of their genetic diversity. Advances in technology and molecular biology supporting high-throughput sequencing and bioinformatics have allowed us to develop a robust phylogenetic framework for fungal systematics improving upon previous, more simplistic, morphological classifications. Despite the obvious benefits reaped from such advances, the relationships among earlier diverging phyla remain largely unresolved, mostly due to a lack of extensive sequencing of species in these clades. Furthermore, inherent biases, as well as different types of methodological or computational errors may cause misleading assumptions in phylogenetic hypotheses for this highly diverse kingdom. In this chapter, we review molecular mechanisms that are responsible for the evolution and diversification of the fungi, with special remarks to the varied ecological niches occupied by its members. We then consider the impact of genetic and genomic-scale studies in fungal systematics, elucidating classic methods and strategies employed in these studies and their current limitations. Finally, we discuss how these phylogenetic methods can be integrated into phylogenomics to find and resolve accurate species placements and thus shed light on the biodiversity of these fascinating organisms.On the diversity of the kingdom FungiFungi are one of the most diverse groups of organisms, with species richness estimates of about 1.5 to 5 million of species worldwide. This unique kingdom has representatives that may be unicellular, in the form of yeasts, multicellular, with mycelia composed of masses of filamentous cells known as hyphae, or both at different stages of development. Fungi are amongst the most versatile organisms in terms of exploitation of different ecological niches and are recognized by their capability of recycling organic matter as free-living saprotrophs in a range of climates that can comprise terrestrial or aquatic environments. They can also be important pathogens, parasites, and symbionts of other fungi, algae, bacteria, protists, plants, and animals. Studies of fungal diversity and systematics date back to the 18th century, with new species being described in the Americas and Europe by botanists and early mycologists (Berkeley, 1874; Cooke, 1893; Hennings, 1896). This knowledge soon raised awareness to the perception that fungi could have significant contributions in biogeochemical cycles and even represent economic losses in agriculture, with decomposition of crops and other goods (Cobb, 1892; Horne, 1925; Kidd, 1932; Ryakhovsky, 1931). Nonetheless, despite its ubiquitous distribution around the globe, the described richness of fungi comprises representatives that have very specific biogeographical patterns and optimal environmental conditions (Meiser et al., 2014). Generally, warmer temperatures and higher humidity contribute towards higher diversity of fungal species, although the advances in sequencing and metagenomic techniques have allowed the study of extremophiles in poorly-studied hot, hypersaline, and even glacial environments (Berka et al., 2011; Gonçalves et al., 2012; Peidro-Guzmán et al., 2020; Tsuji et al., 2017; Zalar et al., 2007).1.1. Roles of the fungal diversity in ecosystemsFungi are heterotrophs and, among many of the niches they can occupy, their decomposition of organic matter, including lignocellulose, has been thoroughly studied. In the soil, specifically, fungi are considered to represent the largest portion of biomass and are known to have intrinsic participation in the recycling of carbon (Malik et al., 2016) along with bacteria and other microorganisms with whom fungi compete for resources. Several fungal genera are known for their capability of producing powerful antibiotic substances that can impact both micro and macro ecological communities they are found in. On the other hand, the synergistic association of these microorganisms may be essential for maintaining soil ecosystems The study of fungal-bacterial interactions in soil ecology is still a vastly open field for investigation, and the lack of knowledge in these associations has been attributed to the difficulty in implementing more holistic methodologies, given the spatial-temporal and taxonomic specificity of the interactions (de Menezes et al., 2017).In the rhizosphere, some fungi in the Ascomycota, Basidiomycota, and Glomeromycota phyla form mycorrhizae with a wide range of host plants (Merckx et al., 2009). These associations are promoted by specialized hyphal projections, known as hyphopodium, which penetrate the outermost layer of the host’s cells, providing a source of photosynthetically fixed carbon to the fungus in exchange of enhanced uptake of non-soluble inorganic ions, such as phosphate for the plant (Begum et al., 2019). Because of the usually complex networks and cycling of nutrients promoted by the association of fungal mycelia and the plant hosts’ roots, mycorrhiza can shape the landscape of the whole ecosystem they are found in (Smith and Read, 2008). Arbuscular mycorrhizal fungi are also observed to increase the resistance of the host to root colonization by pathogens with different mechanisms and in different levels, in a fungal species-specific fashion. For this reason, such a niche may be a hub for the diversity of obligate mycorrhizal fungi (Wehner et al., 2010). Genomic studies have elucidated that the establishment of such symbiotic association with the host involves secretion of effectors that trigger innate immunological responses in the plant, with involvement of signaling mechanisms that are paradoxically similar, if not identical, to those observed in early stages of colonization by phytopathogenic fungi (Corradi and Bonfante, 2012).The origins of pathogenicity in fungi are yet to be fully uncovered, given that only most of the studies are focused on human pathogens (Boddy, 2016). Still, the occurrence of a parasitic lifestyle in a broad range of hosts is widespread across the kingdom, implying that this is a trait that has been gained and, in some cases, lost multiple times during its natural history. Further comparative genomic studies have concluded that this evolutionary threshold represents convergent and divergent pathogenic traits in clades that have plant, human, and insect hosts, arising from saprotrophic and even mutualistic lifestyles (Redman et al., 2001; Shang et al., 2016). This implies that the reasons underlying these thresholds may be completely unrelated for each specific pathogenic clade, thus complicating the study of speciation and evolution in pathogenic fungi. Nonetheless, phylogenomic studies on species with different host specificities may elucidate some of these processes. For instance, the pathogenesis of some fungi is associated with speciation through expansion of protein families, such as toxins (Joneson et al., 2011) and the emergence of generalists from specialist taxa may be due to positive selection and development of asexual life-cycles through transitory species with increasingly broader host specificities (Hu et al., 2014; Thomma, 2003).The aforementioned examples attempt to show the plasticity and diversity of fungi yet, are far from depicting the real variety of ecological niches occupied by these organisms. Historically, it is clear that studying the diversity of fungi and their associations with other organisms can be greatly benefitted by genetic and genomic studies, where the estimation of phylogenetic trees to infer their evolutionary relationships becomes paramount. In vivo , environmental pressure in fungal populations is responsible for their diversity and the mechanisms that are intrinsically associated with the systematic positioning of taxa are better elucidated by molecular methods with the possibility of unveiling shifts on a genetic level.1.2. Mechanisms that contribute to the fungal genetic variabilityWhat makes living organisms unique is an intriguing question that has been posed in the natural sciences from its early developments. While the characteristics that differentiate organisms may be explained by biotic and abiotic interactions with the environment, the underlying genetic shifts selected in populations by such interactions are the main drivers of evolution in these organisms. Nowadays, it is known that these shifts may be responsible for altering major biochemical and physiological processes that will ultimately culminate in the observed richness of different biological traits, allowing for the exploration of new ecological niches, for instance. Diversity can, thus, be considered a classification of the genotypic and phenotypic variability of organisms, which can be applied to different taxonomic levels and ecological scales. Because fungi reproduce at considerably faster rates than macroorganisms, it is theoretically easier to tie together microevolutionary molecular processes with their population dynamics of variability and track speciation events. Population genetics of these organisms is, thus, mostly explained by and reliant upon their varied modes of reproduction, ranging from exclusively sexual cycles to anywhere in between infrequent asexuality and parasexuality in different clades. We will give a brief overview of these cycles in the best studied clades, linking their occurrence to genetic processes that generate variability, or the lack thereof, and, further on, their applications to phylogenetic and phylogenomic studies.The phylum Ascomycota is one of the best studied and, to date, most diverse groups of fungi. Most asexual filamentous ascomycetes are known to be haploid for most of their lifecycle, which begins with the germination of dispersal units, or spores, known as conidia. The spores grow to form mycelia, which can develop into specialized structures named conidiophores, to reproduce asexually through mitotic divisions. Because there is no crossover of genetic information between homologous chromosomes during mitosis, it has been parsimoniously assumed that genetic discrepancies in clonal populations of predominantly asexual fungi could only be attributed to inheritance independent processes, such as mutations or via lateral-gene transfer (LGT). Indeed, the latter can represent prominent causes of evolutionary transitions (Gabaldón, 2020), being associated, for example, with increased virulence in different fungal pathogens (McDonald et al., 2019; Slot and Rokas, 2011; van der Does and Rep, 2012; Vlaardingerbroek et al., 2016). However, it is now clear that several lineages of Ascomycetes with no known teleomorphs have either cryptic sexual or anomalous reproductive cycles, inferred from high recombination rates in populations. In fact, the occurrence of recombination can be the primary driver of genetic variability in fungi that don’t necessarily reproduce sexually (reviewed in Taylor et al., 2015).Although the possibility of genetic diversity that meiosis provides confers advantages in adapting to variable environments , sexual reproduction has been associated with the proliferation of repetitive sequences, particularly that of transposable elements (TEs) (Bakkeren et al., 2006; Hickey, 1982). Much has been discussed on the ability of TEs to directly impact the diversity and evolution of eukaryotic organisms based on its property to promote insertions and deletions on restriction sites that can virtually take place throughout the whole genome of the host, potentially promoting changes in reading frames or causing genes to be truncated. Although this may seem as an ominously remote possibility in fungi given the usually large size of the eukaryotic genome, Muszewska et al. (2019) found that older non-autonomous TE insertions or remnants are largely found in coding regions. Furthermore, animal pathogenic fungi have more TEs inserted in genes than other fungi, contributing to the hypothesis that these mobile selfish tandem repeats can have great contributions to the host’s gene expression and diversification (Muszewska et al., 2017). To protect their genomes against potential deleterious effects of transposition events, fungi use several mechanisms to recognize and silence high repetitive content regions during the sexual cycle, such as the interference RNA (RNAi), methylation induced premeiotically (MIP), meiotic silencing by unpaired DNA (MSUD) and repeat-induced point mutation (RIP) pathways (Irelan and Selker, 1996; Lax et al., 2020; Shiu et al., 2001; Wang et al., 2016). The RIP pathway, which only occurs in Ascomycetes may be of particular interest from an evolutionary perspective because of its direct mutation of G:C to T:A pairs following genome duplication, which arises the possibility of generating functional paralogs after meiotic duplication (Galagan and Selker, 2004).In some fungi, sexual reproduction may occur alternatively every other generation or after many generations of asexual cycles, depending on factors such as nutrient availability and other environmental cues (Wilson et al., 2019). In the case of heterothallic isolates, two individuals that present opposite mating type identities will need to sense and find each other, while primary homothallic isolates possess both identities and can start the mating event independently or with another isolate of either type. The reproduction then proceeds with fusion of cells, subsequent karyogamy forming diploids and further meiotic divisions, during which several rounds of recombinations can occur. Mating-type identities are a result of which mating type idiomorph (MAT) - or combination thereof, in the case of some Basidiomycetes - is harbored by the isolate (Maia et al., 2015; Wilson et al., 2019). A particular type of secondary homothallism, called pseudothallism, has been described, where nuclei carrying compatible mating types coexist in the same hyphae or yeast cell and allow mating-type switching, culminating in self mating. Additionally, and more recently, a novel type of homothallism, known as unisexual cycle, has been discovered. This reproductive cycle enables an isolate to sexually reproduce possessing a heterothallic genotype (Wilson et al., 2018). Consequently, for the meiotic cycle to be completed, the isolate must undergo diploidization by either endoreplication or karyogamy events. It has been shown that such a cycle represents adaptive advantages beyond the capability of recombination in the basidiomycete yeast Cryptococcus neoformans species complex, allowing for a phenotype of dimorphic transition to hyphal growth and enhancing sexual mating competition between isolates of the opposite mating type (Fu et al., 2019; Phadke et al., 2013). Furthermore, the ability to mate genetically identical cells, adding a limited amount of genetic diversity, mostly given by chromosomal-size mutations, SNPs and aneuploidy in these cases, results in a controlled phenotypically diverse progeny and, thereby, more fitness in response to environmental pressure (Ni et al., 2013).Alternatively, some fungi present parasexual cycles, in which haploid nuclei may fuse within growing mycelia of an isolate, forming diploid and subsequently haploid recombinants by mitotic crossing-over and chromosome loss, respectively. Schoustra et al. (2007) define the diploid state as an accumulator of mutations that, although majoritarily neutral or potentially deleterious when on their own, may become advantageous when combined. As an outcome, however, chromosome segregation or loss may eventually fail to complete, generating progenies with aberrant, yet stable, ploidy numbers, as it has been observed in a independently convergent fashion in different species of the filamentous ascomycete entomopathogen Metarhiziumspp (Kepler et al., 2016; Nielsen et al., 2021). It is not known yet to what extent such loci of these genomes can accumulate mutations and originate new paralogs with divergent functions assuming i) homozygous origin and ii) that they will not be subjected to haploidization in the course of their evolution. Certainly some of these mechanisms can have an impactful part in the genetic and possibly phenotypic diversity of these organisms, but much is still left to be uncovered by the increasingly powerful sequencing technologies and computational resources.The state of art in the fungal tree of lifeThe great plasticity of fungal morphologies, ecological niches, reproductive life cycles, and genetic variation has made it a difficult job for mycologists to classify these organisms using observable macroscopic features. Because of that, sequence similarity approaches have lately become part of the foundation for fungal systematics due to its accuracy and reliability in estimating the relationships within the kingdom. Numerous taxonomic studies have been conducted on Ascomycota and Basidiomycota and, although there is still some degree of uncertainty of paraphyletic topologies in lower taxonomic groups within the phyla, there is strong evidence to conclude phylum-level monophyly (Hibbett et al., 2018; Robbertse et al., 2006; Schoch et al., 2009; Zhao et al., 2017). They form a subkingdom named Dikarya and are considered the latest diverging lineage hence being positioned as the sister group to all other major lineages. The subkingdom has not undergone dramatic changes since it was first proposed, except by the conclusion that the previously Basidiomycete genus Entorrhiza formed a sister group with Dikarya, hence being proposed as its new phylum Entorrhizomycota (Fig. 1; Bauer et al. 2015).Basal clades in the kingdom are, however, still largely unresolved. Among other inconsistencies with previous single gene phylogenies, multilocus phylogenies revealed i) the polyphyletic nature of previously well accepted phylum Zygomycota, ii) the placement of Rozella allomycis as sister to Microsporidia and iii) the phylum Glomeromycota forming a clade with Dikarya (Blackwell et al., 2006; Hibbett et al., 2007; James et al., 2006a). Similar studies concluded that Chytridiomycota was paraphyletic confirming the divergence of Blastocladiales from other chytrids, elevating it to its own phylum, Blastocladiomycota (James et al., 2006b). Later, two phyla were proposed by Spatafora et al. (2017) from the formerly Zygomycetes, using genome-scale phylogenies. The first one, Mucoromycota, with saprobes and soil colonizers, including endophytes and arbuscular mycorrhizal forming fungi forming the subphyla Mucoromycotina, Mortierellomycotina and now a newly-resolved Glomeromycotina (Fig. 1). The second phylum, Zoopagomycota, comprised Entomophthoromycota, Kickxellomycotina and Zoopagomycotina, which are mostly symbionts and pathogens of animals, saprobes, and mycoparasites. However, the placements of these new subphyla classifications are contested to the rank of phyla, whose divergence-times and monophyly are taken into account along with the proposed Olpidiomycota and Basidiobolomycota in further work (Tedersoo et al., 2018). Moreover, it also recognizes a new phylum named Calcarisporiellomycota in the now superphylum Mucoromycetes, which were well accepted in further publications (da Silva et al., 2021; Wijayawardene et al., 2018).More recently, a new well supported phylum, Sanchytriomycota, composed of ameboid zoosporic fungi, has been proposed as a sister group to Blastocladiomycota (Galindo et al., 2021) using a large fungal genomic dataset and corroborating with the previous classifications on other groups. Regarding Chytrids, much has been discussed on Neocallimastigomycota and Monoblepharomycota forming a paraphyletic clade with the now monophyletic phylum Chytridiomycota, thus being considered phyla in the superphylum Chytridiomyceta, (Tedersoo et al., 2018, 2017), although it does not yet seem to be a consensus (James et al., 2020). Lastly, Microsporidia are regarded as the most basal in the kingdom after splitting with the proposed protist kingdom Nucleariae (Park and Poulin, 2021), sister to Fungi. Target of a number of taxonomic replacements over the last decades and once thought to be protists (Edlund et al., 1996), Microsporidian intracellular parasites of animals and their relationship to the Cryptomycota/Rozellomycota phylum have been better studied in phylogenomic studies (James et al., 2013). Despite proteomic trees suggesting a prostitan origin of their protein sequences (Choi and Kim, 2017), nucleotide based phylogenomic approaches agree with the well supported topology of the subkingdom Opisthosporidia as the deepest-branching clade of Fungi, containing Aphellidiomycota as a sister groups of a well-supported clade comprised of Rozellomycota/Cryptomycota and Microsporidia (Fig. 1; Li et al., 2021; Park and Poulin, 2021). Bass et al. (2018) propose that these two are actually members of a same phylum, where the genera included in what is traditionally known as “Microsporidia”, are but highly divergent and specialized long branching (LB) taxa, whereas what is known as “Rozellomycota/Cryptomycota” are its short branching (SB) representatives. It is, nonetheless, still unclear as to whether or not Ophistosporidia form a paraphyletic group, since there is no consensus on the split of Aphelids before or after the emergence of other lineages of Fungi (Letcher and Powell, 2019).