An algorithm that predicts the immune response to a pathogen could lead to early diagnosis for such diseases as tuberculosis.