Abstract
The genomic basis underlying the remarkable ecological flexibility of endophytic fungi (EF), particularly their potential to transition between symbiotic, saprophytic, and pathogenic lifestyles, remains poorly understood. Through comparative genomics of 75 Ascomycota and a validation set of 36 Fusarium genomes, we uncovered a distinct pattern of genome evolution in EF, contrasting with the well-known "gene loss" model in obligate symbionts. Our analysis reveals that EF genomes are significantly expanded, primarily driven by the accumulation of DNA transposable elements (TEs). Crucially, this TE-mediated genomic plasticity is coupled with the retention and significant expansion of gene families for both saprotrophy and potential pathogenesis. We propose a novel "dual-trophic potential" model: TE-driven genomic expansion and plasticity provide the genetic raw material for EF to maintain a versatile repertoire of ecological tools, facilitating adaptive shifts across the endophytic-saprophytic-pathogenic continuum. This study reframes our understanding of fungal endophytism from a static symbiotic state to a dynamic, genetically enabled ecological strategy.