Background and aimsinflammation plays an important role in atrial fibrillation (AF). In this study, we investigated the significance of immune cell infiltration in AF and identified the potential Hub genes involved in the regulation of immune cell infiltration in AF.Methodswe obtained AF datasets from the GEO database and analyzed them for obtaining differentially expressed genes (DEGs) by R software. Then, we performed GO, KEGG, and GSEA enrichment analyses of DEGs. The Hub genes of AF were determined by least absolute shrinkage selection operator (LASSO) regression analysis and weighted gene co-expression network analysis (WGCNA). Their validation was verified by using quantitative polymerase chain reaction (qPCR) in the AF rat model. Finally, we used a single sample GSEA (ssGSEA) to analyze immune cell infiltration and its relationship with hub genes.ResultsWe obtained 298 DGEs from the heatmap and found that DGEs were closely related to inflammation, immunity, and cytokine interactions by enrichment analyses. We obtained 10 co-expression modules by WGCNA. Among them, the module including CLEC4A, COTL1, EVI2B, FCER1G, GAPT, HCST, NCF2, PILRA, TLR8, and TYROBP had the highest correlation with AF. Four Hub genes (PILRA, NCF2, EVI2B, GAPT) were obtained further by LASSO analysis. The results suggested that the expression level of PILRA was significantly elevated in the rats with AF by qPCR, compared to the rats without AF. The results revealed that the infiltration of neutrophils, macrophages, monocytes, mast cells, immature B cells, myeloid-derived suppressor cell (MDSC), dendritic cell, and T cells and their partial subpopulations were closely related to AF by ssGSEA analysis, and PILRA was positively correlated with immature B cell, monocyte, macrophage, mast cell, dendritic cell, and T cells and their partial subpopulations by Spearman correlation analysis.ConclusionsPILRA was closely related to multiple types of immune cell infiltration, which may be associated with AF. PILRA may be a novel target of intervention for AF.