e14581 Background: The M2 macrophages are independent prognostic factors in nasopharyngeal carcinoma (NPC). Nevertheless, the clinical significance of M2 macrophages remains largely unexplored. Methods: We applied public single-cell sequencing data (GSE150825) to reconstruct a pseudotime trajectory of macrophage polarization in NPC and analyzed the gene expression patterns along the trajectory. GeneSwitches was used to identify the order of the critical regulatory gene during M2 macrophage activation. A novel computational framework was constructed to screen the M2 macrophage-activation genes (MAGens) for developing MAGens signature by integratively analyzing the transcriptomes data of single-cell, published dataset (GSE102349, N=88) and Fujian NPC dataset (N=188) using 10 machine learning algorithms (101 combinations). Results: Combining single-cell transcriptomics with GeneSwitches analyse, we identified SPP1 as the top switching gene and the order at which the switch takes place for the state of M2 macrophage activation. At the bulk transcriptome level, we found that the high expression of SPP1 had poor prognosis and more infiltration of M2 macrophages. Immunohistochemistry was used to validate the association between the critical regulatory gene expression and M2 macrophages. Then we analyzed the differential expressed genes (DEGs) upregulated by M2 macrophages at the single-cell transcript level. And the NPC transcriptome data was used to identify SPP1-related genes and prognostic genes. Based on the share genes of M2 macrophage DEGs,SPP1-related genes and prognostic genes, we established a five-gene MAGens signature which exhibited highly diagnostic accuracy in predicting progression-free survival in patients with NPC. Conclusions: We explored the role of SPP1 in NPC progression, M2 macrophage polarization and established an MAGens signature related prognostic model for NPC. MAGens signature could serve as a robust and promising tool to improve clinical outcomes for individual NPC patients.