This dissertation investigates how clinically meaningful cancer phenotypes emerge from interactions between malignant cells and their surrounding tissue environment. Combining experimental cancer biology with machine learning approaches, it examines malignant-cell antigen presentation in pancreatic cancer and develops computational methods to map patient-level clinical phenotypes onto individual cells and spatial tissue niches. The work introduces MAPPER for localizing outcome-associated phenotypes across multiple cancer types and SpaPRISM for transferring multiclass subtype labels to spatial datasets. Together, these studies advance understanding of how cellular states and tissue organization relate to patient outcomes, highlighting phenotype-associated niches as an important scale of cancer biology between individual cells and whole-patient profiles.