In conclusion, our results suggest that the methylation levels of the CYP24A1, CYP27A1, CYP27B1, CYP2R1, and VDR genes in the metabolic pathway of vitamin D are related to the risk and prognosis of TB. Here, VDR is linked to tuberculosis.