BackgroundsEndometriosis (EM) is the most common gynecological disease in women of childbearing age. This study aims to identify key genes and screen drugs that may contribute to EM treatment.MethodsThe differentially expressed genes (DEGs) were identified using limma analysis in the GSE11691 dataset. The protein-protein network (PPI) was constructed. Four machine learning methods, including LASSO, SVM-RFE, random forest, and Boruta, were applied to identify the key genes associated with EM. Flow cytometry, wound healing, and migration assays were applied to assess the cell functions of APLNR on hEM15A. The immune cell infiltration of each sample in EM was calculated using a single-sample gene set enrichment analysis (ssGSEA) algorithm. The potential drugs were screened using the Connectivity Map (CMAP) database, based on the DEGs. Finally, the expression levels of the three genes were further validated in the GSE23339 dataset.ResultsOne hundred thirty-seven down-regulated genes and 304 up-regulated genes were identified. We identified three key genes associated with EM: APLNR, HLA-DPA1, and AP1S2. The ssGSEA analysis results indicated that these genes play an important role in the development of EM. Moreover, EM immune cell infiltration was tightly associated with these three genes. Finally, several molecular compounds targeting EM were screened with the connectivity map (CMAP) database. ShAPLNR decreased the cell viability of hEM15A, increased the number of apoptotic cells, and significantly decreased the proportion of callus through APLNR in vitro studies.DiscussionThree genes (APLNR, HLA-DPA1, and AP1S2) may serve as novel therapeutic targets for diagnosing and treating patients with EM.