Background:Idiopathic pulmonary fibrosis (IPF) is caused by aberrant repair because of alveolar epithelial injury and can only be effectively treated with several compounds. Several metabolism-related biomolecular processes were found to be involved in IPF. We aimed to identify IPF subtypes based on metabolism-related pathways and explore potential drugs for each subtype.Methods:Gene profiles and clinical information were obtained from the Gene Expression Omnibus (GEO) database (GSE70867 and GSE93606). The enrichment scores for 41 metabolism-related pathways, immune cells, and immune pathways were calculated using the Gene Set Variation Analysis (GSVA) package. The ConsensusClusterPlus package was used to cluster samples. Novel modules and hub genes were identified using weighted correlation network analysis (WGCNA). Receiver operating characteristic (ROC) and calibration curves were plotted, and decision curve analysis (DCA) were performed to evaluate the model in the training and validation cohorts. A connectivity map was used as a drug probe.Results:Two subtypes with significant differences in prognosis were identified based on the metabolism-related pathways. Subtype C1 had a poor prognosis, low metabolic levels, and a unique immune signature. CDS2, LCLAT1, GPD1L, AGPAT1, ALDH3A1, LAP3, ADH5, AHCYL2, and MDH1 were used to distinguish between the two subtypes. Finally, subtype-specific drugs, which can potentially treat IPF, were identified.Conclusion:The aberrant activation of metabolism-related pathways contributes to differential prognoses in patients with IPF. Collectively, our findings provide novel mechanistic insights into subtyping IPF based on the metabolism-related pathway and potential treatments, which would help clinicians provide subtype-specific individualized therapeutic management to patients.