Tumor infiltrating lymphocytes (TILs) form immune populations with potential reactivity against melanoma. The degree of reactivity varies considerably among different TIL populations but the underlying network that governs the reactivity is poorly understood. The inventors were able to extract a simple set of subpopulation composition-based rules that explain reactivity to a large extent. Guided by the rules, they were able to restore anti-melanoma reactivity of nonreactive TILs by rational depletion and enrichment of selected subpopulations. This invention describes a generic approach for the prediction, understanding and control of a cell mixture function.