Bioinformatics, 37(23), 2021, 4567–4568 doi: 10.1093/bioinformatics/btab687 Advance Access Publication Date: 2 October 2021 Applications Note Sequence analysis CNN-PepPred: an open-source tool to create convolutional NN models for the discovery of patterns in peptide sets—application to peptide–MHC class II binding prediction 1,2 2,3,4, Valentin Junet and Xavier Daura * 1 Anaxomics Biotech SL, Barcelona 08008, Spain, 2Institute of Biotechnology and Biomedicine, Universitat Autònoma de Barcelona, Barcelona 08193, Spain, 3Catalan Institution for Research and Advanced Studies (ICREA), Barcelona 08010, Spain and 4Biomedical Research Networking Center in Bioengineering, Biomaterials and Nanomedicine (CIBER-BBN), Madrid 28029, Spain *To whom correspondence should be addressed. Associate Editor: Tobias Marschall Received on May 13, 2021; revised on August 2, 2021; editorial decision on September 24, 2021; accepted on September 28, 2021 Abstract Summary: The ability to unveil binding patterns in peptide sets has important applications in several biomedical areas, including the development of vaccines. We present an open-source tool, CNN-PepPred, that uses convolution- al neural networks to discover such patterns, along with its application to peptide–HLA class II binding prediction. The tool can be used locally on different operating systems, with CPUs or GPUs, to train, evaluate, apply and visualize models. Availability and implementation: CNN-PepPred is freely available as a Python tool with a detailed User’s Guide at https://github.com/ComputBiol-IBB/CNN-PepPred. The site includes the peptide sets used in this study, extracted from IEDB (www.iedb.org). Contact: xavier.daura@uab.cat Supplementary information: Supplementary data are available at Bioinformatics online. 1 Introduction are only available as on-line platforms or executables and there The prediction of antigenic determinants—epitopes—of specific exists, to our knowledge, no reference providing information on the proteins or full proteomes is a key aspect of immunoinformatics, implementation details of the neural network behind them, in a man- with a wide-range of applications from the study of autoimmunity ner that would make it reproducible. Recently, these algorithms have to the development of cancer immunotherapies and therapeutic as taken a new research direction to include multiple-allele datasets well as prophylactic vaccines. For MHC epitopes in particular, (MA) (Alvarez et al., 2019; Reynisson et al., 2020). Other groups experiments coupling natural-ligand elution to mass spectrometry have also developed their own methods to include MA data (Chen identification (Caron et al., 2015) have led in recent years to an et al., 2019; Racle et al., 2019), but are also only available for appli- explosion in the amount of data available on MHC peptide recogni- cation purposes in the form of a platform or an executable. While all tion, enabling data-driven approaches to in silico epitope prediction these tools are being successfully used in multiple applications and (Wang et al., 2010). are amenable to non-expert use, we believe that the lack of clear im- The state-of-the-art in the prediction of peptide–MHC class II plementation details and open code for the core predictive algorithm binding is arguably represented by the NetMHCII family of algo- hinder their use by bioinformatics researchers who need a tool that rithms (Andreatta et al., 2015). Their core is a neural-network-based can be fully integrated in larger codes and possibly modified to fit algorithm called NNAlign (Nielsen and Lund, 2009). NetMHCII particular needs in different areas of peptide recognition. features an allele-specific algorithm, while NetMHCIIpan deploys a It is indeed to satisfy our own needs in this field that we devel- universal network for the prediction of binding to any MHC class II oped CNN-PepPred, a new tool for the discovery of patterns in pep- allele with known protein sequence (Jensen et al., 2018). The func- tide sets. The tool was developed to conveniently fit general purpose tionality of both tools is constrained to the application of pre-trained needs such as the training of models, their application to new data, models. NNAlign (Nielsen and Andreatta, 2017), on the other hand, their evaluation by cross-validation and gaining visual insight on the offers the possibility of training new models. These tools, however, training process. The software is accompanied by a detailed User’s C The Author(s) 2021. Published by Oxford University Press. V 4567 This is an Open Access article distributed under the terms of the Creative Commons Attribution-NonCommercial License (https://creativecommons.org/licenses/by-nc/4.0/), which permits non-commercial re-use, distribution, and reproduction in any medium, provided the original work is properly cited. For commercial re-use, please contact journals.permissions@oup.com 4568 V.Junet and X.Daura Guide and has been tested on Linux and Windows, using CPUs and compares well to NNAlign for training and clearly outperforms GPUs. In the following section, we provide a concise description of NetMHCIIpan for prediction, NNAlign being the faster prediction CNN-PepPred. We refer the reader to the User’s Guide for a detailed tool. description. The github repository contains two main Python scripts, one with the CNNPepPred class and one that uses this class following a template filled by the user. The class was written so that it could be 2 Description also used independently from the template. The User’s Guide con- tains a full description of the class, its parameters, the template, the CNN-PepPred is based on Convolutional Neural Networks (CNN) model, the visualization, the IEDB data and the benchmarking. and written in Python. Supplementary Figure S1B (Supplementary The core training algorithm of CNN-PepPred consists only of a Information) illustrates the architecture of the CNN, implemented few Keras lines of code. It can, therefore, be also used independently with the open-source libraries Keras (github.com/fchollet/keras) and from the tool, as a starting point for further analysis and/or general- TensorFlow (tensorflow.org). The peptides are first encoded using izations that could fit other types of peptide sets. Thanks to the ease the blosum62 similarity matrix (Henikoff and Henikoff, 1992). of use of libraries like Keras and TensorFlow, the implementation In the schema, this corresponds to filling the input table with the does not require the developer to fully implement specific feed- blosum62 similarity between the residue (row) and the amino acid forward/back-propagation passes that would fit one type of data. type (column). To deal with the different lengths in the peptide sets, The CNN-PepPred code is provided under an open-source license. the symbol ‘-’ representing the absence of further residues was intro- duced and added at the end of all peptides in the training set so that their lengths match. The convolutional layer applies different filters (only one is illustrated in the schema) to all overlapping l-mers in the Acknowledgement peptide, where l is a user defined parameter, typically l ¼ 9 in appli- The authors thank Judith Farrés and José M Mas from Anaxomics Biotech SL cations related to MHC class II. The ReLu activation layer sets all for their support and helpful discussions. negative outputs to zero. The MaxPool layer will select the highest outputs and the dense layer will connect the results to generate the output, i.e. the predicted binding score. The final model is an equally weighted ensemble of CNNs, resulting from different numbers of Funding filters in the convolutional layer times the number of initial This project received funding from the European Union’s Horizon 2020 re- configurations. search and innovation programme under the Marie Skłodowska-Curie Both NNAlign and CNN-PepPred use a blosum encoding. The [765158] (COSMIC; www.cosmic-h2020.eu) and from the Spanish Ministry main difference between the two methods is that while NNAlign for Science, Innovation and Universities [PID2019-111364RB-I00]. uses a two-step procedure that identifies a core l-mer within a pep- tide and then applies a network weight configuration to the core Conflict of Interest: none declared. (and flanking regions) to generate the output, CNN-PepPred uses convolution to slide through all possible overlapping l-mers and sub- sequent layers to activate them and generate the output. In other References words, CNN-PepPred does not select a core binder but makes full Alvarez,B. et al. (2019) NNAlign_MA; MHC peptidome deconvolution for use of all overlapping l-mers within the peptide, and what may be accurate MHC binding motif characterization and improved T-cell epitope considered the core binder is the overlapping l-mer that is most acti- predictions. Mol. Cell. Proteom., 18, 2459–2477. vated during the feed-forward pass. Andreatta,M. et al. (2015) Accurate pan-specific prediction of peptide–MHC The tool contains many functionalities that can be conveniently class II binding affinity with improved binding core identification. called by filling a simple template. Users can train their own models, Immunogenetics, 67, 641–650. evaluate them through cross-validation, save them and apply them Caron,E. et al. (2015) Analysis of major histocompatibility complex (MHC) to new data (Supplementary Fig. S1A). It is also possible to visualize immunopeptidomes using mass spectrometry. Mol. Cell. Proteom., 14, the binding motif of a trained model with Logomaker (Tareen and 3105–3117. Kinney, 2020). For more insight on the feed-forward pass on a Chen,B. et al. (2019) Predicting HLA class II antigen presentation through selected peptide set, the user can also print all layers and corre- integrated deep learning. Nat. Biotechnol, 37, 1332–1343. sponding outputs of the trained model. In addition, advanced users Henikoff,S. and Henikoff,J.G. (1992) Amino acid substitution matrices from may incorporate the CNNPepPred class, providing all the function- protein blocks. Proc. Natl. Acad. Sci. USA, 89, 10915–10919. ality, to other Python developments. Jensen,K.K. et al. (2018) Improved methods for predicting peptide binding af- When applied to HLA class II binding, using 51 alleles with data finity to MHC class II molecules. Immunology, 154, 394–406. curated by the IEDB (www.iedb.org), our tool showed significant Nielsen,M. and Andreatta,M. (2017) NNAlign: a platform to construct and improvement over NNAlign-2.1 (Nielsen and Andreatta, 2017) in evaluate artificial neural network models of receptor-ligand interactions. predictive performance (see Supplementary Information). We used Nucleic Acids Res., 45, W344–W349. Nielsen,M. and Lund,O. (2009) NN-align. An artificial neural network-based the T-cell epitope benchmark dataset from Jensen et al. (2018) as an alignment algorithm for MHC class II peptide binding prediction. BMC independent evaluation set for the models trained with the data Bioinformatics, 10, 296. retrieved from IEDB. CNN-PepPred was found to perform better on Racle,J. et al. (2019) Robust prediction of HLA class II epitopes by deep motif average than NetMHCIIpan-3.2 (Jensen et al., 2018), although the deconvolution of immunopeptidomes. Nat. Biotechnol., 37, 1283–1286. results were overall similar as shown in Appendix D of the User’s Reynisson,B. et al. (2020) NetMHCpan-4.1 and NetMHCIIpan-4.0: guide. Appendix C contains also a cross-validation comparison with improved predictions of MHC antigen presentation by concurrent motif de- the data from NetMHCII-2.3 and NetMHCIIpan-3.2, giving overall convolution and integration of MS MHC eluted ligand data. Nucleic Acids similar results. Note that the latter two tools cannot be used them- Res., 48, W449–W454. selves to train new models. Tareen,A. and Kinney,J.B. (2020) Logomaker: beautiful sequence logos in In Supplementary Appendices SB.2 and SC.2, we compared com- Python. Bioinformatics, 36, 2272–2274. putation times for CNN-PepPred, NNAlign and NetMHCIIpan, Wang,P. et al. (2010) Peptide binding predictions for HLA DR, DP and DQ showing that, for the specific CPU and GPU used, CNN-PepPred molecules. BMC Bioinformatics, 11, 568.