BackgroundThe pathogenesis of myocardial infarction complicating depression is still not fully understood. Bioinformatics is an effective method to study the shared pathogenesis of multiple diseases and has important application value in myocardial infarction complicating depression.MethodsThe differentially expressed genes (DEGs) between control group and myocardial infarction group (M-DEGs), control group and depression group (D-DEGs) were identified in the training set. M-DEGs and D-DEGs were intersected to obtain DEGs shared by the two diseases (S-DEGs). The GO, KEGG, GSEA and correlation analysis were conducted to analyze the function of DEGs. The biological function differences of myocardial infarction and depression were analyzed by GSVA and immune cell infiltration analysis. Four machine learning methods, nomogram, ROC analysis, calibration curve and decision curve were conducted to identify hub S-DEGs and predict depression risk. The unsupervised cluster analysis was constructed to identify myocardial infarction molecular subtype clusters based on hub S-DEGs. Finally, the value of these genes was verified in the validation set, and blood samples were collected for RT-qPCR experiments to further verify the changes in expression levels of these genes in myocardial infarction and depression.ResultsA total of 803 M-DEGs, 214 D-DEGs, 13 S-DEGs and 6 hub S-DEGs (CD24, CSTA, EXTL3, RPS7, SLC25A5 and ZMAT3) were obtained in the training set and they were all involved in immune inflammatory response. The GSVA and immune cell infiltration analysis results also suggested that immune inflammation may be the shared pathogenesis of myocardial infarction and depression. The diagnostic models based on 6 hub S-DEGs found that these genes showed satisfactory combined diagnostic performance for depression. Then, two molecular subtypes clusters of myocardial infarction were identified, many differences in immune inflammation related-biological functions were found between them, and the hub S-DEGs had satisfactory molecular subtypes identification performance. Finally, the analysis results of the validation set further confirmed the value of these hub genes, and the RT-qPCR results of blood samples further confirmed the expression levels of these hub genes in myocardial infarction and depression.ConclusionImmune inflammation may be the shared pathogenesis of myocardial infarction and depression. Meanwhile, hub S-DEGs may be potential biomarkers for the diagnosis and molecular subtype identification of myocardial infarction and depression.