BackgroundAlthough fatty acid metabolism has been confirmed to be involved in the pathological process of idiopathic pulmonary fibrosis (IPF), systematic analyses on the immune process mediated by fatty acid metabolism-related genes (FAMRGs) in IPF remain lacking.MethodsThe gene expression data of 315 patients with IPF were obtained from Gene Expression Omnibus database and were divided into the training and verification sets. The core FAMRGs of the training set were identified through weighted gene co-expression network analysis. Then, the fatty acid metabolism-related subtypes in IPF were identified on the basis of k-means unsupervised clustering. The scores of fatty acid metabolism and the expression of the fibrosis biomarkers in different subtypes were compared, and functional enrichment analysis was carried out on the differentially expressed genes between subtypes. A random forest model was used to select important FAMRGs as diagnostic markers for distinguishing between subtypes, and a line chart model was constructed and verified by using other datasets and rat models with different degrees of pulmonary fibrosis. The difference in immune cell infiltration among subtypes was evaluated with CIBERSORT, and the correlation between core diagnostic markers and immune cells were analyzed.ResultsTwenty-four core FAMRGs were differentially expressed between the training set and normal samples, and IPF was divided into two subtypes. Significant differences were observed between the two subtypes in biological processes, such as linoleic acid metabolism, cilium movement, and natural killer (NK) cell activation. The subtype with high fatty acid metabolism had more severe pulmonary fibrosis than the other subtype. A reliable construction line chart model based on six diagnostic markers was constructed, and ABCA3 and CYP24A1 were identified as core diagnostic markers. Significant differences in immune cell infiltration were found between the two subtypes, and ABCA3 and CYP24A1 were closely related to NK cells.ConclusionFatty acid metabolism and the immune process that it mediates play an important role in the occurrence and development of IPF. The analysis of the role of FAMRGs in IPF may provide a new potential therapeutic target for IPF.