Patients treated with TNF inhibitors (TNFi; OR = 0.160, 95% CI 0.099–0.260, P < 0.001) and tocilizumab (OR 0.147, 95% CI 0.053–0.408, P < 0.001) had reduced odds of infection. This evidence concerns the gene TNF and infection.