{'fraction_non_alphanumeric': 0.03731069538332547, 'fraction_numerical': 0.046795577215322536, 'mean_word_length': 4.657871331159205, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
PANDORA: a fast, anchor-restrained modelling protocol for peptide:MHC complexes

Deeper understanding T-cell mediated adaptive immune responses bears important implications in designing cancer immunotherapies and antiviral vaccines against pandemic outbreaks. T cells fire when they recognize foreign peptides that are presented on the cell surface by Major Histocompatibility Complexes (MHC), forming peptide:MHC (pMHC) complexes. 3D structure of pMHC complexes provides fundamental insight of T-cell recognition mechanism and aids immunotherapy design. High MHC and peptide diversities necessitate efficient computational modelling to enable whole proteome structural analysis. Here we present PANDORA, a robust pMHC structure modelling pipeline. Given a query, PANDORA searches for structural templates in its extensive database and then applies anchor restraints to the modelling process. This restrained energy minimization ensures one of the fastest pMHC modelling pipelines so far. On a set of 835 pMHC-I complexes over 78 MHC types, PANDORA generated models with a median RMSD of 0.68 Å and achieved a 93% success rate in top 10 models. PANDORA performs competitively with three pMHC-I modelling state-of-the-art approaches and outperforms AlphaFold in terms of accuracy while being superior to it in speed. PANDORA is a modularized and user-configurable python package with easy installation. We envision PANDORA to fuel deep learning with large-scale high-quality 3D models to tackle long-standing immunology challenges.


1
Introduction 38 The adaptive T cell immune activation requires the T-cell Receptor (TCR) to recognize foreign 39 peptide antigens presented on self MHC (Major Histocompatibility Complex) molecules. 40 Intracellular antigenic peptides presented by MHC-I can activate CD8+ T cells, which can directly 41 kill infected cells that present these peptides on their surface. Exogenously derived peptide antigens 42 presented by MHC-II can activate CD4+ T cells, which stimulate the production of antibodies and 43 promote CD8+ T Cell response (1). 44 Structural investigations of pMHC have provided profound knowledge of MHC antigen-display 45 mechanisms and T cell functions (2). Such knowledge can be used to aid the design of new therapies 46 for cancer (3), viral infections (4,5), and autoimmune disorders (6,7). MHC is the most polymorphic 47 protein known to date in humans. MHC has more than 10,000 identified alleles (8). Each of these 48 alleles has a specific binding preference for different peptides. Regardless of the highly polymorphic 49 nature of MHC sequence, the MHC structure has been elucidated as having an "Ultra-conserved" 50 fold (8). Considering the structure of MHC-I molecules, the peptide binding groove is formed by an 51 ߙ -chain, which has two domains denoted as G-ALPHA1 and G-ALPHA2 in IMGT nomenclature 52 (9)( Figure 1A). This cleft is closed on the sides and contains two deep binding pockets. Short 53 peptides of around 8 to 11 residue lengths canonically bind to these pockets with their second (P2) 54 and last (PΩ) residues, respectively (10,11). The peptide-binding groove of MHC-II is formed by two 55 domains from ߙ -and ߚ -chain (corresponding to the G-ALPHA and G-BETA domains in IMGT 56 nomenclature). Its binding cleft is open in both ends, and hence it accommodates longer peptides 57 ( Figure 1B). Normally 9 residues of the peptide bind to MHC binding groove, called binding core 58 and the rest of the peptide protrude out of the groove. The peptide is anchored at the P1, P4, P6 and 59 P9 pockets of MHC-II (11). 60 Complementary to atomic-resolution 3D structure determination experiments (such as X-ray and 61 NMR), the recent advances of large-scale mass spectrometry provide valuable tools to detect MHC 62 binding peptides (12-14). However, an infinite number of potential peptides could be derived from 63 host cells and diverse pathogens. The high diversity of MHC and peptide sequences call for the 64 development of effective computational methods for predicting MHC-binding peptides and their 65 binding affinities. 66 Currently, sequence-based machine learning (ML) methods are dominating MHC epitope predictions 67 and outperform three-dimensional (3D) modelling methods (15)(16)(17)(18) Our information-driven homology modelling framework PANDORA takes a few crucial steps 134 ( Figure 1C) to provide core domain knowledge to MODELLER (32). MHC high structural homology 135 and anchoring positions for bound peptides are used to constrain the conformational search space to 136 effectively produce an ensemble of 3D models. 137 because this is the domain responsible for the peptide binding (9). One structure can have more than 155 one allele name since the same G-domain can be shared by multiple MHC alleles. For this reason, 156 any reference to MHC allele further in this paper has to be intended to G-domain alleles. 157 158 During a modelling run, PANDORA selects a suitable structural template for the given target from 159 our parsed database. It then uses MODELLER to build an initial 3D structure, keeps the anchors 160 restrained and performs a loop modelling on the central region of the peptide to output the final 161 structures. Output models are ranked to indicate to the user which are the best ones. 162 163

PANDORA produces near-native models on a large benchmark set 164
We benchmarked PANDORA on all pMHC-I complexes with experimentally determined structures 165 in the IMGT/3Dstructure-DB database (39) (as of 28/06/2021): 835 complexes over 78 MHC allele 166 types (PDB IDs reported in Suppl. Table 1). We removed one structure from this dataset and used it 167 as the test case. This process was repeated for every structure in the dataset. We used MHC allele 168 name, actual peptide anchor position and peptide sequence as inputs for PANDORA, and asked 169 PANDORA to generate 20 model structures. case, our pipeline is capable of producing at least one near-native model (L-RMSD < 2 ) in 96.4% 182 of the cases and an overall mean deviation of 0.81 ± 0.56 ( Figure 2A). MODELLER's internal 183 molpdf function provides high-quality ranking for the models produced by PANDORA. To select 184 which models should be provided to the user as output, we evaluated MODELLER's scoring 185 functions molpdf and DOPE with compared hit rate and success rate plots (Suppl. Fig. 1), obtaining 186 the best results from molpdf. Figure 2C shows this scoring function reaching a success rate of 93% in 187 the top 10 models (see Methods section 5.3). The resulting L-RMSD median of top scored models 188 with molpdf (the final best output provided to the user) is 0.85 Å. Therefore, PANDORA's scoring 189 method, together with the sampling procedure, allows us to deliver reliable predictions ( Figure 2B  190 and D). 191

193
To obtain an estimation of which results a user can expect given information known a priori, we 194 checked the performance of PANDORA with respect to different peptide lengths (Suppl. Fig. 2A,B), 195 sequence identities between query and template peptides (Suppl. Fig. 2C,D) and MHC allele 196 difference between target and template (Suppl. Fig 2E,F). PANDORA gives the best performance on 197 8-9 mer peptides with an average L-RMSD of 0.67 . PANDORA models generated with 100% 198 peptide identity are slightly better than other peptide similarities (0.61 Å in median RMSD), but no 199 clear trend is observed with respect to the peptide sequence identity (Suppl. Fig. 2C,D). Reasonable 200 performances were also reached in the rare cases (16 out of 835) in which no template from the same 201 gene as the target was available (Suppl. Fig. 2E,F). This shows how PANDORA can be used to build 202 model cases of well-known as well as rare alleles. 203 204

PANDORA performs competitively with state-of-the-art methods 205
We compared PANDORA with three existing methods for pMHC-I 3D modelling: DockTope (30), 206 GradDock (29) and APE-Gen (27) on datasets used in their publications. As not all methods used 207 scoring functions to select best models for their experiments, we compared with each method's best 208 scenario. Specifically, we used our top molpdf model (PANDORA's default user output) to compare 209 with the pipelines that used scoring functions (GradDock and DockTope), and our models with best 210 L-RMSDs to compare with the pipeline that reported the best L-RMSD models (APE-Gen). 211 212 As shown in Figure 3, PANDORA is competitive with the state-of-the-art methods in terms of best-213 generated and top-selected models, both lower L-RMSD on average than the ones produced by the 214 published methods. The comparison between PANDORA and GradDock ( Figure 3A) and DockTope 215 ( Figure 3B) are based on cross-docking. The comparison in Figure 3C   PANDORA is computationally efficient. After downloading or building the templates dataset (both 233 options have to be done only once, but building can require up to 1.5 hours) PANDORA takes an 234 average of ~2.6 minutes (156 seconds) to build 20 models per each case on one thread on a Intel(R) 235 Xeon(R) Gold 6142 CPU @ 2.60GHz. According to their publications, DockTope takes "less than 6 236 hours", and GradDock takes about "107.79" seconds to model one case, but lacking the exact 237 hardware information a fair comparison is not possible. Given the availability and installation 238 conditions of the softwares we compared with, a direct comparison of the running times can in fact 239 be done only with APE-Gen. APE-Gen takes 3 minutes to prepare the MHC 3D structure plus 2 240 minutes per each pMHC-I complex using 6 or 8 threads (41). With roughly the same computational 241 time and number of cores (i.e., 5 minutes on 6 to 8 cores), PANDORA can model up to 11-15 cases. 242

243
To have a qualitative evaluation of PANDORA against AlphaFold, we tested multiple published 244 strategies for protein-peptide interaction modelling. We tried multimer-approach (36) and linker-245 approach (37,38) using template-based and template-independent AlphaFold publicly available 246 colabs (34,42). As reported in Suppl. Fig. 3, PANDORA always generated models with a 247 considerably lower backbone L-RMSD than AlphaFold on the four randomly selected pMHC 248 complexes. Also, PANDORA's cost in terms of computational resources previously discussed is 249 much lower than that of AlphaFold, which can take up to 18 GBs of GPU power for 20 minutes to As mentioned in section 2.1, the input we provided PANDORA with was the actual target peptide 255 anchors that were calculated directly from the target structure. We did so to avoid biases derived 256 from wrong anchor prediction in our benchmark performance. The anchor information is crucial for 257 our modelling pipeline. The majority of 9-to 12-mer MHC-I peptides have canonical anchoring 258 positions at P2 and PΩ (10,11). To study the effect of non-canonical peptide anchoring in the 3D 259 modelling process of PANDORA, we listed which peptides from our benchmark dataset used non-260 canonical anchor positions to bind to the MHC, resulting in a total of 34 cases. We modelled them as 261 in the previous benchmark experiment, with the only difference that canonical anchor positions were 262 used as input of PANDORA. The models with the lowest L-RMSD are reported in Figure 4A, where 263 the average L-RMSD improvement achieved using real anchors over canonical anchors is 1.48 . 264 This result is better exemplified in Figure 4B, where it can be observed how defining incorrect 265 (canonical, in this case) anchors causes PANDORA to fix the wrong residues inside the anchor 266 pockets, stretching (as shown) or elongating the peptide central loop, thus worsening the L-RMSD 267 with the x-ray structure. 268 Since the real anchor position is hardly available with peptide-MHC binding data, we evaluated the 269 reliability of predicting anchor positions using prediction tools. NetMHCpan4.1 is a binding affinity 270 and core prediction tool for pMHC-I complexes (17). An overview of NetMHCpan4.1 performance 271 on predicting the right anchors over our whole dataset can be found in Suppl. Fig 4, showing that 272 NetMHCpan4.1 provides reliable anchor predictions for most of the cases: correct anchor prediction 273 in 96.5% of the tested cases, one residue shift for 3.2% cases, and position shifts on both anchors in 274 0.2% cases. Based on these observations, we implemented the following options in PANDORA: to 275 1 use either canonical anchors, NetMHCpan4.1 predicted anchors, or anchor points provided by t 276 user, who may exploit different tools or gather integrative information from experimental data. 277 278 Long peptides (11-15 mers) present a challenge to be modelled reliably (Suppl. Fig. 2A). This 286 because long peptides are able to fold into small elements of secondary structure in their central pa 287 This problem, although rare (17 cases out of 835 structures in our benchmark dataset present 288 elements of secondary structure), presents a modelling challenge (model L-RMSD up to 3.03 Å). 289 290 To address this challenge, we enabled PANDORA to include secondary structure restraints and test 291 its performance on a 10-mer (PDB ID: 3BEW) and a 15-mer case (PDB ID: 4U6Y). In the 292 structures the peptide presents in its center region a small alpha helix (16 structures out of 835) and 293 small beta-sheet hairpin (1 structure out of 835), respectively. We manually defined seconda 294 structure restraints for the peptide based on the bound conformation found in the PDB structu 295 Secondary-structure restraints improved model qualities for both cases ( Figure 5). This clearly show 296 that a correct secondary structure prediction can effectively be provided to PANDORA to guide 297 modelling, leading to high-quality models even for challenging cases.  GitHub repository ( https://github.com/X-lab-3D/PANDORA ). Users can report problems, ask for 336 assistance or request specific features to be added from the GitHub issue section. 337 338 3 Discussion 339 In this study we present PANDORA, a reliable pMHC modelling pipeline. To reduce the 340 computational time associated with the modelling, PANDORA exploits two pieces of domain 341 knowledge: 1) MHC structures are highly conserved, 2) MHC uses anchor positions to bind the 342 peptide. 343 344 We demonstrate here that PANDORA performs reliably on the largest pMHC-I dataset obtained 345 from IMGT/3Dstructure-DB (39) and used for cross-validation. PANDORA also shows competitive 346 performance compared with three state-of-the-art modelling softwares while PANDORA 347 outperforms them in computational efficiency and ease of installation. Being a modular python 348 package, our method (or single sub-modules of it) can be integrated in other pipelines with ease, 349 which is considerably harder for the state-of-the-art softwares. AlphaFold is often misplacing the P2 anchor residue outside its pocket, causing a high backbone L-357 RMSD compared to the X-ray structure (Suppl. Fig. 3A,B and C). Furthermore, in presence of 358 secondary structures, AlphaFold can generate even higher L-RMSD models (Suppl. Fig. 3D). 359

360
When run with default settings (i.e., using P1 and PΩ as anchors for pMHC-I), our method achieves a 361 median L-RMSD of 0.67 Å on our large benchmark dataset (Suppl. Fig. 6), but it fails in delivering 362 high-quality models for some, mainly non-canonical cases. Most of these outliers are caused by 363 peptides with non-canonical anchor positions. To overcome this issue, users may opt for binding core 364 prediction tools (such as NetMHCPan4.1 (17) or MHCflurry (16)) to guide PANDORA's prediction 365 or model peptides with multiple anchor positions and choose the ones with best molpdf scores. Also, 366 high L-RMSD can be caused by long peptides able to fold into secondary structures. In these cases, 367 users may decide on secondary structure-or folding-prediction tools such as AGADIR (46) and 368 PEPFOLD3 (47) to elicit secondary structures restraints to input into PANDORA. For long peptides 369 that do not form secondary structures, users might just use a much larger sampling step, increasing 370 the number of generated models to hundreds or thousands. We report in Suppl. Fig 7 how  PANDORA supports multi-level parallelization and multiple user-configurable options (see github 380 README at: https://github.com/X-lab-3D/PANDORA). These features make it suitable for high-381 throughput purposes as well as to explore the modelling of particularly challenging peptides (e.g., 382 peptides of non-canonical length). In fact, its computational efficiency allows users to quickly run 383 thousands of cases or to increase the models' sampling (from the default of 20 to hundreds or 384 thousands) to explore a higher variety of conformations. identical between target and template, the initial loop model generated by MODELLER (which has 447 the same structure as the template) is scored as top model (with a dummy molpdf score) and provided 448 as best output. Also, the user is informed of this sequence identity and pointed to the deposited X-ray 449 structure from PANDORA's log. 450 451

Comparisons with state of the art 452
Datasets for comparisons with state-of-the-art methods were retrieved from each software's paper or 453 kindly provided by the authors. Some structures could not be processed by PANDORA according to 454 the criteria listed in section 5.1 or were not found in IMGT/3Dstructure-DB, resulting in smaller 455 comparison datasets than the exact ones provided in literature. We used 133 out of 135 structures for 456 Figure 3A (DockTope), with a peptide length span from 8 to 10 over 5 MHC alleles; 65 out of 69 for 457 Figure 3B (GradDock), with a peptide length span from 8 to 10 over 21 MHC alleles; and 508 out of 458 535 for Figure 3C (APE-Gen), with a peptide length span from 8 to 11 over 59 MHC alleles. 459 460

Evaluations 461
Ligand Root Mean Squared Deviation (L-RMSD). The models' quality was evaluated in terms of 462 L-RMSD (40). To this purpose, the G-domains (positions 1-180) of models and target structures were 463 superposed and the L-RMSD was calculated as the RMSD between the atoms of the experimentally 464 determined peptide conformation and the modelled peptide. L-RMSDs were calculated using profit 465 (55). To directly compare with state-of-the-art methods, we used the same sets of atom as these 466 works did: Carbon α L-RMSD (for DockTope and APE-Gen, Figures 3A and 3C respectively) and 467 Backbone + Carbon ࢼ L-RMSD (for GradDock, Figure 3B) The list of PDB structure IDs used in the cross-validation benchmark experiment can be found in 487 Supplementary Table 1. The PANDORA database used for the experiments in this work is available  488 for download at: https://github.com/X-lab-3D/PANDORA_database . Related data will be deposited 489 to SBGrid with DOI upon acceptance of the manuscript. 490 The source code is available on GitHub: https://github.com/X-lab-3D/PANDORA and the package