Ag presentation on HLA molecules plays a central role in infectious diseases and tumor immunology. To date, large-scale identification of (neo-)Ags from DNA sequencing data has mainly relied on predictions. In parallel, mass spectrometry analysis of HLA peptidome is increasingly performed to directly detect peptides presented on HLA molecules. In this study, we use a novel unsupervised approach to assign mass spectrometry–based HLA peptidomics data to their cognate HLA molecules. We show that incorporation of deconvoluted HLA peptidomics data in ligand prediction algorithms can improve their accuracy for HLA alleles with few ligands in existing databases. The results of our computational analysis of large datasets of naturally processed HLA peptides, together with experimental validation and protein structure analysis, further reveal how HLA-binding motifs change with peptide length and predict new cooperative effects between distant residues in HLA-B07:02 ligands.