dataesr/scientific-paragraphs-categorization huggingface dataset:
, 2017; Gfeller et al. , 2018)  can reconstruct, from unannotated peptide sequences, a mixture of generative models, one for each expressed HLA type. However, it makes simplified assumptions about binding specificity and is not designed to leverage available (albeit limited) annotation information from the Immune Epitope Database  (Vita et al. , 2019)  (IEDB) to improve accuracy. We present an alternative method for predicting peptides presented by specific class I MHCs based on Restricted Boltzmann Machines-RBM-MHC. RBM-MHC is a scoring and classification scheme that can be easily trained ''on the fly'' on custom datasets, such as patient-or experiment-specific samples, and more generally on newly available data. As such, RBM-MHC enables improved predictions for rare alleles at a fast pace without waiting for new releases of general software like NetMHC Cell Systems 12, 195-202, February 17, 2021 ª 2020 The Author(s).
In this representation space, each cluster groups together antigens with the same HLA-binding specificity (given by the color code). Linear classification guided by the knowledge on the HLA-I restriction of a few antigens in each cluster (''labels'') is performed through the HLA-I classifier to predict the HLA-I type of all antigens. Data: IEDB-derived dataset for haplotype 1, Table  S2. (B) RBM distinguishes 2 subclasses in HLA-B*51:01-binding antigens. The HLA-B*51:01-peptide bond can be established  (Gfeller et al. , 2018)  via (i) the interaction of the HLA-B*51:01 residue 62 with peptide position 2, requiring a hydrophilic residue there, typically alanine (A), and a polar or negatively charged residue, typically aspartic acid (D), at position 1; and, (ii) with R62 sidechain facing the solvent, requiring co-occurrence at positions 1-2 of hydrophobic residues, typically proline (P), at position 2.
Inspection of the inputs to the 10th hidden unit (h 10 ), found by projecting peptides predicted by RBM-MHC as HLA-B*51:01-specific onto the corresponding weights (STAR Methods, Equation  4 ), reveals a bimodal distribution, enabling the discrimination of the ''hydrophilic/charged'' pattern (i) from the ''hydrophobic'' pattern (ii), as recapitulated by the sequence logos. (C) Performance (AUC) of 6 methods for HLA-I prediction on 9-mer in 10 synthetic-individual samples, each carrying 6 HLA-I covering A, B, and C alleles (see also Figure  S8 ; Table  S2 ). Bars are standard deviations over the 10 datasets. (D) Sequence logos of clusters found with RBM-MHC trained on melanoma-associated sample 12T  (Kalaora et al. , 2016 (Kalaora et al. , , 2018) )  and IEDB mono-allelic data; r gives the Pearson correlation between respective amino acid frequencies.
Restricted Boltzmann Machine for Peptide Presentation The first building block of the method is a RBM, a probabilistic graphical model defined by a simple structure with one hidden layer and weights connecting the input-the peptide sequence-to the hidden layer (Figure  1B ). RBM parameters, i. e. , the weights and the biases acting on both input and hidden units, are learned from a training set of presented peptides collected from public repositories or custom samples (STAR Methods; Figures S1A, S2A  ,  and S3 ). These input peptides may come from mass spectrometry (MS) experiments or binding assays. They may come from several HLA alleles, or a single one. For example, in datasets from single-individual samples, the number of HLAs is at most 6, as each individual inherits 2 alleles of each locus HLA-A, HLA-B, and HLA-C.
Another example is given by mono-allelic samples  (Abelin et al. , 2017; Sarkizova et al. , 2020) , where peptides are presented by a single HLA protein. After training, the RBM returns a probability for each sequence, which is interpreted as a global score of antigen presentation by the HLA proteins involved in the training dataset. Since learning the RBM requires fixed-length input sequences, we first reduce peptides of variable length to a reference length by an alignment procedure based on a Hidden Markov Model profile built from aligning subsets of same-length sequences using standard routines (STAR Methods; Figure  S1E ). We set the reference length to 9-residues, the most common length of peptides presented by class I MHCs  (Bassani-Sternberg et al. , 2015; Andreatta and Nielsen, 2016; Trolle et al.
RBM Performance on Mono-Allelic Data As a first validity check of RBM-based presentation scores, we built a RBM model to predict presentation by a single common allele, HLA-A*02:01, from MS data annotated with this HLA restriction in IEDB  (Vita et al. , 2019). We tested the model score's ability to discriminate presented peptides from ''generic'' peptides (randomly drawn from the human proteome). We calculated a receiver operating characteristic (ROC) curve from RBM presentation scores assigned to a test set of presented versus generic peptides (Figure  1C ). The area under the ROC, AUC = 0. 973, far above the random-expectation value (AUC = 0. 5) and close to the maximal value (AUC = 1), proves the RBM predictive power at recovering presented antigens. We next benchmarked RBM's predictive power on recent MS datasets from mono-allelic cell lines  (Sarkizova et al.
, 2020)  and is therefore trained on an independent dataset. In contrast, RBM was trained on data presently available in IEDB for all the 92 alleles. To ensure independence from the training set, testing peptides were manually excluded from the training data (STAR Methods). Both methods performed comparably (AUC = 0. 97 for RBM versus 0. 95 for NetMHC, 1% PPV = 0. 52 for RBM versus 0. 53 for NetMHC). When there is limited or no data for a given HLA allele, NetMHCpan extrapolates from the most similar HLA allele for which data are available. Figure  1D  shows that NetMHCpan performance degrades with the distance between the queried HLA and nearest neighbor in the training dataset  (Nielsen et al. , 2007). By contrast, the RBM performs equally well on all HLAs, which is expected as in that case the distance to the training dataset is always zero.
This highlights the importance of being able to flexibly and rapidly train models on new data, especially for HLA alleles that are poorly covered in previously available datasets. The four alleles at the largest distance from NetMHCpan4. 0 training data, for which RBM outperforms NetMHC, are all HLA-C (HLA-C*01:02, HLA-C*02:02, HLA-C*07:04, and HLA-C*17:01, see Figure  S5B ), a locus usually under-represented in existing databases.
Severe Acute Respiratory Syndrome Coronavirus 2 Epitope Discovery Predicting which antigens are presented by virus-infected cells is key to the rational design of vaccines targeting these antigens. We tested RBM's ability to perform this task on the example of severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), using recent in vitro measurements of binding stability (Immunitrack and Intavis, 2020) of SARS-CoV-2 candidate epitopes (selected using NetMHC4. 0; Andreatta and Nielsen, 2016; and NetMHCpan4. 0; Jurtz et al. , 2017; see STAR Methods). We first trained an allele-specific RBM for each HLA-I involved in the experiment. Since the experiment measures binding, we chose our training sets as binding assay (BA) datasets as well as MS datasets that were reweighed to make them comparable to BAs (correcting for amino acid frequency biases, see STAR Methods).
RBM Offers Useful Low-Dimension Representations In addition to providing a presentation score, RBM hidden units allow for mapping peptides onto a lower-dimensional ''representation space'' given by the inputs to the RBM hidden units (Tubiana et al. , 2019) (see STAR Methods). The full potential of this representation is best illustrated on a RBM trained on multiallelic data, where peptides may be bound to up to 6 different HLA-I proteins. Figure  2A  shows an example of such a representation projected in 2 dimensions, on a synthetic dataset obtained by pooling peptides from 6 HLA restrictions in IEDB. The lowdimensional projection organizes peptides into 6 well-defined clusters, reflecting the HLA-binding specificities present in the sample. Each HLA recognizes specific ''sequence motifs'' (patterns of preferred residues at each position) in the presented peptides.
HLA Classification with RBM-MHC This low-dimensional representation of peptides suggests an efficient way to classify them by HLA-I specificity using the annotation of a small number of sequences by their HLA preference. In practice, these annotated sequences may come from other experiments or public databases as IEDB  (Vita et al. , 2019). Using these annotations, we train a linear classifier to predict the HLA restriction of individual peptides from their RBM representation (see  STAR Methods; Figures 2A, S2A,  and S3C-S3E ). We refer to this architecture, which combines the RBM (trained on unannotated peptides) and the HLA-I classifier (trained on a few annotated ones), as RBM-MHC. To test performance in a case where the ground truth is known, we trained RBMs on 10 synthetic ''single-individual'' samples pooling together IEDB 9-mer antigens presented by 6 HLA-I proteins per individual, covering 43 different alleles in total (12 HLA-A, 17 HLA-B, and 14 HLA-C, see STAR Methods and Table  S2 ).
We next extended our HLA type predictions to peptides of variable length (8-11 residues). Multiallelic datasets pose the additional challenge that sequences must be aligned together across different HLA motifs. To optimize this multiple sequence alignment, we resorted to an iterative procedure where the sequence alignment is refined using the HLA assignments from the first iteration of RBM-MHC, after which a second RBM-MHC is trained to obtain the final model. This procedure allows the steps of HLA classification and alignment to inform each other (STAR Methods and Figure  S1E ). We benchmarked our alignment routine against other well-established alignment strategies (based on the MAFFT software;  Katoh and Standley, 2013)  and we verified that our routine ensures higher HLA classification performance even without the refinement step (STAR Methods and Figures  S1F-S1L ).
RBM-MHC Compares Favorably to Existing Methods RBM-MHC outperforms MixMHCp2. 1 (Bassani-Sternberg and  Gfeller, 2016; Bassani-Sternberg et al. , 2017; Gfeller et al. , 2018)  in terms of both overall accuracy and stability across the 10 synthetic datasets (Figures  2C  and S8 ). This is in part thanks to the 10% labeled data it exploits. The RBM also captures global sequence correlations that MixMHCp's independentsite models miss, which are needed to correctly classify antigens across alleles with similar binding motifs. The major drop in MixMHCp2. 1 performance occurs precisely in datasets that mix same-supertype alleles  (Sidney et al. , 2008)  (HLA-B*27:05 and HLA-B*39:01 belonging to supertype B27; and, HLA-B*40:01 and HLA-B*44:03 belonging to B44, see Table  S2 ). RBM-MHC also performs better in terms of AUC than NetMHC-pan4.
1  (Reynisson et al. , 2020) , which can be applied here to predict binding to each of the 6 alleles in our datasets and remains comparable to NetMHCpan4. 1 when several other performance indicators are considered (Figure  S8 ). The gain in AUC of RBM-MHC over MixMHCp and NetMHC is slightly more pronounced for 9-mer-only samples than for 8-11-mer (Figure  S8A ), thus suggesting room for further improvement in the alignment.
Application to Single-Patient Cancer Immunopeptidome To assess the relevance of our approach in a clinical setting, we considered single-patient, melanoma-associated immunopeptidomics datasets  (Kalaora et al. , 2016 (Kalaora et al. , , 2018;; Bassani-Sternberg et al. , 2016) , complemented with patient HLA typing and wholeexome sequencing (WES) of tumorous cells, wherein a total 11 neoantigens were identified. We tested the RBM-MHC approach for motif reconstruction. Since in this case, true peptide-HLA associations are unknown, the model performance is evaluated through the correlation between the predicted motifs and motifs reconstructed from IEDB monoallelic data (Figures  2D-2E  and S9 ). RBM-MHC, MixMHCp2. 1, and NetMHCpan4. 1 perform comparably, with the exception of sample Mel8, where MixMHCp2.
1 merges antigens specific to the 2 HLA-C into the same cluster causing a drop in the average r (Figures  2E  and S9B ). In addition, RBM-MHC and its unsupervised version RBM-km trained on the patient dataset (see STAR Methods) systematically predicted the correct HLA association for all neoantigens. They also assigned a top 1% score among all WES mutants to 8 out of the 11 identified neoantigens (Table  S3 ).
These generated peptides could be experimentally tested in future, providing additional evidence for the validity of the model  (Russ et al. , 2020). RBM-MHC's use will also depend on the choice of the training dataset. Single-allele datasets allow for training allele-specific models to score antigen presentation by a specific HLA allele. In this way, we have proposed new putative SARS-CoV-2 epitopes for HLA-C alleles that could be tested experimentally (Table  S1 ). Multi-allelic datasets (from e. g. , peptidome MS of clinical samples) allow for training models to score antigen presentation in a given donor (with all its HLA-I alleles), and to predict the HLAbinding specificity of given peptides. We benchmarked our approach on several examples of datasets. In single-allele datasets, we found that RBM-MHC can perform similarly to established methods, such as NetMHCpan, for frequent, well-characterized alleles (Figures  1D-1G , S5, and S7), despite the fact that NetMHC training is fully supervised, incorporates more information such as binding affinities, and uses positive (binders) as well as negative (non-binders) examples.
The number of binders per allele in the version NetMHCpan4. 0 ranges between ~50 and ~9,500  (Jurtz et al. , 2017) , while RBM-MHC is trained on datasets of presented peptides only, making our approach less data demanding. The amount of 8-11-mer peptides per allele considered in this work from IEDB-derived MS records varies from ~100 to 10 4 , with an average (2,350) comparable to NetMHCpan4. 0 positive examples. RBM-MHC is a more flexible machine-learning scheme that can be easily trained on newly produced datasets, tracking the fast-growing number of available datasets to improve its predictive power, especially for previously under-represented HLA-I alleles (Figures  1D, 1F,  and S5 ), such as HLA-C alleles. The latest version of NetMHCpan, NetMHCpan4. 1  (Reynisson et al. , 2020) , was published very recently, three years after the previous release NetMHCpan4.
, 2020 and Immunitrack and Intavis, 2020 came out while NetMHCpan4. 0 was the latest version. RBM-MHC can also be applied to unannotated, moderatesize multiallelic datasets available from clinical studies, for which there may exist only a limited number of HLA annotations in existing databases (<100) for the patients rarer HLA alleles. We have shown that RBM-MHC efficiently exploits the statistical information in these samples and combines it with limited annotation information to deliver accurate and stable predictions of HLA-I binding (Figures  2C-2E , S8, and S9; Tables  S2  and S3 ). The flexibility of choice of the training dataset and corresponding applications is even broader. The method is not limited to MS datasets but can be trained on datasets from binding affinity assays to customize presentation score predictions toward the identification of high-affinity ligands (see Figure  1F ).
If only MS data are available to build a predictor for this task, as is the case for HLA-C alleles in Figure  1F , a commonly acknowledged issue is that biases of MS techniques can potentially affect the amino acid frequency distribution in training datasets and hence the predictor's results. To address this issue we developed, similarly to Bassani-Sternberg et al. , 2017, a sequence re-weighting scheme to efficiently compensate for detection biases in MS and better score ligands tested in vitro (STAR Methods, Figure  S4 ). Overall, our results show that the approach is useful for systematic applications with newly produced large-scale datasets covering an increasing range of HLA types. Future work will be devoted to also develop an extension to HLA class II presentation. Finally, since our method is designed to be trained on custom samples it could be of relevance to produce sample-specific insights about the complexity of endogenous antigen presentation.
Mass Spectrometry Datasets The search in IEDB for immunopeptidomic data from mass spectrometry (MS) was performed as follows. The full set of curated HLA-I ligands was downloaded from IEDB (file mhc_ligand_full. csv from http://www. iedb. org/database_export_v3. php, accessed in July 2020). In this IEDB file, we looked for linear, human peptides eluted from cells and detected by MS techniques (field Assay Group = ''ligand presentation'', field Method/Technique = ''cellular MHC/mass spectrometry'', ''mass spectrometry'', ''secreted MHC/mass spectrometry''). Among these data, we prioritized HLA-specific peptides from mono-allelic sources, in such a way that the assignment of HLA-binding specificity is unambiguous and does not rely on additional in silico predictions. To do this in practice, we set the field Allele Evidence Code = ''Single allele present'', indicating that antigen presenting cells are known to only express a single HLA-I molecule, as is the case for mono-allelic cell lines  (Abelin et al.
, 2017; Sarkizova et al. , 2020). If, for a given allele, we found less than a minimal number (set to 300) of sequences among mono-allelic-source data, we extended the search to peptides with Allele Evidence Code = ''Allele Specific Purification'', since this procedure attaches greater confidence to the HLA assignment than its inference by in silico methods. Only for one allele (HLA-B*39:01) did we extend the search to all other MS data, including the evidence code ''Inferred by motif or alleles present''. MS datasets filtered through these steps were used to train allele-specific RBM presentation models (as in Figures  1C-1F ) and multi-allelic models (as in Figures  2C-2E ). In a multi-allelic setting, we first tested motif reconstruction by considering 10 ''synthetic-individual'' datasets of antigens with known HLA-I specificity to assess the RBM-MHC classification performance by comparing RBM-MHC predictions against the known HLA-I specificity.
These datasets were built by collecting all IEDB antigens (searched as above) associated to 2 haplotypes, i. e. , combinations of an A, a B, a C HLA allele observed to co-occur in the human population to preserve linkage (see Table  S2 ). Information on haplotypes co-occurrence was found at allelefrequencies. net  (Gonzalez-Galarza et al. , 2015). To apply the RBM-MHC method to multi-allelic, patient-derived immunopeptidomic samples, we sought to have a small amount of labeled peptides, here set to 10%. To this end, we either retrieved a HLA annotation in IEDB for portions of the samples or, when this was not possible, we added to each of them labeled peptides from IEDB (searched as above) for the 6 HLA-I given by the patient's HLA typing. The RBM-MHC training set was then defined as this minimally extended dataset, to guide the learning of the HLA-I classifier by the labeled peptides, whose predictions are used to reconstruct HLA-I motifs in the original dataset.
Binding Assay Datasets Records of binding affinity (BA) assays from IEDB (as of July 2020) were filtered following  (Sarkizova et al. , 2020) , i. e. selecting peptides annotated with a quantitative measure of binding dissociation constants <500 nM and excluding assay types that led to documented discrepancies between predicted and effective affinity (''purified MHC/direct/radioactivity/dissociation constant KD'', ''purified MHC/direct/fluorescence/half maximal effective concentration (EC50)'', ''cellular MHC/direct/fluorescence/ half maximal effective concentration (EC50)''). BA datasets were used to train allele-specific models of Figures  1F-1G.
Antigen Sequence Alignment The typical length of HLA-I peptides, structurally constrained by the MHC-I binding cleft, is generally recognized to be 8 to 11 amino acids  (Bassani-Sternberg et al. , 2015; Andreatta and Nielsen, 2016; Trolle et al. , 2016; Sarkizova et al. , 2020) , with 9-mers being the most abundant except for very few exceptions  (Sarkizova et al. , 2020). Hence we focus on datasets containing 8-11-mers (Figures  S1B-S1D ) and an alignment procedure is implemented to reduce peptide sequences to the typical length of 9 residues. This choice of a 9-mer-centered alignment is also consistent with the treatment of variable-length class I peptides by other algorithms as MixMHCp, which scores their positions based on 9-mer motifs  (Gfeller et al. , 2018) , and NetMHC, which applies to sequences with length different from 9 the insertions and deletions that give optimal predicted scores for presentation by a given allele (Andreatta and Nielsen, 2016).
d Repeat the RBM-MHC training after the re-alignment. In the 10 ''synthetic-individual'' datasets considered for testing motif reconstruction (Table  S2 ), high classification performance was reached already at the first iteration and we observed a further, systematic improvement after 1 re-alignment step, see Figure  S1F. For 2 or more iterations, there are cases in which the classification performance is degraded, therefore in our motif reconstruction applications (Figures  2C-2E ) we re-align and re-train once. The alignment routine is designed in such a way as to be easily tuned to a different reference length and to the inclusion of longer peptides, depending on the particular length preferences of the alleles of interest and on data availability. For instance, in Figure  S1H  we show that HLA classification performance is rather stable with respect to the choice of the reference length in the range 8-11 residues and could even slightly increase for reference lengths > 9.
We recall however that the choice of reference length = 9 is made to reflect the typical length of class I peptides: peptide length distributions of the datasets considered in this work confirm that 9 residues is by far the most abundant length (Figures  S1B-S1D ). To test the quality our alignment routine, we compared its performance at HLA classification to that of other common alignment software, MAFFT (latest version 7. 471;  Katoh and Standley, 2013)  and HMMER (http://hmmer. org/). Default options of these methods tend to produce very gapped alignments, that might cause a rather drastic loss of information on the original peptides and hence affect the RBM-MHC classification performance. In contrast, the progressive alignment of profiles obtained from subsets of sequences of the same length (Step 1 in Figure  S1E ) allows for well controlled gap insertions.
RBM-MHC Algorithm Restricted Boltzmann Machine (RBM) The RBM learns an underlying probability model for the antigen sequences in the training datasets, in our case the HLA-I presented antigens. A RBM  (Smolensky, 1986; Hinton, 2002)  consists of one layer of N v observed units v = fv i g N v i = 1 and one layer of N h hidden units h = fh m g N h m = 1 connected by weights W = fw im g (see Figure  2A ). The observed units v stand here for the antigen sequences to model, hence N v = 9 and the number of ''symbols'', q, for each observed unit is 21 (20 amino acids and the gap). Mathematically, the model is defined by a joint probability over presented antigen sequences and hidden units: Pðv; hÞ $ exp X N v i = 1 g i ðv i Þ À X N h m = 1 U m ðh m Þ + X i;m h m w im ðv i Þ ! (Equation 1) where g i ðv i Þ is a matrix of N v 3q local ''potentials'' (biases) acting on observed units, U m ðh m Þ are N h local potentials on hidden units and the weights w im ðv i Þ (arranged in a tensor of size N v 3 N h 3 q) couple hidden and observed units.