Abstract
BACKGROUND: Ophiocordyceps sinensis in the Qinghai-Tibet Plateau parasitizes soil-borne larvae of Thitarodes/Hepialus ghost moths, forming valued Chinese cordyceps. To understand the genetic basis of highland evolution and adaptation of this fungus, genetic structure, selection signals, gene flow and demographic history of 209 isolates from 37 locations in China, were investigated, based on genome and SNP data. RESULTS: A new sequence assembly of 120.1 Mb for O. sinensis was presented. 209 isolates exhibiting high Ts/Tv ratios (> 7.0) and G:C to A:T substitution frequency (> 51.86%), were classified into seven geographically separate groups, based on SNPs. The isolates from Tibet, Qinghai and Gansu exhibited a genetically similar structure; those from parts of Sichuan and Yunnan displayed different genetic structures. Gene flow of fungal isolates from Tibet into Yunnan was detected. The genes under selection pressure were primarily associated with metabolic pathways and genetic information processes. The isolates from Qinghai and Gansu might have experienced stronger selective pressure or demographic events reducing the genetic diversity in spore related genes, compared to those from parts of Sichuan. Across isolates from Qinghai, Gansu, and Tibet, a shared peak signal at calA and calK (related to polyketide biosynthesis, pigmentation, and UV protection) were detected, which may reflect selection or demographic factors. Distinct haplotypes in SPT6, NF1, SND1, and TALDO1 served as geographic markers for Sichuan, Sharang, Alulaka and Yunnan, enabling isolate origin tracing. Demographic analysis revealed three trends: most isolates showed two expansion–contraction events; a second group had weaker peaks; Yunnan and some Sichuan isolates showed minimal changes, suggesting divergent evolutionary histories. CONCLUSIONS: These findings facilitate better understandings of O. sinensis genetic background, and commercial cultivation. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1186/s12864-025-12177-6.