We determined the relationship between ferroptosis and immune cells in ankylosing spondylitis and the role of the Chinese herbal medicine Cassia twigs in treating ankylosing spondylitis. We analyzed clinical data on ankylosing spondylitis, transcriptome data, single-cell sequencing data, and genes related to ferroptosis and Cassia twigs. Clinical variables related to AS were selected through logistic regression analysis of the clinical data combined with machine learning. GSEA and enrichment analysis were performed on genes related to ferroptosis, combined with transcriptome data and drug-related genes, to identify the key genes and drug targets related to AS, as well as, the key immune cells. Then, the single-cell data and cell subtypes were analyzed. Finally, the interconnections between immune cells were analyzed through intercellular communication. Five variables, including neutrophils, were screened for clinical data analysis. The AUC of the experimental group was 0.859 and that of the validation group was 0.807. Ferroptosis gene NFE2L2 was identified as the final drug target of AS
it was upregulated in AS and downregulated in the control group by immunohistochemical verification, both of which were statistically significant (P <
0.001). Neutrophils were divided into two subgroups: high expression of NFE2L2 and low expression of NFE2L2. Through molecular docking, Cassia twigs were found to effectively act on the ferroptosis gene NFE2L2. Neutrophils act as important immune cells in AS. The twigs of the Chinese herb Cassia can treat AS by acting on the protein structure of the ferroptosis gene NFE2L2.