Using variable selection, we identified sparse diagnostic gene signatures; one gene (<i>PID1</i>) was able to distinguish TB from pneumonia after ESAT6-CFP10 stimulation with an AUC of 100% in the test set, while a combination of two genes (<i>STAT1</i> and <i>IFI44</i>) achieved an AUC of 91.7% (CI<sub>95%</sub> 75.0%-100%) in the test set after PPD stimulation. This evidence concerns the gene STAT1 and tuberculosis.