Therefore, our study reveals the mechanism underlying TME differences and provides a new therapeutic strategy for gastric cancer by comprehensively analyzing HDAC-related TME features and quantifying TME indicators. The gene discussed is HDAC9; the disease is gastric cancer.