From 277b5615c68b3719889b30c0ccbe128d4ee2b2e1 Mon Sep 17 00:00:00 2001 From: Zethson Date: Sun, 12 May 2019 15:28:00 +0200 Subject: [PATCH 01/16] [FEATURE] Implemented Interfaces for MHCFlurry and MHCNuggets --- Fred2/EpitopePrediction/PSSM.py | 944 +++++++++++++++++++++++++------- setup.py | 2 +- 2 files changed, 734 insertions(+), 212 deletions(-) diff --git a/Fred2/EpitopePrediction/PSSM.py b/Fred2/EpitopePrediction/PSSM.py index 483ef643..a358d890 100644 --- a/Fred2/EpitopePrediction/PSSM.py +++ b/Fred2/EpitopePrediction/PSSM.py @@ -1,3 +1,4 @@ +# coding=utf-8 # This code is part of the Fred2 distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. @@ -7,17 +8,23 @@ .. moduleauthor:: schubert """ - +# coding=utf-8 import itertools import warnings -import pandas import math +import subprocess +import csv +import tempfile +import pandas from Fred2.Core.Allele import Allele from Fred2.Core.Peptide import Peptide from Fred2.Core.Result import EpitopePredictionResult from Fred2.Core.Base import AEpitopePrediction +from mhcflurry import Class1AffinityPredictor +from mhcnuggets.src.predict import predict + class APSSMEpitopePrediction(AEpitopePrediction): """ @@ -38,13 +45,15 @@ def predict(self, peptides, alleles=None, **kwargs): :return: Returns a :class:`~Fred2.Core.Result.EpitopePredictionResult` object with the prediction results :rtype: :class:`~Fred2.Core.Result.EpitopePredictionResult` """ + def __load_allele_model(allele, length): - allele_model = "%s_%i"%(allele, length) - return getattr(__import__("Fred2.Data.pssms."+self.name+".mat."+allele_model, fromlist=[allele_model]), - allele_model) + allele_model = "%s_%i" % (allele, length) + return getattr( + __import__("Fred2.Data.pssms." + self.name + ".mat." + allele_model, fromlist=[allele_model]), + allele_model) if isinstance(peptides, Peptide): - pep_seqs = {str(peptides):peptides} + pep_seqs = {str(peptides): peptides} else: pep_seqs = {} for p in peptides: @@ -54,13 +63,13 @@ def __load_allele_model(allele, length): if alleles is None: al = [Allele(a) for a in self.supportedAlleles] - alleles_string = {conv_a:a for conv_a, a in itertools.izip(self.convert_alleles(al), al)} + alleles_string = {conv_a: a for conv_a, a in itertools.izip(self.convert_alleles(al), al)} else: if isinstance(alleles, Allele): alleles = [alleles] if any(not isinstance(p, Allele) for p in alleles): raise ValueError("Input is not of type Allele") - alleles_string = {conv_a:a for conv_a, a in itertools.izip(self.convert_alleles(alleles), alleles)} + alleles_string = {conv_a: a for conv_a, a in itertools.izip(self.convert_alleles(alleles), alleles)} result = {} pep_groups = pep_seqs.keys() @@ -68,28 +77,28 @@ def __load_allele_model(allele, length): for length, peps in itertools.groupby(pep_groups, key=len): peps = list(peps) - #dynamicaly import prediction PSSMS for alleles and predict + # dynamicaly import prediction PSSMS for alleles and predict if self.supportedLength is not None and length not in self.supportedLength: - warnings.warn("Peptide length of %i is not supported by %s"%(length, self.name)) + warnings.warn("Peptide length of %i is not supported by %s" % (length, self.name)) continue for a in alleles_string.keys(): try: pssm = __load_allele_model(a, length) except ImportError: - warnings.warn("No model found for %s with length %i"%(alleles_string[a], length)) + warnings.warn("No model found for %s with length %i" % (alleles_string[a], length)) continue if alleles_string[a] not in result: result[alleles_string[a]] = {} ##here is the prediction and result object missing## for p in peps: - score = sum(pssm[i].get(p[i], 0.0) for i in xrange(length))+pssm.get(-1, {}).get("con", 0) + score = sum(pssm[i].get(p[i], 0.0) for i in xrange(length)) + pssm.get(-1, {}).get("con", 0) result[alleles_string[a]][pep_seqs[p]] = score if not result: - raise ValueError("No predictions could be made with " +self.name+" for given input. Check your" - "epitope length and HLA allele combination.") + raise ValueError("No predictions could be made with " + self.name + " for given input. Check your" + "epitope length and HLA allele combination.") df_result = EpitopePredictionResult.from_dict(result) df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], @@ -106,10 +115,15 @@ class Syfpeithi(APSSMEpitopePrediction): Rammensee, H. G., Bachmann, J., Emmerich, N. P. N., Bachor, O. A., & Stevanovic, S. (1999). SYFPEITHI: database for MHC ligands and peptide motifs. Immunogenetics, 50(3-4), 213-219. """ - __alleles = frozenset(['HLA-B*15:10', 'HLA-B*41:01', 'HLA-B*37:01', 'HLA-B*27:05', 'HLA-B*38:01', 'HLA-A*02:01', 'HLA-B*47:01', 'HLA-A*26:01', - 'HLA-B*37:01', 'HLA-DRB1*11:01', 'HLA-B*50:01', 'HLA-B*07:02', 'HLA-A*68:01', 'HLA-A*24:02', 'HLA-DRB1*15:01', 'HLA-B*15:01', - 'HLA-B*45:01', 'HLA-A*11:01', 'HLA-A*03:01', 'HLA-B*40:01', 'HLA-DRB1*03:01', 'HLA-B*39:01', 'HLA-DRB1*01:01', 'HLA-B*51:01', - 'HLA-B*39:02', 'HLA-B*08:01', 'HLA-B*18:01', 'HLA-B*44:02', 'HLA-B*49:01', 'HLA-DRB1*07:01', 'HLA-B*14:02', 'HLA-A*01:01']) + __alleles = frozenset( + ['HLA-B*15:10', 'HLA-B*41:01', 'HLA-B*37:01', 'HLA-B*27:05', 'HLA-B*38:01', 'HLA-A*02:01', 'HLA-B*47:01', + 'HLA-A*26:01', + 'HLA-B*37:01', 'HLA-DRB1*11:01', 'HLA-B*50:01', 'HLA-B*07:02', 'HLA-A*68:01', 'HLA-A*24:02', 'HLA-DRB1*15:01', + 'HLA-B*15:01', + 'HLA-B*45:01', 'HLA-A*11:01', 'HLA-A*03:01', 'HLA-B*40:01', 'HLA-DRB1*03:01', 'HLA-B*39:01', 'HLA-DRB1*01:01', + 'HLA-B*51:01', + 'HLA-B*39:02', 'HLA-B*08:01', 'HLA-B*18:01', 'HLA-B*44:02', 'HLA-B*49:01', 'HLA-DRB1*07:01', 'HLA-B*14:02', + 'HLA-A*01:01']) __supported_length = frozenset([8, 9, 10, 11]) __name = "syfpeithi" __version = "1.0" @@ -148,7 +162,7 @@ def convert_alleles(self, alleles): :return: Returns a string representation of the input :class:`~Fred2.Core.Allele.Allele` :rtype: list(str) """ - return ["%s_%s%s"%(a.locus, a.supertype, a.subtype) for a in alleles] + return ["%s_%s%s" % (a.locus, a.supertype, a.subtype) for a in alleles] class BIMAS(APSSMEpitopePrediction): @@ -162,12 +176,13 @@ class BIMAS(APSSMEpitopePrediction): """ __alleles = frozenset(['HLA-B*04:01', 'HLA-A*31:01', 'HLA-B*58:01', 'HLA-C*06:02', 'HLA-A*03:01', 'HLA-B*35:01', - 'HLA-B*35:01', 'HLA-B*15:01', 'HLA-A*02:05', 'HLA-B*27:05', 'HLA-B*27:05', 'HLA-A*33:02', - 'HLA-B*39:01', 'HLA-B*38:01', 'HLA-B*40:', 'HLA-A*24:02', 'HLA-B*51:01', 'HLA-B*07:02', 'HLA-B*08:01', - 'HLA-B*51:02', 'HLA-B*40:06', 'HLA-B*40:06', 'HLA-B*51:02', 'HLA-B*37:01', 'HLA-A*11:01', - 'HLA-B*08:01', 'HLA-B*44:03', 'HLA-A*68:01', 'HLA-B*51:03', 'HLA-B*52:01', 'HLA-A*02:01', - 'HLA-A*01:01', 'HLA-C*07:02', 'HLA-C*03:01', 'HLA-B*40:01', 'HLA-B*51:01', 'HLA-B*39:02', - 'HLA-B*52:01', 'HLA-C*04:01', 'HLA-B*27:02', 'HLA-B*39:01']) + 'HLA-B*35:01', 'HLA-B*15:01', 'HLA-A*02:05', 'HLA-B*27:05', 'HLA-B*27:05', 'HLA-A*33:02', + 'HLA-B*39:01', 'HLA-B*38:01', 'HLA-B*40:', 'HLA-A*24:02', 'HLA-B*51:01', 'HLA-B*07:02', + 'HLA-B*08:01', + 'HLA-B*51:02', 'HLA-B*40:06', 'HLA-B*40:06', 'HLA-B*51:02', 'HLA-B*37:01', 'HLA-A*11:01', + 'HLA-B*08:01', 'HLA-B*44:03', 'HLA-A*68:01', 'HLA-B*51:03', 'HLA-B*52:01', 'HLA-A*02:01', + 'HLA-A*01:01', 'HLA-C*07:02', 'HLA-C*03:01', 'HLA-B*40:01', 'HLA-B*51:01', 'HLA-B*39:02', + 'HLA-B*52:01', 'HLA-C*04:01', 'HLA-B*27:02', 'HLA-B*39:01']) __supported_length = frozenset([8, 9]) __name = "bimas" __version = "1.0" @@ -206,7 +221,7 @@ def convert_alleles(self, alleles): :return: Returns a string representation of the input :class:`~Fred2.Core.Allele.Allele` :rtype: list(str) """ - return ["%s_%s%s"%(a.locus, a.supertype, a.subtype) for a in alleles] + return ["%s_%s%s" % (a.locus, a.supertype, a.subtype) for a in alleles] def predict(self, peptides, alleles=None, **kwargs): """ @@ -234,10 +249,11 @@ class Epidemix(APSSMEpitopePrediction): Feldhahn, M., et al. FRED-a framework for T-cell epitope detection. Bioinformatics 2009;25(20):2758-2759. """ - __alleles = frozenset(['HLA-B*27', 'HLA-A*11:01', 'HLA-B*27:05', 'HLA-B*07', 'HLA-B*27', 'HLA-A*01', 'HLA-B*44', 'HLA-A*03', - 'HLA-A*25', 'HLA-B*37:01', 'HLA-A*02:01', 'HLA-A*02:01', 'HLA-B*18:01', 'HLA-B*18:01', 'HLA-A*03', - 'HLA-A*24', 'HLA-A*25', 'HLA-A*02:01', 'HLA-A*11:01', 'HLA-A*24:02', 'HLA-B*08', 'HLA-B*08', - 'HLA-B*51:01', 'HLA-B*51:01']) + __alleles = frozenset( + ['HLA-B*27', 'HLA-A*11:01', 'HLA-B*27:05', 'HLA-B*07', 'HLA-B*27', 'HLA-A*01', 'HLA-B*44', 'HLA-A*03', + 'HLA-A*25', 'HLA-B*37:01', 'HLA-A*02:01', 'HLA-A*02:01', 'HLA-B*18:01', 'HLA-B*18:01', 'HLA-A*03', + 'HLA-A*24', 'HLA-A*25', 'HLA-A*02:01', 'HLA-A*11:01', 'HLA-A*24:02', 'HLA-B*08', 'HLA-B*08', + 'HLA-B*51:01', 'HLA-B*51:01']) __supported_length = frozenset([9, 10, 8, 11]) __name = "epidemix" __version = "1.0" @@ -276,7 +292,7 @@ def convert_alleles(self, alleles): :return: Returns a string representation of the input :class:`~Fred2.Core.Allele.Allele` :rtype: list(str) """ - return ["%s_%s%s"%(a.locus, a.supertype, a.subtype) for a in alleles] + return ["%s_%s%s" % (a.locus, a.supertype, a.subtype) for a in alleles] class Hammer(APSSMEpitopePrediction): @@ -288,15 +304,16 @@ class Hammer(APSSMEpitopePrediction): Sturniolo, T., et al. Generation of tissue-specific and promiscuous HLA ligand databases using DNA microarrays and virtual HLA class II matrices. Nature biotechnology 1999;17(6):555-561. """ - __alleles = frozenset(['HLA-DRB1*07:03', 'HLA-DRB1*07:01', 'HLA-DRB1*11:28', 'HLA-DRB1*11:21', 'HLA-DRB1*11:20', 'HLA-DRB1*04:26', - 'HLA-DRB1*04:23','HLA-DRB1*04:21', 'HLA-DRB5*01:05:', 'HLA-DRB1*08:17', 'HLA-DRB1*13:05', 'HLA-DRB1*13:04', - 'HLA-DRB1*13:07', 'HLA-DRB1*13:01', 'HLA-DRB1*13:02', 'HLA-DRB1*08:04', 'HLA-DRB1*08:06', 'HLA-DRB1*08:01', - 'HLA-DRB1*01:01', 'HLA-DRB1*01:02', 'HLA-DRB1*08:02', 'HLA-DRB1*13:11', 'HLA-DRB1*03:11', 'HLA-DRB1*11:07', - 'HLA-DRB1*11:06', 'HLA-DRB1*11:04', 'HLA-DRB1*11:02', 'HLA-DRB1*11:01', 'HLA-DRB1*04:08', 'HLA-DRB1*04:01', - 'HLA-DRB1*04:02', 'HLA-DRB1*04:05', 'HLA-DRB1*04:04', 'HLA-DRB1*13:23', 'HLA-DRB1*13:22', 'HLA-DRB1*13:21', - 'HLA-DRB1*13:27', 'HLA-DRB1*08:13', 'HLA-DRB1*13:28', 'HLA-DRB1*03:06', 'HLA-DRB1*03:07', 'HLA-DRB1*03:05', - 'HLA-DRB1*11:14', 'HLA-DRB1*03:01', 'HLA-DRB1*15:02', 'HLA-DRB1*15:01', 'HLA-DRB1*15:06', 'HLA-DRB1*03:08', - 'HLA-DRB1*03:09', 'HLA-DRB1*04:10', 'HLA-DRB5*01:01']) + __alleles = frozenset( + ['HLA-DRB1*07:03', 'HLA-DRB1*07:01', 'HLA-DRB1*11:28', 'HLA-DRB1*11:21', 'HLA-DRB1*11:20', 'HLA-DRB1*04:26', + 'HLA-DRB1*04:23', 'HLA-DRB1*04:21', 'HLA-DRB5*01:05:', 'HLA-DRB1*08:17', 'HLA-DRB1*13:05', 'HLA-DRB1*13:04', + 'HLA-DRB1*13:07', 'HLA-DRB1*13:01', 'HLA-DRB1*13:02', 'HLA-DRB1*08:04', 'HLA-DRB1*08:06', 'HLA-DRB1*08:01', + 'HLA-DRB1*01:01', 'HLA-DRB1*01:02', 'HLA-DRB1*08:02', 'HLA-DRB1*13:11', 'HLA-DRB1*03:11', 'HLA-DRB1*11:07', + 'HLA-DRB1*11:06', 'HLA-DRB1*11:04', 'HLA-DRB1*11:02', 'HLA-DRB1*11:01', 'HLA-DRB1*04:08', 'HLA-DRB1*04:01', + 'HLA-DRB1*04:02', 'HLA-DRB1*04:05', 'HLA-DRB1*04:04', 'HLA-DRB1*13:23', 'HLA-DRB1*13:22', 'HLA-DRB1*13:21', + 'HLA-DRB1*13:27', 'HLA-DRB1*08:13', 'HLA-DRB1*13:28', 'HLA-DRB1*03:06', 'HLA-DRB1*03:07', 'HLA-DRB1*03:05', + 'HLA-DRB1*11:14', 'HLA-DRB1*03:01', 'HLA-DRB1*15:02', 'HLA-DRB1*15:01', 'HLA-DRB1*15:06', 'HLA-DRB1*03:08', + 'HLA-DRB1*03:09', 'HLA-DRB1*04:10', 'HLA-DRB5*01:01']) __supported_length = frozenset([9]) __name = "hammer" __version = "1.0" @@ -335,7 +352,7 @@ def convert_alleles(self, alleles): :return: Returns a string representation of the input :class:`~Fred2.Core.Allele.Allele` :rtype: list(str) """ - return ["%s_%s%s"%(a.locus, a.supertype, a.subtype) for a in alleles] + return ["%s_%s%s" % (a.locus, a.supertype, a.subtype) for a in alleles] class SMM(APSSMEpitopePrediction): @@ -348,17 +365,27 @@ class SMM(APSSMEpitopePrediction): biological processes with the stabilized matrix method. BMC Bioinformatics 6:132. """ - __alleles = frozenset(['HLA-B*27:20', 'HLA-B*83:01', 'HLA-A*32:15', 'HLA-B*15:17', 'HLA-B*40:13', 'HLA-A*24:02', 'HLA-A*24:03', 'HLA-B*53:01', - 'HLA-B*15:01','HLA-B*27:05', 'HLA-B*42:01', 'HLA-B*39:01', 'HLA-B*38:01', 'HLA-A*23:01', 'HLA-A*25:01', 'HLA-C*04:01', - 'HLA-A*29:02', 'HLA-A*02:06', 'HLA-A*02:01', 'HLA-A*02:02', 'HLA-A*02:03', 'HLA-A*26:02', 'HLA-A*26:03', 'HLA-A*26:01', - 'HLA-C*03:03', 'E*01:01', 'E*01:03', 'HLA-B*58:01', 'HLA-A*31:01', 'HLA-C*06:02', 'HLA-B*07:02', 'HLA-A*66:01', - 'HLA-B*57:01', 'HLA-A*68:01', 'HLA-A*68:02', 'HLA-C*14:02', 'HLA-B*35:01', 'HLA-B*15:09', 'HLA-B*35:03', 'HLA-A*80:01', - 'HLA-B*15:03', 'HLA-B*15:02', 'HLA-A*32:01', 'HLA-A*02:50', 'HLA-A*32:07', 'HLA-B*58:02', 'HLA-A*69:01', 'HLA-A*68:23', - 'HLA-A*11:01', 'HLA-A*03:01', 'HLA-B*73:01', 'HLA-B*40:01', 'HLA-B*44:03', 'HLA-B*46:01', 'HLA-B*40:02', 'HLA-C*12:03', - 'HLA-B*44:02', 'HLA-A*30:01', 'HLA-A*02:19', 'HLA-A*30:02', 'HLA-A*02:17', 'HLA-A*02:16', 'HLA-B*51:01', 'HLA-B*45:01', - 'HLA-A*02:12', 'HLA-A*02:11', 'HLA-B*54:01', 'HLA-B*08:01', 'HLA-B*18:01', 'HLA-B*08:03', 'HLA-B*08:02', 'HLA-C*05:01', - 'HLA-C*15:02', 'HLA-A*33:01', 'HLA-B*14:02', 'HLA-C*07:01', 'HLA-B*48:01', 'HLA-B*15:42', 'HLA-C*07:02', 'HLA-A*01:01', - 'HLA-C*08:02']) + __alleles = frozenset( + ['HLA-B*27:20', 'HLA-B*83:01', 'HLA-A*32:15', 'HLA-B*15:17', 'HLA-B*40:13', 'HLA-A*24:02', 'HLA-A*24:03', + 'HLA-B*53:01', + 'HLA-B*15:01', 'HLA-B*27:05', 'HLA-B*42:01', 'HLA-B*39:01', 'HLA-B*38:01', 'HLA-A*23:01', 'HLA-A*25:01', + 'HLA-C*04:01', + 'HLA-A*29:02', 'HLA-A*02:06', 'HLA-A*02:01', 'HLA-A*02:02', 'HLA-A*02:03', 'HLA-A*26:02', 'HLA-A*26:03', + 'HLA-A*26:01', + 'HLA-C*03:03', 'E*01:01', 'E*01:03', 'HLA-B*58:01', 'HLA-A*31:01', 'HLA-C*06:02', 'HLA-B*07:02', 'HLA-A*66:01', + 'HLA-B*57:01', 'HLA-A*68:01', 'HLA-A*68:02', 'HLA-C*14:02', 'HLA-B*35:01', 'HLA-B*15:09', 'HLA-B*35:03', + 'HLA-A*80:01', + 'HLA-B*15:03', 'HLA-B*15:02', 'HLA-A*32:01', 'HLA-A*02:50', 'HLA-A*32:07', 'HLA-B*58:02', 'HLA-A*69:01', + 'HLA-A*68:23', + 'HLA-A*11:01', 'HLA-A*03:01', 'HLA-B*73:01', 'HLA-B*40:01', 'HLA-B*44:03', 'HLA-B*46:01', 'HLA-B*40:02', + 'HLA-C*12:03', + 'HLA-B*44:02', 'HLA-A*30:01', 'HLA-A*02:19', 'HLA-A*30:02', 'HLA-A*02:17', 'HLA-A*02:16', 'HLA-B*51:01', + 'HLA-B*45:01', + 'HLA-A*02:12', 'HLA-A*02:11', 'HLA-B*54:01', 'HLA-B*08:01', 'HLA-B*18:01', 'HLA-B*08:03', 'HLA-B*08:02', + 'HLA-C*05:01', + 'HLA-C*15:02', 'HLA-A*33:01', 'HLA-B*14:02', 'HLA-C*07:01', 'HLA-B*48:01', 'HLA-B*15:42', 'HLA-C*07:02', + 'HLA-A*01:01', + 'HLA-C*08:02']) __supported_length = frozenset([8, 9, 10, 11]) __name = "smm" __version = "1.0" @@ -397,7 +424,7 @@ def convert_alleles(self, alleles): :return: Returns a string representation of the input :class:`~Fred2.Core.Allele.Allele` :rtype: list(str) """ - return ["%s_%s_%s"%(a.locus, a.supertype, a.subtype) for a in alleles] + return ["%s_%s_%s" % (a.locus, a.supertype, a.subtype) for a in alleles] def predict(self, peptides, alleles=None, **kwargs): """ @@ -427,15 +454,24 @@ class SMMPMBEC(APSSMEpitopePrediction): """ __alleles = frozenset( - ['HLA-A*01:01', 'HLA-A*02:01', 'HLA-A*02:02', 'HLA-A*02:03', 'HLA-A*02:06', 'HLA-A*02:11', 'HLA-A*02:12', 'HLA-A*02:16', 'HLA-A*02:17', - 'HLA-A*02:19', 'HLA-A*02:50', 'HLA-A*03:01', 'HLA-A*11:01', 'HLA-A*23:01', 'HLA-A*24:02', 'HLA-A*24:03', 'HLA-A*25:01', 'HLA-A*26:01', - 'HLA-A*26:02', 'HLA-A*26:03', 'HLA-A*29:02', 'HLA-A*30:01', 'HLA-A*30:02', 'HLA-A*31:01', 'HLA-A*32:01', 'HLA-A*32:07', 'HLA-A*32:15', - 'HLA-A*33:01', 'HLA-A*66:01', 'HLA-A*68:01', 'HLA-A*68:02', 'HLA-A*68:23', 'HLA-A*69:01', 'HLA-A*80:01', 'HLA-B*07:02', 'HLA-B*08:01', - 'HLA-B*08:02', 'HLA-B*08:03', 'HLA-B*14:02', 'HLA-B*15:01', 'HLA-B*15:02', 'HLA-B*15:03', 'HLA-B*15:09', 'HLA-B*15:17', 'HLA-B*15:42', - 'HLA-B*18:01', 'HLA-B*27:03', 'HLA-B*27:05', 'HLA-B*27:20', 'HLA-B*35:01', 'HLA-B*35:03', 'HLA-B*38:01', 'HLA-B*39:01', 'HLA-B*40:01', - 'HLA-B*40:02', 'HLA-B*40:13', 'HLA-B*42:01', 'HLA-B*44:02', 'HLA-B*44:03', 'HLA-B*45:01', 'HLA-B*45:06', 'HLA-B*46:01', 'HLA-B*48:01', - 'HLA-B*51:01', 'HLA-B*53:01', 'HLA-B*54:01', 'HLA-B*57:01', 'HLA-B*58:01', 'HLA-B*58:02', 'HLA-B*73:01', 'HLA-B*83:01', 'HLA-C*03:03', - 'HLA-C*04:01', 'HLA-C*05:01', 'HLA-C*06:02', 'HLA-C*07:01', 'HLA-C*07:02', 'HLA-C*08:02', 'HLA-C*12:03', 'HLA-C*14:02', 'HLA-C*15:02', + ['HLA-A*01:01', 'HLA-A*02:01', 'HLA-A*02:02', 'HLA-A*02:03', 'HLA-A*02:06', 'HLA-A*02:11', 'HLA-A*02:12', + 'HLA-A*02:16', 'HLA-A*02:17', + 'HLA-A*02:19', 'HLA-A*02:50', 'HLA-A*03:01', 'HLA-A*11:01', 'HLA-A*23:01', 'HLA-A*24:02', 'HLA-A*24:03', + 'HLA-A*25:01', 'HLA-A*26:01', + 'HLA-A*26:02', 'HLA-A*26:03', 'HLA-A*29:02', 'HLA-A*30:01', 'HLA-A*30:02', 'HLA-A*31:01', 'HLA-A*32:01', + 'HLA-A*32:07', 'HLA-A*32:15', + 'HLA-A*33:01', 'HLA-A*66:01', 'HLA-A*68:01', 'HLA-A*68:02', 'HLA-A*68:23', 'HLA-A*69:01', 'HLA-A*80:01', + 'HLA-B*07:02', 'HLA-B*08:01', + 'HLA-B*08:02', 'HLA-B*08:03', 'HLA-B*14:02', 'HLA-B*15:01', 'HLA-B*15:02', 'HLA-B*15:03', 'HLA-B*15:09', + 'HLA-B*15:17', 'HLA-B*15:42', + 'HLA-B*18:01', 'HLA-B*27:03', 'HLA-B*27:05', 'HLA-B*27:20', 'HLA-B*35:01', 'HLA-B*35:03', 'HLA-B*38:01', + 'HLA-B*39:01', 'HLA-B*40:01', + 'HLA-B*40:02', 'HLA-B*40:13', 'HLA-B*42:01', 'HLA-B*44:02', 'HLA-B*44:03', 'HLA-B*45:01', 'HLA-B*45:06', + 'HLA-B*46:01', 'HLA-B*48:01', + 'HLA-B*51:01', 'HLA-B*53:01', 'HLA-B*54:01', 'HLA-B*57:01', 'HLA-B*58:01', 'HLA-B*58:02', 'HLA-B*73:01', + 'HLA-B*83:01', 'HLA-C*03:03', + 'HLA-C*04:01', 'HLA-C*05:01', 'HLA-C*06:02', 'HLA-C*07:01', 'HLA-C*07:02', 'HLA-C*08:02', 'HLA-C*12:03', + 'HLA-C*14:02', 'HLA-C*15:02', 'E*01:01', 'E*01:03']) __supported_length = frozenset([8, 9, 10, 11]) __name = "smmpmbec" @@ -475,7 +511,7 @@ def convert_alleles(self, alleles): :return: Returns a string representation of the input :class:`~Fred2.Core.Allele.Allele` :rtype: list(str) """ - return ["%s_%s_%s"%(a.locus, a.supertype, a.subtype) for a in alleles] + return ["%s_%s_%s" % (a.locus, a.supertype, a.subtype) for a in alleles] def predict(self, peptides, alleles=None, **kwargs): """ @@ -506,12 +542,18 @@ class ARB(APSSMEpitopePrediction): """ __alleles = frozenset( - ['HLA-A*01:01', 'HLA-A*02:01', 'HLA-A*02:02', 'HLA-A*02:03', 'HLA-A*02:06', 'HLA-A*02:11', 'HLA-A*02:12', 'HLA-A*02:16', 'HLA-A*02:19', - 'HLA-A*02:50', 'HLA-A*03:01', 'HLA-A*11:01', 'HLA-A*23:01', 'HLA-A*24:02', 'HLA-A*24:03', 'HLA-A*25:01', 'HLA-A*26:01', 'HLA-A*26:02', - 'HLA-A*26:03', 'HLA-A*29:02', 'HLA-A*30:01', 'HLA-A*30:02', 'HLA-A*31:01', 'HLA-A*32:01', 'HLA-A*33:01', 'HLA-A*68:01', 'HLA-A*68:02', - 'HLA-A*69:01', 'HLA-A*80:01', 'HLA-B*07:02', 'HLA-B*08:01', 'HLA-B*08:02', 'HLA-B*08:03', 'HLA-B*15:01', 'HLA-B*15:02', 'HLA-B*15:03', - 'HLA-B*15:09', 'HLA-B*15:17', 'HLA-B*18:01', 'HLA-B*27:03', 'HLA-B*27:05', 'HLA-B*35:01', 'HLA-B*38:01', 'HLA-B*39:01', 'HLA-B*40:01', - 'HLA-B*40:02', 'HLA-B*44:02', 'HLA-B*44:03', 'HLA-B*45:01', 'HLA-B*46:01', 'HLA-B*48:01', 'HLA-B*51:01', 'HLA-B*53:01', 'HLA-B*54:01', + ['HLA-A*01:01', 'HLA-A*02:01', 'HLA-A*02:02', 'HLA-A*02:03', 'HLA-A*02:06', 'HLA-A*02:11', 'HLA-A*02:12', + 'HLA-A*02:16', 'HLA-A*02:19', + 'HLA-A*02:50', 'HLA-A*03:01', 'HLA-A*11:01', 'HLA-A*23:01', 'HLA-A*24:02', 'HLA-A*24:03', 'HLA-A*25:01', + 'HLA-A*26:01', 'HLA-A*26:02', + 'HLA-A*26:03', 'HLA-A*29:02', 'HLA-A*30:01', 'HLA-A*30:02', 'HLA-A*31:01', 'HLA-A*32:01', 'HLA-A*33:01', + 'HLA-A*68:01', 'HLA-A*68:02', + 'HLA-A*69:01', 'HLA-A*80:01', 'HLA-B*07:02', 'HLA-B*08:01', 'HLA-B*08:02', 'HLA-B*08:03', 'HLA-B*15:01', + 'HLA-B*15:02', 'HLA-B*15:03', + 'HLA-B*15:09', 'HLA-B*15:17', 'HLA-B*18:01', 'HLA-B*27:03', 'HLA-B*27:05', 'HLA-B*35:01', 'HLA-B*38:01', + 'HLA-B*39:01', 'HLA-B*40:01', + 'HLA-B*40:02', 'HLA-B*44:02', 'HLA-B*44:03', 'HLA-B*45:01', 'HLA-B*46:01', 'HLA-B*48:01', 'HLA-B*51:01', + 'HLA-B*53:01', 'HLA-B*54:01', 'HLA-B*57:01', 'HLA-B*58:01', 'HLA-B*73:01']) __supported_length = frozenset([8, 9, 10, 11]) __name = "arb" @@ -551,7 +593,7 @@ def convert_alleles(self, alleles): :return: Returns a string representation of the input :class:`~Fred2.Core.Allele.Allele` :rtype: list(str) """ - return ["%s_%s%s"%(a.locus, a.supertype, a.subtype) for a in alleles] + return ["%s_%s%s" % (a.locus, a.supertype, a.subtype) for a in alleles] def predict(self, peptides, alleles=None, **kwargs): """ @@ -566,13 +608,15 @@ def predict(self, peptides, alleles=None, **kwargs): :return: Returns a :class:`~Fred2.Core.Result.EpitopePredictionResult` object with the prediction results :rtype: :class:`~Fred2.Core.Result.EpitopePredictionResult` """ + def __load_allele_model(allele, length): - allele_model = "%s_%i"%(allele, length) - return getattr(__import__("Fred2.Data.pssms."+self.name+".mat."+allele_model, fromlist=[allele_model]), - allele_model) + allele_model = "%s_%i" % (allele, length) + return getattr( + __import__("Fred2.Data.pssms." + self.name + ".mat." + allele_model, fromlist=[allele_model]), + allele_model) if isinstance(peptides, Peptide): - pep_seqs = {str(peptides):peptides} + pep_seqs = {str(peptides): peptides} else: pep_seqs = {} for p in peptides: @@ -582,33 +626,33 @@ def __load_allele_model(allele, length): if alleles is None: al = [Allele(a) for a in self.supportedAlleles] - alleles_string = {conv_a:a for conv_a, a in itertools.izip(self.convert_alleles(al), al)} + alleles_string = {conv_a: a for conv_a, a in itertools.izip(self.convert_alleles(al), al)} else: if isinstance(alleles, Allele): alleles = [alleles] if any(not isinstance(p, Allele) for p in alleles): raise ValueError("Input is not of type Allele") - alleles_string = {conv_a:a for conv_a, a in itertools.izip(self.convert_alleles(alleles), alleles)} + alleles_string = {conv_a: a for conv_a, a in itertools.izip(self.convert_alleles(alleles), alleles)} result = {} for length, peps in itertools.groupby(pep_seqs.iterkeys(), key=lambda x: len(x)): peps = list(peps) - #dynamicaly import prediction PSSMS for alleles and predict + # dynamicaly import prediction PSSMS for alleles and predict if length not in self.supportedLength: - warnings.warn("Peptide length of %i is not supported by %s"%(length, self.name)) + warnings.warn("Peptide length of %i is not supported by %s" % (length, self.name)) continue for a in alleles_string.keys(): try: pssm = __load_allele_model(a, length) except ImportError: - warnings.warn("No model found for %s with length %i"%(alleles_string[a], length)) + warnings.warn("No model found for %s with length %i" % (alleles_string[a], length)) continue result[alleles_string[a]] = {} ##here is the prediction and result object missing## for p in peps: - score = sum(pssm[i].get(p[i], 0.0) for i in xrange(length))+pssm.get(-1, {}).get("con", 0) + score = sum(pssm[i].get(p[i], 0.0) for i in xrange(length)) + pssm.get(-1, {}).get("con", 0) score /= -length score -= pssm[-1]["intercept"] score /= pssm[-1]["slope"] @@ -618,11 +662,11 @@ def __load_allele_model(allele, length): elif score > 1e6: score = 1e6 result[alleles_string[a]][pep_seqs[p]] = score - #print a, score, result + # print a, score, result if not result: - raise ValueError("No predictions could be made with " +self.name+" for given input. Check your" - "epitope length and HLA allele combination.") + raise ValueError("No predictions could be made with " + self.name + " for given input. Check your" + "epitope length and HLA allele combination.") df_result = EpitopePredictionResult.from_dict(result) df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], @@ -641,8 +685,10 @@ class ComblibSidney2008(APSSMEpitopePrediction): Immunome Res 4:2. """ - __alleles = frozenset(['HLA-B*35:01', 'HLA-B*51:01', 'HLA-B*54:01', 'HLA-B*58:02', 'HLA-A*02:01', 'HLA-A*68:02', 'HLA-B*27:05', 'HLA-B*08:01', 'HLA-B*07:02', - 'HLA-A*32:01', 'HLA-B*53:01', 'HLA-A*30:01', 'HLA-B*15:03', 'HLA-B*15:01', 'HLA-B*58:01']) + __alleles = frozenset( + ['HLA-B*35:01', 'HLA-B*51:01', 'HLA-B*54:01', 'HLA-B*58:02', 'HLA-A*02:01', 'HLA-A*68:02', 'HLA-B*27:05', + 'HLA-B*08:01', 'HLA-B*07:02', + 'HLA-A*32:01', 'HLA-B*53:01', 'HLA-A*30:01', 'HLA-B*15:03', 'HLA-B*15:01', 'HLA-B*58:01']) __supported_length = frozenset([9]) __name = "comblibsidney" __version = "1.0" @@ -681,7 +727,7 @@ def convert_alleles(self, alleles): :return: Returns a string representation of the input :class:`~Fred2.Core.Allele.Allele` :rtype: list(str) """ - return ["%s_%s%s"%(a.locus, a.supertype, a.subtype) for a in alleles] + return ["%s_%s%s" % (a.locus, a.supertype, a.subtype) for a in alleles] def predict(self, peptides, alleles=None, **kwargs): """ @@ -698,7 +744,7 @@ def predict(self, peptides, alleles=None, **kwargs): """ return EpitopePredictionResult( super(ComblibSidney2008, self).predict(peptides, - alleles=alleles, **kwargs).applymap(lambda x: math.pow(10, x))) + alleles=alleles, **kwargs).applymap(lambda x: math.pow(10, x))) class TEPITOPEpan(APSSMEpitopePrediction): @@ -713,110 +759,214 @@ class TEPITOPEpan(APSSMEpitopePrediction): """ __alleles = frozenset( - ['HLA-DRB1*01:01', 'HLA-DRB1*01:02', 'HLA-DRB1*01:03', 'HLA-DRB1*01:04', 'HLA-DRB1*01:05', 'HLA-DRB1*01:06', 'HLA-DRB1*01:07', - 'HLA-DRB1*01:08', 'HLA-DRB1*01:09', 'HLA-DRB1*01:10', 'HLA-DRB1*01:11', 'HLA-DRB1*01:12', 'HLA-DRB1*01:13', 'HLA-DRB1*01:14', - 'HLA-DRB1*01:15', 'HLA-DRB1*01:16', 'HLA-DRB1*01:17', 'HLA-DRB1*01:18', 'HLA-DRB1*01:19', 'HLA-DRB1*01:20', 'HLA-DRB1*01:21', - 'HLA-DRB1*01:22', 'HLA-DRB1*01:23', 'HLA-DRB1*01:24', 'HLA-DRB1*01:25', 'HLA-DRB1*01:26', 'HLA-DRB1*01:27', 'HLA-DRB1*01:28', - 'HLA-DRB1*01:29', 'HLA-DRB1*01:30', 'HLA-DRB1*01:31', 'HLA-DRB1*01:32', 'HLA-DRB1*01:34', 'HLA-DRB1*01:35', 'HLA-DRB1*01:36', - 'HLA-DRB1*03:01', 'HLA-DRB1*03:02', 'HLA-DRB1*03:03', 'HLA-DRB1*03:04', 'HLA-DRB1*03:05', 'HLA-DRB1*03:06', 'HLA-DRB1*03:07', - 'HLA-DRB1*03:08', 'HLA-DRB1*03:09', 'HLA-DRB1*03:10', 'HLA-DRB1*03:11', 'HLA-DRB1*03:12', 'HLA-DRB1*03:13', 'HLA-DRB1*03:14', - 'HLA-DRB1*03:15', 'HLA-DRB1*03:16', 'HLA-DRB1*03:17', 'HLA-DRB1*03:18', 'HLA-DRB1*03:19', 'HLA-DRB1*03:20', 'HLA-DRB1*03:21', - 'HLA-DRB1*03:22', 'HLA-DRB1*03:23', 'HLA-DRB1*03:24', 'HLA-DRB1*03:25', 'HLA-DRB1*03:26', 'HLA-DRB1*03:27', 'HLA-DRB1*03:28', - 'HLA-DRB1*03:29', 'HLA-DRB1*03:30', 'HLA-DRB1*03:31', 'HLA-DRB1*03:32', 'HLA-DRB1*03:33', 'HLA-DRB1*03:34', 'HLA-DRB1*03:35', - 'HLA-DRB1*03:36', 'HLA-DRB1*03:37', 'HLA-DRB1*03:38', 'HLA-DRB1*03:39', 'HLA-DRB1*03:40', 'HLA-DRB1*03:41', 'HLA-DRB1*03:42', - 'HLA-DRB1*03:43', 'HLA-DRB1*03:44', 'HLA-DRB1*03:45', 'HLA-DRB1*03:46', 'HLA-DRB1*03:47', 'HLA-DRB1*03:48', 'HLA-DRB1*03:49', - 'HLA-DRB1*03:50', 'HLA-DRB1*03:51', 'HLA-DRB1*03:52', 'HLA-DRB1*03:53', 'HLA-DRB1*03:54', 'HLA-DRB1*03:55', 'HLA-DRB1*03:56', - 'HLA-DRB1*03:57', 'HLA-DRB1*03:58', 'HLA-DRB1*03:59', 'HLA-DRB1*03:60', 'HLA-DRB1*03:61', 'HLA-DRB1*03:62', 'HLA-DRB1*03:63', - 'HLA-DRB1*03:64', 'HLA-DRB1*04:01', 'HLA-DRB1*04:02', 'HLA-DRB1*04:03', 'HLA-DRB1*04:04', 'HLA-DRB1*04:05', 'HLA-DRB1*04:06', - 'HLA-DRB1*04:07', 'HLA-DRB1*04:08', 'HLA-DRB1*04:09', 'HLA-DRB1*04:10', 'HLA-DRB1*04:11', 'HLA-DRB1*04:12', 'HLA-DRB1*04:13', - 'HLA-DRB1*04:14', 'HLA-DRB1*04:15', 'HLA-DRB1*04:16', 'HLA-DRB1*04:17', 'HLA-DRB1*04:18', 'HLA-DRB1*04:19', 'HLA-DRB1*04:20', - 'HLA-DRB1*04:21', 'HLA-DRB1*04:22', 'HLA-DRB1*04:23', 'HLA-DRB1*04:24', 'HLA-DRB1*04:25', 'HLA-DRB1*04:26', 'HLA-DRB1*04:27', - 'HLA-DRB1*04:28', 'HLA-DRB1*04:29', 'HLA-DRB1*04:30', 'HLA-DRB1*04:31', 'HLA-DRB1*04:32', 'HLA-DRB1*04:33', 'HLA-DRB1*04:34', - 'HLA-DRB1*04:35', 'HLA-DRB1*04:36', 'HLA-DRB1*04:37', 'HLA-DRB1*04:38', 'HLA-DRB1*04:39', 'HLA-DRB1*04:40', 'HLA-DRB1*04:41', - 'HLA-DRB1*04:42', 'HLA-DRB1*04:43', 'HLA-DRB1*04:44', 'HLA-DRB1*04:45', 'HLA-DRB1*04:46', 'HLA-DRB1*04:47', 'HLA-DRB1*04:48', - 'HLA-DRB1*04:49', 'HLA-DRB1*04:50', 'HLA-DRB1*04:51', 'HLA-DRB1*04:52', 'HLA-DRB1*04:53', 'HLA-DRB1*04:54', 'HLA-DRB1*04:55', - 'HLA-DRB1*04:56', 'HLA-DRB1*04:57', 'HLA-DRB1*04:58', 'HLA-DRB1*04:59', 'HLA-DRB1*04:60', 'HLA-DRB1*04:61', 'HLA-DRB1*04:62', - 'HLA-DRB1*04:63', 'HLA-DRB1*04:64', 'HLA-DRB1*04:65', 'HLA-DRB1*04:66', 'HLA-DRB1*04:67', 'HLA-DRB1*04:68', 'HLA-DRB1*04:69', - 'HLA-DRB1*04:70', 'HLA-DRB1*04:71', 'HLA-DRB1*04:72', 'HLA-DRB1*04:73', 'HLA-DRB1*04:74', 'HLA-DRB1*04:75', 'HLA-DRB1*04:76', - 'HLA-DRB1*04:77', 'HLA-DRB1*04:78', 'HLA-DRB1*04:79', 'HLA-DRB1*04:80', 'HLA-DRB1*04:82', 'HLA-DRB1*04:83', 'HLA-DRB1*04:84', - 'HLA-DRB1*04:85', 'HLA-DRB1*04:86', 'HLA-DRB1*04:87', 'HLA-DRB1*04:88', 'HLA-DRB1*04:89', 'HLA-DRB1*04:90', 'HLA-DRB1*04:91', - 'HLA-DRB1*04:92', 'HLA-DRB1*04:93', 'HLA-DRB1*04:95', 'HLA-DRB1*04:96', 'HLA-DRB1*04:97', 'HLA-DRB1*04:98', 'HLA-DRB1*07:01', - 'HLA-DRB1*07:03', 'HLA-DRB1*07:04', 'HLA-DRB1*07:05', 'HLA-DRB1*07:06', 'HLA-DRB1*07:07', 'HLA-DRB1*07:08', 'HLA-DRB1*07:09', - 'HLA-DRB1*07:11', 'HLA-DRB1*07:12', 'HLA-DRB1*07:13', 'HLA-DRB1*07:14', 'HLA-DRB1*07:15', 'HLA-DRB1*07:16', 'HLA-DRB1*07:17', - 'HLA-DRB1*07:18', 'HLA-DRB1*07:19', 'HLA-DRB1*07:20', 'HLA-DRB1*07:21', 'HLA-DRB1*08:01', 'HLA-DRB1*08:02', 'HLA-DRB1*08:03', - 'HLA-DRB1*08:04', 'HLA-DRB1*08:05', 'HLA-DRB1*08:06', 'HLA-DRB1*08:07', 'HLA-DRB1*08:08', 'HLA-DRB1*08:09', 'HLA-DRB1*08:10', - 'HLA-DRB1*08:11', 'HLA-DRB1*08:12', 'HLA-DRB1*08:13', 'HLA-DRB1*08:14', 'HLA-DRB1*08:15', 'HLA-DRB1*08:16', 'HLA-DRB1*08:17', - 'HLA-DRB1*08:18', 'HLA-DRB1*08:19', 'HLA-DRB1*08:20', 'HLA-DRB1*08:21', 'HLA-DRB1*08:22', 'HLA-DRB1*08:23', 'HLA-DRB1*08:24', - 'HLA-DRB1*08:25', 'HLA-DRB1*08:26', 'HLA-DRB1*08:27', 'HLA-DRB1*08:28', 'HLA-DRB1*08:29', 'HLA-DRB1*08:30', 'HLA-DRB1*08:31', - 'HLA-DRB1*08:32', 'HLA-DRB1*08:33', 'HLA-DRB1*08:34', 'HLA-DRB1*08:35', 'HLA-DRB1*08:36', 'HLA-DRB1*08:37', 'HLA-DRB1*08:38', - 'HLA-DRB1*08:39', 'HLA-DRB1*08:40', 'HLA-DRB1*08:41', 'HLA-DRB1*08:42', 'HLA-DRB1*08:43', 'HLA-DRB1*08:44', 'HLA-DRB1*08:45', - 'HLA-DRB1*09:01', 'HLA-DRB1*09:02', 'HLA-DRB1*09:03', 'HLA-DRB1*09:04', 'HLA-DRB1*09:05', 'HLA-DRB1*09:06', 'HLA-DRB1*09:07', - 'HLA-DRB1*09:08', 'HLA-DRB1*09:09', 'HLA-DRB1*09:10', 'HLA-DRB1*09:11', 'HLA-DRB1*09:12', 'HLA-DRB1*10:01', 'HLA-DRB1*10:02', - 'HLA-DRB1*10:03', 'HLA-DRB1*11:01', 'HLA-DRB1*11:02', 'HLA-DRB1*11:03', 'HLA-DRB1*11:04', 'HLA-DRB1*11:05', 'HLA-DRB1*11:06', - 'HLA-DRB1*11:07', 'HLA-DRB1*11:08', 'HLA-DRB1*11:09', 'HLA-DRB1*11:10', 'HLA-DRB1*11:11', 'HLA-DRB1*11:12', 'HLA-DRB1*11:13', - 'HLA-DRB1*11:14', 'HLA-DRB1*11:15', 'HLA-DRB1*11:16', 'HLA-DRB1*11:17', 'HLA-DRB1*11:18', 'HLA-DRB1*11:19', 'HLA-DRB1*11:20', - 'HLA-DRB1*11:21', 'HLA-DRB1*11:22', 'HLA-DRB1*11:23', 'HLA-DRB1*11:24', 'HLA-DRB1*11:25', 'HLA-DRB1*11:26', 'HLA-DRB1*11:27', - 'HLA-DRB1*11:28', 'HLA-DRB1*11:29', 'HLA-DRB1*11:30', 'HLA-DRB1*11:31', 'HLA-DRB1*11:32', 'HLA-DRB1*11:33', 'HLA-DRB1*11:34', - 'HLA-DRB1*11:35', 'HLA-DRB1*11:36', 'HLA-DRB1*11:37', 'HLA-DRB1*11:38', 'HLA-DRB1*11:39', 'HLA-DRB1*11:40', 'HLA-DRB1*11:41', - 'HLA-DRB1*11:42', 'HLA-DRB1*11:43', 'HLA-DRB1*11:44', 'HLA-DRB1*11:45', 'HLA-DRB1*11:46', 'HLA-DRB1*11:47', 'HLA-DRB1*11:48', - 'HLA-DRB1*11:49', 'HLA-DRB1*11:50', 'HLA-DRB1*11:51', 'HLA-DRB1*11:52', 'HLA-DRB1*11:53', 'HLA-DRB1*11:54', 'HLA-DRB1*11:55', - 'HLA-DRB1*11:56', 'HLA-DRB1*11:57', 'HLA-DRB1*11:58', 'HLA-DRB1*11:59', 'HLA-DRB1*11:60', 'HLA-DRB1*11:61', 'HLA-DRB1*11:62', - 'HLA-DRB1*11:63', 'HLA-DRB1*11:64', 'HLA-DRB1*11:65', 'HLA-DRB1*11:66', 'HLA-DRB1*11:67', 'HLA-DRB1*11:68', 'HLA-DRB1*11:69', - 'HLA-DRB1*11:70', 'HLA-DRB1*11:72', 'HLA-DRB1*11:73', 'HLA-DRB1*11:74', 'HLA-DRB1*11:75', 'HLA-DRB1*11:76', 'HLA-DRB1*11:77', - 'HLA-DRB1*11:78', 'HLA-DRB1*11:79', 'HLA-DRB1*11:80', 'HLA-DRB1*11:81', 'HLA-DRB1*11:82', 'HLA-DRB1*11:83', 'HLA-DRB1*11:84', - 'HLA-DRB1*11:85', 'HLA-DRB1*11:86', 'HLA-DRB1*11:87', 'HLA-DRB1*11:88', 'HLA-DRB1*11:89', 'HLA-DRB1*11:90', 'HLA-DRB1*11:91', - 'HLA-DRB1*11:92', 'HLA-DRB1*11:93', 'HLA-DRB1*11:94', 'HLA-DRB1*11:95', 'HLA-DRB1*11:96', 'HLA-DRB1*11:97', 'HLA-DRB1*11:98', - 'HLA-DRB1*11:99', 'HLA-DRB1*12:01', 'HLA-DRB1*12:02', 'HLA-DRB1*12:03', 'HLA-DRB1*12:04', 'HLA-DRB1*12:05', 'HLA-DRB1*12:06', - 'HLA-DRB1*12:07', 'HLA-DRB1*12:08', 'HLA-DRB1*12:09', 'HLA-DRB1*12:10', 'HLA-DRB1*12:11', 'HLA-DRB1*12:12', 'HLA-DRB1*12:13', - 'HLA-DRB1*12:14', 'HLA-DRB1*12:15', 'HLA-DRB1*12:16', 'HLA-DRB1*12:17', 'HLA-DRB1*12:18', 'HLA-DRB1*12:19', 'HLA-DRB1*12:20', - 'HLA-DRB1*12:21', 'HLA-DRB1*12:22', 'HLA-DRB1*12:23', 'HLA-DRB1*12:25', 'HLA-DRB1*12:26', 'HLA-DRB1*12:27', 'HLA-DRB1*13:01', - 'HLA-DRB1*13:02', 'HLA-DRB1*13:03', 'HLA-DRB1*13:04', 'HLA-DRB1*13:05', 'HLA-DRB1*13:06', 'HLA-DRB1*13:07', 'HLA-DRB1*13:08', - 'HLA-DRB1*13:09', 'HLA-DRB1*13:10', 'HLA-DRB1*13:11', 'HLA-DRB1*13:12', 'HLA-DRB1*13:13', 'HLA-DRB1*13:14', 'HLA-DRB1*13:15', - 'HLA-DRB1*13:16', 'HLA-DRB1*13:17', 'HLA-DRB1*13:18', 'HLA-DRB1*13:19', 'HLA-DRB1*13:20', 'HLA-DRB1*13:21', 'HLA-DRB1*13:22', - 'HLA-DRB1*13:23', 'HLA-DRB1*13:24', 'HLA-DRB1*13:25', 'HLA-DRB1*13:26', 'HLA-DRB1*13:27', 'HLA-DRB1*13:28', 'HLA-DRB1*13:29', - 'HLA-DRB1*13:30', 'HLA-DRB1*13:31', 'HLA-DRB1*13:32', 'HLA-DRB1*13:33', 'HLA-DRB1*13:34', 'HLA-DRB1*13:35', 'HLA-DRB1*13:36', - 'HLA-DRB1*13:37', 'HLA-DRB1*13:38', 'HLA-DRB1*13:39', 'HLA-DRB1*13:40', 'HLA-DRB1*13:41', 'HLA-DRB1*13:42', 'HLA-DRB1*13:43', - 'HLA-DRB1*13:44', 'HLA-DRB1*13:45', 'HLA-DRB1*13:46', 'HLA-DRB1*13:47', 'HLA-DRB1*13:48', 'HLA-DRB1*13:49', 'HLA-DRB1*13:50', - 'HLA-DRB1*13:51', 'HLA-DRB1*13:52', 'HLA-DRB1*13:53', 'HLA-DRB1*13:54', 'HLA-DRB1*13:55', 'HLA-DRB1*13:56', 'HLA-DRB1*13:57', - 'HLA-DRB1*13:58', 'HLA-DRB1*13:59', 'HLA-DRB1*13:60', 'HLA-DRB1*13:61', 'HLA-DRB1*13:62', 'HLA-DRB1*13:63', 'HLA-DRB1*13:64', - 'HLA-DRB1*13:65', 'HLA-DRB1*13:66', 'HLA-DRB1*13:67', 'HLA-DRB1*13:68', 'HLA-DRB1*13:69', 'HLA-DRB1*13:70', 'HLA-DRB1*13:71', - 'HLA-DRB1*13:72', 'HLA-DRB1*13:73', 'HLA-DRB1*13:74', 'HLA-DRB1*13:75', 'HLA-DRB1*13:76', 'HLA-DRB1*13:77', 'HLA-DRB1*13:78', - 'HLA-DRB1*13:79', 'HLA-DRB1*13:80', 'HLA-DRB1*13:81', 'HLA-DRB1*13:82', 'HLA-DRB1*13:83', 'HLA-DRB1*13:84', 'HLA-DRB1*13:85', - 'HLA-DRB1*13:86', 'HLA-DRB1*13:87', 'HLA-DRB1*13:88', 'HLA-DRB1*13:89', 'HLA-DRB1*13:90', 'HLA-DRB1*13:91', 'HLA-DRB1*13:92', - 'HLA-DRB1*13:93', 'HLA-DRB1*13:94', 'HLA-DRB1*13:95', 'HLA-DRB1*13:96', 'HLA-DRB1*13:97', 'HLA-DRB1*13:98', 'HLA-DRB1*13:99', - 'HLA-DRB1*14:01', 'HLA-DRB1*14:02', 'HLA-DRB1*14:03', 'HLA-DRB1*14:04', 'HLA-DRB1*14:05', 'HLA-DRB1*14:06', 'HLA-DRB1*14:07', - 'HLA-DRB1*14:08', 'HLA-DRB1*14:09', 'HLA-DRB1*14:10', 'HLA-DRB1*14:11', 'HLA-DRB1*14:12', 'HLA-DRB1*14:13', 'HLA-DRB1*14:14', - 'HLA-DRB1*14:15', 'HLA-DRB1*14:16', 'HLA-DRB1*14:17', 'HLA-DRB1*14:18', 'HLA-DRB1*14:19', 'HLA-DRB1*14:20', 'HLA-DRB1*14:21', - 'HLA-DRB1*14:22', 'HLA-DRB1*14:23', 'HLA-DRB1*14:24', 'HLA-DRB1*14:25', 'HLA-DRB1*14:26', 'HLA-DRB1*14:27', 'HLA-DRB1*14:28', - 'HLA-DRB1*14:29', 'HLA-DRB1*14:30', 'HLA-DRB1*14:31', 'HLA-DRB1*14:32', 'HLA-DRB1*14:33', 'HLA-DRB1*14:34', 'HLA-DRB1*14:35', - 'HLA-DRB1*14:36', 'HLA-DRB1*14:37', 'HLA-DRB1*14:38', 'HLA-DRB1*14:39', 'HLA-DRB1*14:40', 'HLA-DRB1*14:41', 'HLA-DRB1*14:42', - 'HLA-DRB1*14:43', 'HLA-DRB1*14:44', 'HLA-DRB1*14:45', 'HLA-DRB1*14:46', 'HLA-DRB1*14:47', 'HLA-DRB1*14:48', 'HLA-DRB1*14:49', - 'HLA-DRB1*14:50', 'HLA-DRB1*14:51', 'HLA-DRB1*14:52', 'HLA-DRB1*14:53', 'HLA-DRB1*14:54', 'HLA-DRB1*14:55', 'HLA-DRB1*14:56', - 'HLA-DRB1*14:57', 'HLA-DRB1*14:58', 'HLA-DRB1*14:59', 'HLA-DRB1*14:60', 'HLA-DRB1*14:61', 'HLA-DRB1*14:62', 'HLA-DRB1*14:63', - 'HLA-DRB1*14:64', 'HLA-DRB1*14:65', 'HLA-DRB1*14:67', 'HLA-DRB1*14:68', 'HLA-DRB1*14:69', 'HLA-DRB1*14:70', 'HLA-DRB1*14:71', - 'HLA-DRB1*14:72', 'HLA-DRB1*14:73', 'HLA-DRB1*14:74', 'HLA-DRB1*14:75', 'HLA-DRB1*14:76', 'HLA-DRB1*14:77', 'HLA-DRB1*14:78', - 'HLA-DRB1*14:79', 'HLA-DRB1*14:80', 'HLA-DRB1*14:81', 'HLA-DRB1*14:82', 'HLA-DRB1*14:83', 'HLA-DRB1*14:84', 'HLA-DRB1*14:85', - 'HLA-DRB1*14:86', 'HLA-DRB1*14:87', 'HLA-DRB1*14:88', 'HLA-DRB1*14:89', 'HLA-DRB1*14:90', 'HLA-DRB1*14:91', 'HLA-DRB1*14:93', - 'HLA-DRB1*14:94', 'HLA-DRB1*14:95', 'HLA-DRB1*14:96', 'HLA-DRB1*14:97', 'HLA-DRB1*14:98', 'HLA-DRB1*14:99', 'HLA-DRB1*15:01', - 'HLA-DRB1*15:02', 'HLA-DRB1*15:03', 'HLA-DRB1*15:04', 'HLA-DRB1*15:05', 'HLA-DRB1*15:06', 'HLA-DRB1*15:07', 'HLA-DRB1*15:08', - 'HLA-DRB1*15:09', 'HLA-DRB1*15:10', 'HLA-DRB1*15:11', 'HLA-DRB1*15:12', 'HLA-DRB1*15:13', 'HLA-DRB1*15:14', 'HLA-DRB1*15:15', - 'HLA-DRB1*15:16', 'HLA-DRB1*15:18', 'HLA-DRB1*15:19', 'HLA-DRB1*15:20', 'HLA-DRB1*15:21', 'HLA-DRB1*15:22', 'HLA-DRB1*15:23', - 'HLA-DRB1*15:24', 'HLA-DRB1*15:25', 'HLA-DRB1*15:26', 'HLA-DRB1*15:27', 'HLA-DRB1*15:28', 'HLA-DRB1*15:29', 'HLA-DRB1*15:30', - 'HLA-DRB1*15:31', 'HLA-DRB1*15:32', 'HLA-DRB1*15:33', 'HLA-DRB1*15:34', 'HLA-DRB1*15:35', 'HLA-DRB1*15:36', 'HLA-DRB1*15:37', - 'HLA-DRB1*15:38', 'HLA-DRB1*15:39', 'HLA-DRB1*15:40', 'HLA-DRB1*15:41', 'HLA-DRB1*15:42', 'HLA-DRB1*15:43', 'HLA-DRB1*15:44', - 'HLA-DRB1*15:45', 'HLA-DRB1*15:46', 'HLA-DRB1*15:47', 'HLA-DRB1*15:48', 'HLA-DRB1*15:49', 'HLA-DRB1*15:51', 'HLA-DRB1*15:52', - 'HLA-DRB1*15:53', 'HLA-DRB1*15:54', 'HLA-DRB1*15:55', 'HLA-DRB1*15:56', 'HLA-DRB1*15:57', 'HLA-DRB1*16:01', 'HLA-DRB1*16:02', - 'HLA-DRB1*16:03', 'HLA-DRB1*16:04', 'HLA-DRB1*16:05', 'HLA-DRB1*16:07', 'HLA-DRB1*16:08', 'HLA-DRB1*16:09', 'HLA-DRB1*16:10', - 'HLA-DRB1*16:11', 'HLA-DRB1*16:12', 'HLA-DRB1*16:14', 'HLA-DRB1*16:15', 'HLA-DRB1*16:16', 'HLA-DRB1*16:17', 'HLA-DRB1*16:18', - 'HLA-DRB3*01:01', 'HLA-DRB3*01:02', 'HLA-DRB3*01:03', 'HLA-DRB3*01:04', 'HLA-DRB3*01:05', 'HLA-DRB3*01:06', 'HLA-DRB3*01:07', - 'HLA-DRB3*01:08', 'HLA-DRB3*01:09', 'HLA-DRB3*01:10', 'HLA-DRB3*01:11', 'HLA-DRB3*01:12', 'HLA-DRB3*01:13', 'HLA-DRB3*01:14', - 'HLA-DRB3*01:15', 'HLA-DRB3*02:01', 'HLA-DRB3*02:02', 'HLA-DRB3*02:03', 'HLA-DRB3*02:04', 'HLA-DRB3*02:05', 'HLA-DRB3*02:06', - 'HLA-DRB3*02:07', 'HLA-DRB3*02:08', 'HLA-DRB3*02:09', 'HLA-DRB3*02:10', 'HLA-DRB3*02:11', 'HLA-DRB3*02:12', 'HLA-DRB3*02:13', - 'HLA-DRB3*02:14', 'HLA-DRB3*02:15', 'HLA-DRB3*02:16', 'HLA-DRB3*02:17', 'HLA-DRB3*02:18', 'HLA-DRB3*02:19', 'HLA-DRB3*02:20', - 'HLA-DRB3*02:21', 'HLA-DRB3*02:22', 'HLA-DRB3*02:23', 'HLA-DRB3*02:24', 'HLA-DRB3*02:25', 'HLA-DRB3*02:26', 'HLA-DRB3*02:27', - 'HLA-DRB3*02:28', 'HLA-DRB3*03:01', 'HLA-DRB3*03:02', 'HLA-DRB3*03:03', 'HLA-DRB4*01:01', 'HLA-DRB4*01:03', 'HLA-DRB4*01:04', - 'HLA-DRB4*01:05', 'HLA-DRB4*01:06', 'HLA-DRB4*01:07', 'HLA-DRB4*01:08', 'HLA-DRB5*01:01', 'HLA-DRB5*01:02', 'HLA-DRB5*01:04', - 'HLA-DRB5*01:05', 'HLA-DRB5*01:06', 'HLA-DRB5*01:07', 'HLA-DRB5*01:08', 'HLA-DRB5*01:09', 'HLA-DRB5*01:11', 'HLA-DRB5*01:12', + ['HLA-DRB1*01:01', 'HLA-DRB1*01:02', 'HLA-DRB1*01:03', 'HLA-DRB1*01:04', 'HLA-DRB1*01:05', 'HLA-DRB1*01:06', + 'HLA-DRB1*01:07', + 'HLA-DRB1*01:08', 'HLA-DRB1*01:09', 'HLA-DRB1*01:10', 'HLA-DRB1*01:11', 'HLA-DRB1*01:12', 'HLA-DRB1*01:13', + 'HLA-DRB1*01:14', + 'HLA-DRB1*01:15', 'HLA-DRB1*01:16', 'HLA-DRB1*01:17', 'HLA-DRB1*01:18', 'HLA-DRB1*01:19', 'HLA-DRB1*01:20', + 'HLA-DRB1*01:21', + 'HLA-DRB1*01:22', 'HLA-DRB1*01:23', 'HLA-DRB1*01:24', 'HLA-DRB1*01:25', 'HLA-DRB1*01:26', 'HLA-DRB1*01:27', + 'HLA-DRB1*01:28', + 'HLA-DRB1*01:29', 'HLA-DRB1*01:30', 'HLA-DRB1*01:31', 'HLA-DRB1*01:32', 'HLA-DRB1*01:34', 'HLA-DRB1*01:35', + 'HLA-DRB1*01:36', + 'HLA-DRB1*03:01', 'HLA-DRB1*03:02', 'HLA-DRB1*03:03', 'HLA-DRB1*03:04', 'HLA-DRB1*03:05', 'HLA-DRB1*03:06', + 'HLA-DRB1*03:07', + 'HLA-DRB1*03:08', 'HLA-DRB1*03:09', 'HLA-DRB1*03:10', 'HLA-DRB1*03:11', 'HLA-DRB1*03:12', 'HLA-DRB1*03:13', + 'HLA-DRB1*03:14', + 'HLA-DRB1*03:15', 'HLA-DRB1*03:16', 'HLA-DRB1*03:17', 'HLA-DRB1*03:18', 'HLA-DRB1*03:19', 'HLA-DRB1*03:20', + 'HLA-DRB1*03:21', + 'HLA-DRB1*03:22', 'HLA-DRB1*03:23', 'HLA-DRB1*03:24', 'HLA-DRB1*03:25', 'HLA-DRB1*03:26', 'HLA-DRB1*03:27', + 'HLA-DRB1*03:28', + 'HLA-DRB1*03:29', 'HLA-DRB1*03:30', 'HLA-DRB1*03:31', 'HLA-DRB1*03:32', 'HLA-DRB1*03:33', 'HLA-DRB1*03:34', + 'HLA-DRB1*03:35', + 'HLA-DRB1*03:36', 'HLA-DRB1*03:37', 'HLA-DRB1*03:38', 'HLA-DRB1*03:39', 'HLA-DRB1*03:40', 'HLA-DRB1*03:41', + 'HLA-DRB1*03:42', + 'HLA-DRB1*03:43', 'HLA-DRB1*03:44', 'HLA-DRB1*03:45', 'HLA-DRB1*03:46', 'HLA-DRB1*03:47', 'HLA-DRB1*03:48', + 'HLA-DRB1*03:49', + 'HLA-DRB1*03:50', 'HLA-DRB1*03:51', 'HLA-DRB1*03:52', 'HLA-DRB1*03:53', 'HLA-DRB1*03:54', 'HLA-DRB1*03:55', + 'HLA-DRB1*03:56', + 'HLA-DRB1*03:57', 'HLA-DRB1*03:58', 'HLA-DRB1*03:59', 'HLA-DRB1*03:60', 'HLA-DRB1*03:61', 'HLA-DRB1*03:62', + 'HLA-DRB1*03:63', + 'HLA-DRB1*03:64', 'HLA-DRB1*04:01', 'HLA-DRB1*04:02', 'HLA-DRB1*04:03', 'HLA-DRB1*04:04', 'HLA-DRB1*04:05', + 'HLA-DRB1*04:06', + 'HLA-DRB1*04:07', 'HLA-DRB1*04:08', 'HLA-DRB1*04:09', 'HLA-DRB1*04:10', 'HLA-DRB1*04:11', 'HLA-DRB1*04:12', + 'HLA-DRB1*04:13', + 'HLA-DRB1*04:14', 'HLA-DRB1*04:15', 'HLA-DRB1*04:16', 'HLA-DRB1*04:17', 'HLA-DRB1*04:18', 'HLA-DRB1*04:19', + 'HLA-DRB1*04:20', + 'HLA-DRB1*04:21', 'HLA-DRB1*04:22', 'HLA-DRB1*04:23', 'HLA-DRB1*04:24', 'HLA-DRB1*04:25', 'HLA-DRB1*04:26', + 'HLA-DRB1*04:27', + 'HLA-DRB1*04:28', 'HLA-DRB1*04:29', 'HLA-DRB1*04:30', 'HLA-DRB1*04:31', 'HLA-DRB1*04:32', 'HLA-DRB1*04:33', + 'HLA-DRB1*04:34', + 'HLA-DRB1*04:35', 'HLA-DRB1*04:36', 'HLA-DRB1*04:37', 'HLA-DRB1*04:38', 'HLA-DRB1*04:39', 'HLA-DRB1*04:40', + 'HLA-DRB1*04:41', + 'HLA-DRB1*04:42', 'HLA-DRB1*04:43', 'HLA-DRB1*04:44', 'HLA-DRB1*04:45', 'HLA-DRB1*04:46', 'HLA-DRB1*04:47', + 'HLA-DRB1*04:48', + 'HLA-DRB1*04:49', 'HLA-DRB1*04:50', 'HLA-DRB1*04:51', 'HLA-DRB1*04:52', 'HLA-DRB1*04:53', 'HLA-DRB1*04:54', + 'HLA-DRB1*04:55', + 'HLA-DRB1*04:56', 'HLA-DRB1*04:57', 'HLA-DRB1*04:58', 'HLA-DRB1*04:59', 'HLA-DRB1*04:60', 'HLA-DRB1*04:61', + 'HLA-DRB1*04:62', + 'HLA-DRB1*04:63', 'HLA-DRB1*04:64', 'HLA-DRB1*04:65', 'HLA-DRB1*04:66', 'HLA-DRB1*04:67', 'HLA-DRB1*04:68', + 'HLA-DRB1*04:69', + 'HLA-DRB1*04:70', 'HLA-DRB1*04:71', 'HLA-DRB1*04:72', 'HLA-DRB1*04:73', 'HLA-DRB1*04:74', 'HLA-DRB1*04:75', + 'HLA-DRB1*04:76', + 'HLA-DRB1*04:77', 'HLA-DRB1*04:78', 'HLA-DRB1*04:79', 'HLA-DRB1*04:80', 'HLA-DRB1*04:82', 'HLA-DRB1*04:83', + 'HLA-DRB1*04:84', + 'HLA-DRB1*04:85', 'HLA-DRB1*04:86', 'HLA-DRB1*04:87', 'HLA-DRB1*04:88', 'HLA-DRB1*04:89', 'HLA-DRB1*04:90', + 'HLA-DRB1*04:91', + 'HLA-DRB1*04:92', 'HLA-DRB1*04:93', 'HLA-DRB1*04:95', 'HLA-DRB1*04:96', 'HLA-DRB1*04:97', 'HLA-DRB1*04:98', + 'HLA-DRB1*07:01', + 'HLA-DRB1*07:03', 'HLA-DRB1*07:04', 'HLA-DRB1*07:05', 'HLA-DRB1*07:06', 'HLA-DRB1*07:07', 'HLA-DRB1*07:08', + 'HLA-DRB1*07:09', + 'HLA-DRB1*07:11', 'HLA-DRB1*07:12', 'HLA-DRB1*07:13', 'HLA-DRB1*07:14', 'HLA-DRB1*07:15', 'HLA-DRB1*07:16', + 'HLA-DRB1*07:17', + 'HLA-DRB1*07:18', 'HLA-DRB1*07:19', 'HLA-DRB1*07:20', 'HLA-DRB1*07:21', 'HLA-DRB1*08:01', 'HLA-DRB1*08:02', + 'HLA-DRB1*08:03', + 'HLA-DRB1*08:04', 'HLA-DRB1*08:05', 'HLA-DRB1*08:06', 'HLA-DRB1*08:07', 'HLA-DRB1*08:08', 'HLA-DRB1*08:09', + 'HLA-DRB1*08:10', + 'HLA-DRB1*08:11', 'HLA-DRB1*08:12', 'HLA-DRB1*08:13', 'HLA-DRB1*08:14', 'HLA-DRB1*08:15', 'HLA-DRB1*08:16', + 'HLA-DRB1*08:17', + 'HLA-DRB1*08:18', 'HLA-DRB1*08:19', 'HLA-DRB1*08:20', 'HLA-DRB1*08:21', 'HLA-DRB1*08:22', 'HLA-DRB1*08:23', + 'HLA-DRB1*08:24', + 'HLA-DRB1*08:25', 'HLA-DRB1*08:26', 'HLA-DRB1*08:27', 'HLA-DRB1*08:28', 'HLA-DRB1*08:29', 'HLA-DRB1*08:30', + 'HLA-DRB1*08:31', + 'HLA-DRB1*08:32', 'HLA-DRB1*08:33', 'HLA-DRB1*08:34', 'HLA-DRB1*08:35', 'HLA-DRB1*08:36', 'HLA-DRB1*08:37', + 'HLA-DRB1*08:38', + 'HLA-DRB1*08:39', 'HLA-DRB1*08:40', 'HLA-DRB1*08:41', 'HLA-DRB1*08:42', 'HLA-DRB1*08:43', 'HLA-DRB1*08:44', + 'HLA-DRB1*08:45', + 'HLA-DRB1*09:01', 'HLA-DRB1*09:02', 'HLA-DRB1*09:03', 'HLA-DRB1*09:04', 'HLA-DRB1*09:05', 'HLA-DRB1*09:06', + 'HLA-DRB1*09:07', + 'HLA-DRB1*09:08', 'HLA-DRB1*09:09', 'HLA-DRB1*09:10', 'HLA-DRB1*09:11', 'HLA-DRB1*09:12', 'HLA-DRB1*10:01', + 'HLA-DRB1*10:02', + 'HLA-DRB1*10:03', 'HLA-DRB1*11:01', 'HLA-DRB1*11:02', 'HLA-DRB1*11:03', 'HLA-DRB1*11:04', 'HLA-DRB1*11:05', + 'HLA-DRB1*11:06', + 'HLA-DRB1*11:07', 'HLA-DRB1*11:08', 'HLA-DRB1*11:09', 'HLA-DRB1*11:10', 'HLA-DRB1*11:11', 'HLA-DRB1*11:12', + 'HLA-DRB1*11:13', + 'HLA-DRB1*11:14', 'HLA-DRB1*11:15', 'HLA-DRB1*11:16', 'HLA-DRB1*11:17', 'HLA-DRB1*11:18', 'HLA-DRB1*11:19', + 'HLA-DRB1*11:20', + 'HLA-DRB1*11:21', 'HLA-DRB1*11:22', 'HLA-DRB1*11:23', 'HLA-DRB1*11:24', 'HLA-DRB1*11:25', 'HLA-DRB1*11:26', + 'HLA-DRB1*11:27', + 'HLA-DRB1*11:28', 'HLA-DRB1*11:29', 'HLA-DRB1*11:30', 'HLA-DRB1*11:31', 'HLA-DRB1*11:32', 'HLA-DRB1*11:33', + 'HLA-DRB1*11:34', + 'HLA-DRB1*11:35', 'HLA-DRB1*11:36', 'HLA-DRB1*11:37', 'HLA-DRB1*11:38', 'HLA-DRB1*11:39', 'HLA-DRB1*11:40', + 'HLA-DRB1*11:41', + 'HLA-DRB1*11:42', 'HLA-DRB1*11:43', 'HLA-DRB1*11:44', 'HLA-DRB1*11:45', 'HLA-DRB1*11:46', 'HLA-DRB1*11:47', + 'HLA-DRB1*11:48', + 'HLA-DRB1*11:49', 'HLA-DRB1*11:50', 'HLA-DRB1*11:51', 'HLA-DRB1*11:52', 'HLA-DRB1*11:53', 'HLA-DRB1*11:54', + 'HLA-DRB1*11:55', + 'HLA-DRB1*11:56', 'HLA-DRB1*11:57', 'HLA-DRB1*11:58', 'HLA-DRB1*11:59', 'HLA-DRB1*11:60', 'HLA-DRB1*11:61', + 'HLA-DRB1*11:62', + 'HLA-DRB1*11:63', 'HLA-DRB1*11:64', 'HLA-DRB1*11:65', 'HLA-DRB1*11:66', 'HLA-DRB1*11:67', 'HLA-DRB1*11:68', + 'HLA-DRB1*11:69', + 'HLA-DRB1*11:70', 'HLA-DRB1*11:72', 'HLA-DRB1*11:73', 'HLA-DRB1*11:74', 'HLA-DRB1*11:75', 'HLA-DRB1*11:76', + 'HLA-DRB1*11:77', + 'HLA-DRB1*11:78', 'HLA-DRB1*11:79', 'HLA-DRB1*11:80', 'HLA-DRB1*11:81', 'HLA-DRB1*11:82', 'HLA-DRB1*11:83', + 'HLA-DRB1*11:84', + 'HLA-DRB1*11:85', 'HLA-DRB1*11:86', 'HLA-DRB1*11:87', 'HLA-DRB1*11:88', 'HLA-DRB1*11:89', 'HLA-DRB1*11:90', + 'HLA-DRB1*11:91', + 'HLA-DRB1*11:92', 'HLA-DRB1*11:93', 'HLA-DRB1*11:94', 'HLA-DRB1*11:95', 'HLA-DRB1*11:96', 'HLA-DRB1*11:97', + 'HLA-DRB1*11:98', + 'HLA-DRB1*11:99', 'HLA-DRB1*12:01', 'HLA-DRB1*12:02', 'HLA-DRB1*12:03', 'HLA-DRB1*12:04', 'HLA-DRB1*12:05', + 'HLA-DRB1*12:06', + 'HLA-DRB1*12:07', 'HLA-DRB1*12:08', 'HLA-DRB1*12:09', 'HLA-DRB1*12:10', 'HLA-DRB1*12:11', 'HLA-DRB1*12:12', + 'HLA-DRB1*12:13', + 'HLA-DRB1*12:14', 'HLA-DRB1*12:15', 'HLA-DRB1*12:16', 'HLA-DRB1*12:17', 'HLA-DRB1*12:18', 'HLA-DRB1*12:19', + 'HLA-DRB1*12:20', + 'HLA-DRB1*12:21', 'HLA-DRB1*12:22', 'HLA-DRB1*12:23', 'HLA-DRB1*12:25', 'HLA-DRB1*12:26', 'HLA-DRB1*12:27', + 'HLA-DRB1*13:01', + 'HLA-DRB1*13:02', 'HLA-DRB1*13:03', 'HLA-DRB1*13:04', 'HLA-DRB1*13:05', 'HLA-DRB1*13:06', 'HLA-DRB1*13:07', + 'HLA-DRB1*13:08', + 'HLA-DRB1*13:09', 'HLA-DRB1*13:10', 'HLA-DRB1*13:11', 'HLA-DRB1*13:12', 'HLA-DRB1*13:13', 'HLA-DRB1*13:14', + 'HLA-DRB1*13:15', + 'HLA-DRB1*13:16', 'HLA-DRB1*13:17', 'HLA-DRB1*13:18', 'HLA-DRB1*13:19', 'HLA-DRB1*13:20', 'HLA-DRB1*13:21', + 'HLA-DRB1*13:22', + 'HLA-DRB1*13:23', 'HLA-DRB1*13:24', 'HLA-DRB1*13:25', 'HLA-DRB1*13:26', 'HLA-DRB1*13:27', 'HLA-DRB1*13:28', + 'HLA-DRB1*13:29', + 'HLA-DRB1*13:30', 'HLA-DRB1*13:31', 'HLA-DRB1*13:32', 'HLA-DRB1*13:33', 'HLA-DRB1*13:34', 'HLA-DRB1*13:35', + 'HLA-DRB1*13:36', + 'HLA-DRB1*13:37', 'HLA-DRB1*13:38', 'HLA-DRB1*13:39', 'HLA-DRB1*13:40', 'HLA-DRB1*13:41', 'HLA-DRB1*13:42', + 'HLA-DRB1*13:43', + 'HLA-DRB1*13:44', 'HLA-DRB1*13:45', 'HLA-DRB1*13:46', 'HLA-DRB1*13:47', 'HLA-DRB1*13:48', 'HLA-DRB1*13:49', + 'HLA-DRB1*13:50', + 'HLA-DRB1*13:51', 'HLA-DRB1*13:52', 'HLA-DRB1*13:53', 'HLA-DRB1*13:54', 'HLA-DRB1*13:55', 'HLA-DRB1*13:56', + 'HLA-DRB1*13:57', + 'HLA-DRB1*13:58', 'HLA-DRB1*13:59', 'HLA-DRB1*13:60', 'HLA-DRB1*13:61', 'HLA-DRB1*13:62', 'HLA-DRB1*13:63', + 'HLA-DRB1*13:64', + 'HLA-DRB1*13:65', 'HLA-DRB1*13:66', 'HLA-DRB1*13:67', 'HLA-DRB1*13:68', 'HLA-DRB1*13:69', 'HLA-DRB1*13:70', + 'HLA-DRB1*13:71', + 'HLA-DRB1*13:72', 'HLA-DRB1*13:73', 'HLA-DRB1*13:74', 'HLA-DRB1*13:75', 'HLA-DRB1*13:76', 'HLA-DRB1*13:77', + 'HLA-DRB1*13:78', + 'HLA-DRB1*13:79', 'HLA-DRB1*13:80', 'HLA-DRB1*13:81', 'HLA-DRB1*13:82', 'HLA-DRB1*13:83', 'HLA-DRB1*13:84', + 'HLA-DRB1*13:85', + 'HLA-DRB1*13:86', 'HLA-DRB1*13:87', 'HLA-DRB1*13:88', 'HLA-DRB1*13:89', 'HLA-DRB1*13:90', 'HLA-DRB1*13:91', + 'HLA-DRB1*13:92', + 'HLA-DRB1*13:93', 'HLA-DRB1*13:94', 'HLA-DRB1*13:95', 'HLA-DRB1*13:96', 'HLA-DRB1*13:97', 'HLA-DRB1*13:98', + 'HLA-DRB1*13:99', + 'HLA-DRB1*14:01', 'HLA-DRB1*14:02', 'HLA-DRB1*14:03', 'HLA-DRB1*14:04', 'HLA-DRB1*14:05', 'HLA-DRB1*14:06', + 'HLA-DRB1*14:07', + 'HLA-DRB1*14:08', 'HLA-DRB1*14:09', 'HLA-DRB1*14:10', 'HLA-DRB1*14:11', 'HLA-DRB1*14:12', 'HLA-DRB1*14:13', + 'HLA-DRB1*14:14', + 'HLA-DRB1*14:15', 'HLA-DRB1*14:16', 'HLA-DRB1*14:17', 'HLA-DRB1*14:18', 'HLA-DRB1*14:19', 'HLA-DRB1*14:20', + 'HLA-DRB1*14:21', + 'HLA-DRB1*14:22', 'HLA-DRB1*14:23', 'HLA-DRB1*14:24', 'HLA-DRB1*14:25', 'HLA-DRB1*14:26', 'HLA-DRB1*14:27', + 'HLA-DRB1*14:28', + 'HLA-DRB1*14:29', 'HLA-DRB1*14:30', 'HLA-DRB1*14:31', 'HLA-DRB1*14:32', 'HLA-DRB1*14:33', 'HLA-DRB1*14:34', + 'HLA-DRB1*14:35', + 'HLA-DRB1*14:36', 'HLA-DRB1*14:37', 'HLA-DRB1*14:38', 'HLA-DRB1*14:39', 'HLA-DRB1*14:40', 'HLA-DRB1*14:41', + 'HLA-DRB1*14:42', + 'HLA-DRB1*14:43', 'HLA-DRB1*14:44', 'HLA-DRB1*14:45', 'HLA-DRB1*14:46', 'HLA-DRB1*14:47', 'HLA-DRB1*14:48', + 'HLA-DRB1*14:49', + 'HLA-DRB1*14:50', 'HLA-DRB1*14:51', 'HLA-DRB1*14:52', 'HLA-DRB1*14:53', 'HLA-DRB1*14:54', 'HLA-DRB1*14:55', + 'HLA-DRB1*14:56', + 'HLA-DRB1*14:57', 'HLA-DRB1*14:58', 'HLA-DRB1*14:59', 'HLA-DRB1*14:60', 'HLA-DRB1*14:61', 'HLA-DRB1*14:62', + 'HLA-DRB1*14:63', + 'HLA-DRB1*14:64', 'HLA-DRB1*14:65', 'HLA-DRB1*14:67', 'HLA-DRB1*14:68', 'HLA-DRB1*14:69', 'HLA-DRB1*14:70', + 'HLA-DRB1*14:71', + 'HLA-DRB1*14:72', 'HLA-DRB1*14:73', 'HLA-DRB1*14:74', 'HLA-DRB1*14:75', 'HLA-DRB1*14:76', 'HLA-DRB1*14:77', + 'HLA-DRB1*14:78', + 'HLA-DRB1*14:79', 'HLA-DRB1*14:80', 'HLA-DRB1*14:81', 'HLA-DRB1*14:82', 'HLA-DRB1*14:83', 'HLA-DRB1*14:84', + 'HLA-DRB1*14:85', + 'HLA-DRB1*14:86', 'HLA-DRB1*14:87', 'HLA-DRB1*14:88', 'HLA-DRB1*14:89', 'HLA-DRB1*14:90', 'HLA-DRB1*14:91', + 'HLA-DRB1*14:93', + 'HLA-DRB1*14:94', 'HLA-DRB1*14:95', 'HLA-DRB1*14:96', 'HLA-DRB1*14:97', 'HLA-DRB1*14:98', 'HLA-DRB1*14:99', + 'HLA-DRB1*15:01', + 'HLA-DRB1*15:02', 'HLA-DRB1*15:03', 'HLA-DRB1*15:04', 'HLA-DRB1*15:05', 'HLA-DRB1*15:06', 'HLA-DRB1*15:07', + 'HLA-DRB1*15:08', + 'HLA-DRB1*15:09', 'HLA-DRB1*15:10', 'HLA-DRB1*15:11', 'HLA-DRB1*15:12', 'HLA-DRB1*15:13', 'HLA-DRB1*15:14', + 'HLA-DRB1*15:15', + 'HLA-DRB1*15:16', 'HLA-DRB1*15:18', 'HLA-DRB1*15:19', 'HLA-DRB1*15:20', 'HLA-DRB1*15:21', 'HLA-DRB1*15:22', + 'HLA-DRB1*15:23', + 'HLA-DRB1*15:24', 'HLA-DRB1*15:25', 'HLA-DRB1*15:26', 'HLA-DRB1*15:27', 'HLA-DRB1*15:28', 'HLA-DRB1*15:29', + 'HLA-DRB1*15:30', + 'HLA-DRB1*15:31', 'HLA-DRB1*15:32', 'HLA-DRB1*15:33', 'HLA-DRB1*15:34', 'HLA-DRB1*15:35', 'HLA-DRB1*15:36', + 'HLA-DRB1*15:37', + 'HLA-DRB1*15:38', 'HLA-DRB1*15:39', 'HLA-DRB1*15:40', 'HLA-DRB1*15:41', 'HLA-DRB1*15:42', 'HLA-DRB1*15:43', + 'HLA-DRB1*15:44', + 'HLA-DRB1*15:45', 'HLA-DRB1*15:46', 'HLA-DRB1*15:47', 'HLA-DRB1*15:48', 'HLA-DRB1*15:49', 'HLA-DRB1*15:51', + 'HLA-DRB1*15:52', + 'HLA-DRB1*15:53', 'HLA-DRB1*15:54', 'HLA-DRB1*15:55', 'HLA-DRB1*15:56', 'HLA-DRB1*15:57', 'HLA-DRB1*16:01', + 'HLA-DRB1*16:02', + 'HLA-DRB1*16:03', 'HLA-DRB1*16:04', 'HLA-DRB1*16:05', 'HLA-DRB1*16:07', 'HLA-DRB1*16:08', 'HLA-DRB1*16:09', + 'HLA-DRB1*16:10', + 'HLA-DRB1*16:11', 'HLA-DRB1*16:12', 'HLA-DRB1*16:14', 'HLA-DRB1*16:15', 'HLA-DRB1*16:16', 'HLA-DRB1*16:17', + 'HLA-DRB1*16:18', + 'HLA-DRB3*01:01', 'HLA-DRB3*01:02', 'HLA-DRB3*01:03', 'HLA-DRB3*01:04', 'HLA-DRB3*01:05', 'HLA-DRB3*01:06', + 'HLA-DRB3*01:07', + 'HLA-DRB3*01:08', 'HLA-DRB3*01:09', 'HLA-DRB3*01:10', 'HLA-DRB3*01:11', 'HLA-DRB3*01:12', 'HLA-DRB3*01:13', + 'HLA-DRB3*01:14', + 'HLA-DRB3*01:15', 'HLA-DRB3*02:01', 'HLA-DRB3*02:02', 'HLA-DRB3*02:03', 'HLA-DRB3*02:04', 'HLA-DRB3*02:05', + 'HLA-DRB3*02:06', + 'HLA-DRB3*02:07', 'HLA-DRB3*02:08', 'HLA-DRB3*02:09', 'HLA-DRB3*02:10', 'HLA-DRB3*02:11', 'HLA-DRB3*02:12', + 'HLA-DRB3*02:13', + 'HLA-DRB3*02:14', 'HLA-DRB3*02:15', 'HLA-DRB3*02:16', 'HLA-DRB3*02:17', 'HLA-DRB3*02:18', 'HLA-DRB3*02:19', + 'HLA-DRB3*02:20', + 'HLA-DRB3*02:21', 'HLA-DRB3*02:22', 'HLA-DRB3*02:23', 'HLA-DRB3*02:24', 'HLA-DRB3*02:25', 'HLA-DRB3*02:26', + 'HLA-DRB3*02:27', + 'HLA-DRB3*02:28', 'HLA-DRB3*03:01', 'HLA-DRB3*03:02', 'HLA-DRB3*03:03', 'HLA-DRB4*01:01', 'HLA-DRB4*01:03', + 'HLA-DRB4*01:04', + 'HLA-DRB4*01:05', 'HLA-DRB4*01:06', 'HLA-DRB4*01:07', 'HLA-DRB4*01:08', 'HLA-DRB5*01:01', 'HLA-DRB5*01:02', + 'HLA-DRB5*01:04', + 'HLA-DRB5*01:05', 'HLA-DRB5*01:06', 'HLA-DRB5*01:07', 'HLA-DRB5*01:08', 'HLA-DRB5*01:09', 'HLA-DRB5*01:11', + 'HLA-DRB5*01:12', 'HLA-DRB5*01:13', 'HLA-DRB5*01:14', 'HLA-DRB5*02:02', 'HLA-DRB5*02:03', 'HLA-DRB5*02:04', 'HLA-DRB5*02:05']) __supported_length = frozenset([9]) __name = "tepitopepan" @@ -856,7 +1006,7 @@ def convert_alleles(self, alleles): :return: Returns a string representation of the input :class:`~Fred2.Core.Allele.Allele` :rtype: list(str) """ - return ["%s_%s%s"%(a.locus, a.supertype, a.subtype) for a in alleles] + return ["%s_%s%s" % (a.locus, a.supertype, a.subtype) for a in alleles] class CalisImm(APSSMEpitopePrediction): @@ -871,11 +1021,14 @@ class CalisImm(APSSMEpitopePrediction): """ __alleles = frozenset( - ['HLA-B*40:02', 'HLA-B*07:02', 'HLA-B*08:01', 'HLA-B*44:03', 'HLA-B*44:02', 'HLA-A*68:01', 'HLA-A*24:02', 'HLA-B*40:01', 'HLA-A*31:01', 'HLA-B*39:01', 'HLA-A*01:01', 'HLA-B*58:01', - 'HLA-B*57:01', 'HLA-A*30:02', 'HLA-A*30:01', 'HLA-B*35:01', 'HLA-B*51:01', 'HLA-A*32:01', 'HLA-B*53:01', 'HLA-A*26:01', 'HLA-A*03:01', 'HLA-B*15:02', 'HLA-B*15:01', 'HLA-B*45:01', - 'HLA-B*54:01', 'HLA-B*18:01', 'HLA-A*68:02', 'HLA-A*69:01', 'HLA-A*02:11', 'HLA-A*11:01', 'HLA-A*23:01', 'HLA-A*33:01', 'HLA-B*46:01', 'HLA-A*02:06', 'HLA-A*02:01', 'HLA-A*02:02', + ['HLA-B*40:02', 'HLA-B*07:02', 'HLA-B*08:01', 'HLA-B*44:03', 'HLA-B*44:02', 'HLA-A*68:01', 'HLA-A*24:02', + 'HLA-B*40:01', 'HLA-A*31:01', 'HLA-B*39:01', 'HLA-A*01:01', 'HLA-B*58:01', + 'HLA-B*57:01', 'HLA-A*30:02', 'HLA-A*30:01', 'HLA-B*35:01', 'HLA-B*51:01', 'HLA-A*32:01', 'HLA-B*53:01', + 'HLA-A*26:01', 'HLA-A*03:01', 'HLA-B*15:02', 'HLA-B*15:01', 'HLA-B*45:01', + 'HLA-B*54:01', 'HLA-B*18:01', 'HLA-A*68:02', 'HLA-A*69:01', 'HLA-A*02:11', 'HLA-A*11:01', 'HLA-A*23:01', + 'HLA-A*33:01', 'HLA-B*46:01', 'HLA-A*02:06', 'HLA-A*02:01', 'HLA-A*02:02', 'HLA-A*02:03', 'HLA-A*29:02', 'HLA-B*27:05']) - __supported_length = frozenset([9,10,11]) + __supported_length = frozenset([9, 10, 11]) __name = "calisimm" __version = "1.0" @@ -919,13 +1072,15 @@ def predict(self, peptides, alleles=None, **kwargs): :return: Returns a :class:`pandas.DataFrame` object with the prediction results :rtype: :class:`pandas.DataFrame` """ + def __load_allele_model(allele, length): - allele_model = "%s"%allele - return getattr(__import__("Fred2.Data.pssms."+self.name+".mat."+allele_model, fromlist=[allele_model]), - allele_model) + allele_model = "%s" % allele + return getattr( + __import__("Fred2.Data.pssms." + self.name + ".mat." + allele_model, fromlist=[allele_model]), + allele_model) if isinstance(peptides, Peptide): - pep_seqs = {str(peptides):peptides} + pep_seqs = {str(peptides): peptides} else: pep_seqs = {} for p in peptides: @@ -933,16 +1088,15 @@ def __load_allele_model(allele, length): raise ValueError("Input is not of type Protein or Peptide") pep_seqs[str(p)] = p - if alleles is None: al = [Allele(a) for a in self.supportedAlleles] - alleles_string = {conv_a:a for conv_a, a in itertools.izip(self.convert_alleles(al), al)} + alleles_string = {conv_a: a for conv_a, a in itertools.izip(self.convert_alleles(al), al)} else: if isinstance(alleles, Allele): alleles = [alleles] if any(not isinstance(p, Allele) for p in alleles): raise ValueError("Input is not of type Allele") - alleles_string = {conv_a:a for conv_a, a in itertools.izip(self.convert_alleles(alleles), alleles)} + alleles_string = {conv_a: a for conv_a, a in itertools.izip(self.convert_alleles(alleles), alleles)} result = {} pep_groups = pep_seqs.keys() @@ -950,7 +1104,7 @@ def __load_allele_model(allele, length): for length, peps in itertools.groupby(pep_groups, key=len): if self.supportedLength is not None and length not in self.supportedLength: - warnings.warn("Peptide length of %i is not supported by %s"%(length, self.name)) + warnings.warn("Peptide length of %i is not supported by %s" % (length, self.name)) continue peps = list(peps) @@ -959,23 +1113,23 @@ def __load_allele_model(allele, length): if alleles_string[a] not in result: result[allele] = {} - #load matrix + # load matrix try: pssm = __load_allele_model(a, length) except ImportError: pssm = [] - importance = self.__importance if length <= 9 else \ - self.__importance[:5] + ((length - 9) * [0.30]) + self.__importance[5:] + importance = self.__importance if length <= 9 else \ + self.__importance[:5] + ((length - 9) * [0.30]) + self.__importance[5:] for p in peps: - score = sum(self.__log_enrichment.get(p[i], 0.0)*importance[i] + score = sum(self.__log_enrichment.get(p[i], 0.0) * importance[i] for i in xrange(length) if i not in pssm) result[allele][pep_seqs[p]] = score if not result: - raise ValueError("No predictions could be made with " +self.name+" for given input. Check your" - "epitope length and HLA allele combination.") + raise ValueError("No predictions could be made with " + self.name + " for given input. Check your" + "epitope length and HLA allele combination.") df_result = EpitopePredictionResult.from_dict(result) df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], @@ -983,4 +1137,372 @@ def __load_allele_model(allele, length): return df_result def convert_alleles(self, alleles): - return map(lambda x: x.name.replace("*","").replace(":",""), alleles) + return map(lambda x: x.name.replace("*", "").replace(":", ""), alleles) + + +class MHCNuggetsPredictor_1(APSSMEpitopePrediction): + """ + Implements MHCNuggets Class I + + .. note:: + Evaluation of machine learning methods to predict peptide binding to MHC Class I proteins + Rohit Bhattacharya, Ashok Sivakumar, Collin Tokheim, Violeta Beleva Guthrie, Valsamo Anagnostou, + Victor E. Velculescu, Rachel Karchin (2017) bioRxiv + """ + __alleles = frozenset( + ["HLA-A01:01", "HLA-A02:01", "HLA-A02:02", "HLA-A02:03", "HLA-A02:04", "HLA-A02:05", "HLA-A02:06", + "HLA-A02:07", "HLA-A02:08", "HLA-A02:09", "HLA-A02:10", "HLA-A02:11", "HLA-A02:12", "HLA-A02:14", + "HLA-A02:16", "HLA-A02:17", "HLA-A02:19", "HLA-A02:50", "HLA-A03:01", "HLA-A03:02", "HLA-A03:19", + "HLA-A11:01", "HLA-A11:02", "HLA-A23:01", "HLA-A24:01", "HLA-A24:02", "HLA-A24:03", "HLA-A25:01", + "HLA-A26:01", "HLA-A26:02", "HLA-A26:03", "HLA-A29:01", "HLA-A29:02", "HLA-A30:01", "HLA-A30:02", + "HLA-A30:03", "HLA-A30:04", "HLA-A31:01", "HLA-A32:01", "HLA-A32:07", "HLA-A32:15", "HLA-A33:01", + "HLA-A33:03", "HLA-A66:01", "HLA-A68:01", "HLA-A68:02", "HLA-A68:23", "HLA-A69:01", "HLA-A74:01", + "HLA-A80:01", "HLA-B07:01", "HLA-B07:02", "HLA-B08:01", "HLA-B08:02", "HLA-B08:03", "HLA-B12:01", + "HLA-B13:02", "HLA-B14:01", "HLA-B14:02", "HLA-B15:01", "HLA-B15:02", "HLA-B15:03", "HLA-B15:08", + "HLA-B15:09", "HLA-B15:10", "HLA-B15:13", "HLA-B15:16", "HLA-B15:17", "HLA-B15:42", "HLA-B18:01", + "HLA-B27:01", "HLA-B27:02", "HLA-B27:03", "HLA-B27:04", "HLA-B27:05", "HLA-B27:06", "HLA-B27:09", + "HLA-B27:10", "HLA-B27:20", "HLA-B35:01", "HLA-B35:02", "HLA-B35:03", "HLA-B35:08", "HLA-B37:01", + "HLA-B38:01", "HLA-B39:01", "HLA-B39:06", "HLA-B39:09", "HLA-B39:10", "HLA-B40:01", "HLA-B40:02", + "HLA-B40:13", "HLA-B41:03", "HLA-B41:04", "HLA-B42:01", "HLA-B42:02", "HLA-B44:01", "HLA-B44:02", + "HLA-B44:03", "HLA-B44:05", "HLA-B45:01", "HLA-B45:06", "HLA-B46:01", "HLA-B48:01", "HLA-B51:01", + "HLA-B51:02", "HLA-B52:01", "HLA-B53:01", "HLA-B54:01", "HLA-B55:01", "HLA-B55:02", "HLA-B56:01", + "HLA-B57:01", "HLA-B57:02", "HLA-B57:03", "HLA-B58:01", "HLA-B58:02", "HLA-B60:01", "HLA-B61:01", + "HLA-B62:01", "HLA-B73:01", "HLA-B81:01", "HLA-B83:01"]) + __supported_length = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] + __name = "mhcnuggets-class-1" + __version = "2.0" + + # the interface defines three class properties + @property + def name(self): + # retunrs the name of the predictor + return self.__name + + @property + def supportedAlleles(self): + # returns the supported alleles as strings (without the HLA prefix) + return self.__alleles + + @property + def supportedLength(self): + # returns the supported epitope lengths as iterable + return self.__supported_length + + @property + def version(self): + # returns the version of the predictor + return self.__version + + # the interface defines a function converting Fred2's HLA allele presentation + # into an internal presentation used by different methods. + # for this predictor we won't need it but still have to provide it! + # the function consumes a list of alleles and converts them into the internally used presentation + def convert_alleles(self, alleles): + # we just use the identity function + return alleles + + # additionally the interface defines a function `predict` + # that consumes a list of peptides or a single peptide and optionally a list + # of allele objects + # + # this method implements the complete prediction routine + def predict(self, peptides, alleles=None, binary=False): + + # test whether one peptide or a list + if isinstance(peptides, basestring): + peptides = list(peptides) + + # if no alleles are specified do predictions for all supported alleles + if alleles is None: + alleles = self.supportedAlleles + else: + # filter for supported alleles + alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) + + # fetch peptides as strings + peptides = [str(peptide) for peptide in peptides] + + # write peptides temporarily, new line separated + tmp_input_file = tempfile.NamedTemporaryFile().name + with open(tmp_input_file, 'wb') as file: + for peptide in peptides: + file.write(peptide + "\n") + + # predict bindings + result = {} + for a in alleles: + result[a] = {} + tmp_output_file = tempfile.NamedTemporaryFile().name + predict(class_='I', + peptides_path=tmp_input_file, + mhc=a, + output=tmp_output_file + a) + + # read predicted binding affinities back + with open(tmp_output_file + a, 'rb') as csvfile: + reader = csv.reader(csvfile, delimiter=' ', quotechar='|') + # skip header + reader.next() + + for row in reader: + content = row[0].split(',') + peptide = content[0] + binding_affinity = content[1] + if binary: + if binding_affinity <= 500: + result[a][peptide] = 1.0 + else: + result[a][peptide] = 0.0 + else: + result[a][peptide] = binding_affinity + + # create EpitopePredictionResult object. This is a multi-indexed DataFrame + # with Peptide and Method as multi-index and alleles as columns + df_result = EpitopePredictionResult.from_dict(result) + df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], + names=['Seq', 'Method']) + return df_result + + +class MHCNuggetsPredictor_2(APSSMEpitopePrediction): + """ + Implements MHCNuggets Class II + + .. note:: + Evaluation of machine learning methods to predict peptide binding to MHC Class I proteins + Rohit Bhattacharya, Ashok Sivakumar, Collin Tokheim, Violeta Beleva Guthrie, Valsamo Anagnostou, + Victor E. Velculescu, Rachel Karchin (2017) bioRxiv + """ + __alleles = frozenset(["HLA-DPA10103-DPB10201", "HLA-DPA10103-DPB10301", "HLA-DPA10103-DPB10401", + "HLA-DPA10103-DPB10402", "HLA-DPA10201-DPB10101", "HLA-DPA10201-DPB10501", + "HLA-DPA10202-DPB10501", "HLA-DPA10301-DPB10402", "HLA-DPB10101", "HLA-DPB10201", + "HLA-DPB10301", "HLA-DPB10401", "HLA-DPB10402", "HLA-DPB10501", "HLA-DPB10901", + "HLA-DPB11101", "HLA-DPB11401", "HLA-DPB12001", "HLA-DQA10101", + "HLA-DQA10101-DQB10501", "HLA-DQA10101-DQB10503", "HLA-DQA10102", "HLA-DQA10102-DQB10501", + "HLA-DQA10102-DQB10502", "HLA-DQA10102-DQB10602", "HLA-DQA10102-DQB10604", + "HLA-DQA10103-DQB10302", "HLA-DQA10103-DQB10601", "HLA-DQA10103-DQB10603", + "HLA-DQA10104-DQB10503", "HLA-DQA10201-DQB10201", "HLA-DQA10201-DQB10202", + "HLA-DQA10201-DQB10301", "HLA-DQA10201-DQB10303", "HLA-DQA10201-DQB10402", + "HLA-DQA10301", "HLA-DQA10301-DQB10201", "HLA-DQA10301-DQB10301", "HLA-DQA10301-DQB10302", + "HLA-DQA10301-DQB10401", "HLA-DQA10302-DQB10301", "HLA-DQA10302-DQB10303", + "HLA-DQA10302-DQB10401", "HLA-DQA10303-DQB10402", "HLA-DQA10401-DQB10402", + "HLA-DQA10501", "HLA-DQA10501-DQB10201", "HLA-DQA10501-DQB10301", "HLA-DQA10501-DQB10302", + "HLA-DQA10501-DQB10303", "HLA-DQA10501-DQB10402", "HLA-DQA10505-DQB10301", + "HLA-DQA10601-DQB10402", "HLA-DQB10201", "HLA-DQB10202", "HLA-DQB10301", + "HLA-DQB10302", "HLA-DQB10319", "HLA-DQB10402", "HLA-DQB10501", "HLA-DQB10502", + "HLA-DQB10503", "HLA-DQB10602", "HLA-DQB10603", "HLA-DQB10604", "HLA-DRA0101-DRB10101", + "HLA-DRA0101-DRB10301", "HLA-DRA0101-DRB10401", "HLA-DRA0101-DRB10404", + "HLA-DRA0101-DRB10701", + "HLA-DRA0101-DRB10801", "HLA-DRA0101-DRB10901", "HLA-DRA0101-DRB11101", + "HLA-DRA0101-DRB11301", + "HLA-DRA0101-DRB11454", "HLA-DRA0101-DRB11501", "HLA-DRA0101-DRB30101", + "HLA-DRA0101-DRB30202", + "HLA-DRA0101-DRB30301", "HLA-DRA0101-DRB40103", "HLA-DRA0101-DRB50101", "HLA-DRB10101", + "HLA-DRB10102", "HLA-DRB10103", "HLA-DRB10301", "HLA-DRB10302", "HLA-DRB10303", + "HLA-DRB10304", "HLA-DRB10305", "HLA-DRB10401", "HLA-DRB10402", "HLA-DRB10403", + "HLA-DRB10404", "HLA-DRB10405", "HLA-DRB10406", "HLA-DRB10407", "HLA-DRB10411", + "HLA-DRB10701", "HLA-DRB10801", "HLA-DRB10802", "HLA-DRB10803", "HLA-DRB10804", + "HLA-DRB10901", "HLA-DRB11001", "HLA-DRB11101", "HLA-DRB11102", "HLA-DRB11103", + "HLA-DRB11104", "HLA-DRB11201", "HLA-DRB11202", "HLA-DRB11301", "HLA-DRB11302", + "HLA-DRB11303", "HLA-DRB11304", "HLA-DRB11305", "HLA-DRB11401", "HLA-DRB11402", + "HLA-DRB11501", "HLA-DRB11502", "HLA-DRB11503", "HLA-DRB11601", "HLA-DRB11602", + "HLA-DRB30101", "HLA-DRB30202", "HLA-DRB30301", "HLA-DRB40101", + "HLA-DRB40103", "HLA-DRB50101", "HLA-DRB50102"]) + __supported_length = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25] + __name = "mhcnuggets-class-2" + __version = "2.0" + + # the interface defines three class properties + @property + def name(self): + # retunrs the name of the predictor + return self.__name + + @property + def supportedAlleles(self): + # returns the supported alleles as strings (without the HLA prefix) + return self.__alleles + + @property + def supportedLength(self): + # returns the supported epitope lengths as iterable + return self.__supported_length + + @property + def version(self): + # returns the version of the predictor + return self.__version + + # the interface defines a function converting Fred2's HLA allele presentation + # into an internal presentation used by different methods. + # for this predictor we won't need it but still have to provide it! + # the function consumes a list of alleles and converts them into the internally used presentation + def convert_alleles(self, alleles): + # we just use the identity function + return alleles + + # additionally the interface defines a function `predict` + # that consumes a list of peptides or a single peptide and optionally a list + # of allele objects + # + # this method implements the complete prediction routine + def predict(self, peptides, alleles=None, binary=False): + + # test whether one peptide or a list + if isinstance(peptides, basestring): + peptides = list(peptides) + + # if no alleles are specified do predictions for all supported alleles + if alleles is None: + alleles = self.supportedAlleles + else: + # filter for supported alleles + alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) + + + # fetch peptides as strings + peptides = [str(peptide) for peptide in peptides] + + # write peptides temporarily, new line separated + tmp_input_file = tempfile.NamedTemporaryFile().name + with open(tmp_input_file, 'wb') as file: + for peptide in peptides: + file.write(peptide + "\n") + + # predict bindings + result = {} + for a in alleles: + result[a] = {} + tmp_output_file = tempfile.NamedTemporaryFile().name + + predict(class_='II', + peptides_path=tmp_input_file, + mhc=a, + output=tmp_output_file + a) + + # read predicted binding affinities back + with open(tmp_output_file + a, 'rb') as csvfile: + reader = csv.reader(csvfile, delimiter=' ', quotechar='|') + # skip header + reader.next() + + for row in reader: + content = row[0].split(',') + peptide = content[0] + binding_affinity = content[1] + if binary: + if binding_affinity <= 500: + result[a][peptide] = 1.0 + else: + result[a][peptide] = 0.0 + else: + result[a][peptide] = binding_affinity + + # create EpitopePredictionResult object. This is a multi-indexed DataFrame + # with Peptide and Method as multi-index and alleles as columns + df_result = EpitopePredictionResult.from_dict(result) + df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], + names=['Seq', 'Method']) + return df_result + + +class MHCFlurryPredictor(APSSMEpitopePrediction): + """ + Implements MHCFlurry + + .. note:: + T. J. O’Donnell, A. Rubinsteyn, M. Bonsack, A. B. Riemer, U. Laserson, and J. Hammerbacher, + "MHCflurry: Open-Source Class I MHC Binding Affinity Prediction," Cell Systems, 2018. + Available at: https://www.cell.com/cell-systems/fulltext/S2405-4712(18)30232-1. + """ + __alleles = frozenset( + ["A*01:01", "A*02:01", "A*02:02", "A*02:03", "A*02:05", "A*02:06", "A*02:07", "A*02:11", "A*02:12", + "A*02:16", "A*02:17", "A*02:19", "A*02:50", "A*03:01", "A*11:01", "A*23:01", "A*24:02", "A*24:03", + "A*25:01", "A*26:01", "A*26:02", "A*26:03", "A*29:02", "A*30:01", 'A*30:02', "A*31:01", "A*32:01", + "A*33:01", "A*66:01", "A*68:01", "A*68:02", "A*68:23", "A*69:01", "A*80:01", "B*07:01", "B*07:02", + "B*08:01", "B*08:02", "B*08:03", "B*14:02", "B*15:01", "B*15:02", "B*15:03", "B*15:09", "B*15:17", + "B*18:01", "B*27:02", "B*27:03", "B*27:04", "B*27:05", "B*27:06", "B*35:01", "B*35:03", "B*37:01", + "B*38:01", "B*39:01", "B*39:06", "B*40:01", "B*40:02", "B*42:01", "B*44:02", "B*44:03", "B*45:01", + "B*46:01", "B*48:01", "B*51:01", "B*53:01", "B*54:01", "B*57:01", "B*58:01", "B*83:01", "C*03:03", + "C*04:01", "C*05:01", "C*06:02", "C*07:02", "C*08:02", "C*12:03", "C*14:02", "C*15:02"]) + __supported_length = [8, 9, 10, 11, 12, 13, 14, 15] + __name = "mhcflurry" + __version = "1.2.2" + + # the interface defines three class properties + @property + def name(self): + # returns the name of the predictor + return self.__name + + @property + def supportedAlleles(self): + # returns the supported alleles as strings (without the HLA prefix) + return self.__alleles + + @property + def supportedLength(self): + # returns the supported epitope lengths as iterable + return self.__supported_length + + @property + def version(self): + # returns the version of the predictor + return self.__version + + # the interface defines a function converting Fred2's HLA allele presentation + # into an internal presentation used by different methods. + # for this predictor we won't need it but still have to provide it! + # the function consumes a list of alleles and converts them into the internally used presentation + def convert_alleles(self, alleles): + # we just use the identity function + return alleles + + # additionally the interface defines a function `predict` + # that consumes a list of peptides or a single peptide and optionally a list + # of allele objects + # + # this method implements the complete prediction routine + def predict(self, peptides, alleles=None, binary=False): + + # test whether one peptide or a list + if isinstance(peptides, basestring): + peptides = list(peptides) + + # if no alleles are specified do predictions for all supported alleles + if alleles is None: + alleles = self.supportedAlleles + else: + # filter for supported alleles + alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) + + # test mhcflurry models are available => download if not + p = subprocess.Popen(['mhcflurry-downloads', 'path', 'models_class1'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if p is not 0: + subprocess.call(['mhcflurry-downloads', 'fetch', 'models_class1']) + + # load model + predictor = Class1AffinityPredictor.load() + + # predict bindings + result = {} + for a in alleles: + result[a] = {} + for p in peptides: + seq = p.__str__() + binding_affinity = predictor.predict(allele=a, peptides=[seq]) + if binary: + if binding_affinity <= 500: + result[a][p] = 1.0 + else: + result[a][p] = 0.0 + else: + result[a][p] = binding_affinity + + # create EpitopePredictionResult object. This is a multi-indexed DataFrame + # with Peptide and Method as multi-index and alleles as columns + df_result = EpitopePredictionResult.from_dict(result) + df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], + names=['Seq', 'Method']) + return df_result diff --git a/setup.py b/setup.py index 16752141..3f3ecad6 100644 --- a/setup.py +++ b/setup.py @@ -120,6 +120,6 @@ #ext_modules=[d2s_module], # Run-time dependencies. (will be installed by pip when FRED2 is installed) - install_requires=['setuptools>=18.2', 'pandas', 'pyomo>=4.0','svmlight', 'PyMySQL', 'biopython', 'pyVCF'], + install_requires=['setuptools>=18.2', 'pandas', 'pyomo>=4.0','svmlight', 'PyMySQL', 'biopython', 'pyVCF', 'mhcflurry', 'mhcnuggets'], ) From 7696ceb20430416be5398a535eca5a646f0dce7f Mon Sep 17 00:00:00 2001 From: Zethson Date: Sun, 12 May 2019 15:38:26 +0200 Subject: [PATCH 02/16] [FIX] Removed duplicated endcoding --- Fred2/EpitopePrediction/PSSM.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Fred2/EpitopePrediction/PSSM.py b/Fred2/EpitopePrediction/PSSM.py index a358d890..cdc8be72 100644 --- a/Fred2/EpitopePrediction/PSSM.py +++ b/Fred2/EpitopePrediction/PSSM.py @@ -8,7 +8,6 @@ .. moduleauthor:: schubert """ -# coding=utf-8 import itertools import warnings import math @@ -1359,7 +1358,6 @@ def predict(self, peptides, alleles=None, binary=False): # filter for supported alleles alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) - # fetch peptides as strings peptides = [str(peptide) for peptide in peptides] From ef9fc5b621a530032a9b54b82f3e9119016a962b Mon Sep 17 00:00:00 2001 From: Zethson Date: Sun, 12 May 2019 16:07:55 +0200 Subject: [PATCH 03/16] [FIX] formatting --- Fred2/EpitopePrediction/PSSM.py | 402 ++++++++++++-------------------- 1 file changed, 147 insertions(+), 255 deletions(-) diff --git a/Fred2/EpitopePrediction/PSSM.py b/Fred2/EpitopePrediction/PSSM.py index cdc8be72..a96c6457 100644 --- a/Fred2/EpitopePrediction/PSSM.py +++ b/Fred2/EpitopePrediction/PSSM.py @@ -96,8 +96,8 @@ def __load_allele_model(allele, length): result[alleles_string[a]][pep_seqs[p]] = score if not result: - raise ValueError("No predictions could be made with " + self.name + " for given input. Check your" - "epitope length and HLA allele combination.") + raise ValueError("No predictions could be made with " + + self.name + " for given input. Check your epitope length and HLA allele combination.") df_result = EpitopePredictionResult.from_dict(result) df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], @@ -116,13 +116,10 @@ class Syfpeithi(APSSMEpitopePrediction): """ __alleles = frozenset( ['HLA-B*15:10', 'HLA-B*41:01', 'HLA-B*37:01', 'HLA-B*27:05', 'HLA-B*38:01', 'HLA-A*02:01', 'HLA-B*47:01', - 'HLA-A*26:01', - 'HLA-B*37:01', 'HLA-DRB1*11:01', 'HLA-B*50:01', 'HLA-B*07:02', 'HLA-A*68:01', 'HLA-A*24:02', 'HLA-DRB1*15:01', - 'HLA-B*15:01', - 'HLA-B*45:01', 'HLA-A*11:01', 'HLA-A*03:01', 'HLA-B*40:01', 'HLA-DRB1*03:01', 'HLA-B*39:01', 'HLA-DRB1*01:01', - 'HLA-B*51:01', - 'HLA-B*39:02', 'HLA-B*08:01', 'HLA-B*18:01', 'HLA-B*44:02', 'HLA-B*49:01', 'HLA-DRB1*07:01', 'HLA-B*14:02', - 'HLA-A*01:01']) + 'HLA-A*26:01', 'HLA-B*37:01', 'HLA-DRB1*11:01', 'HLA-B*50:01', 'HLA-B*07:02', 'HLA-A*68:01', 'HLA-A*24:02', + 'HLA-DRB1*15:01', 'HLA-B*15:01', 'HLA-B*45:01', 'HLA-A*11:01', 'HLA-A*03:01', 'HLA-B*40:01', 'HLA-DRB1*03:01', + 'HLA-B*39:01', 'HLA-DRB1*01:01', 'HLA-B*51:01', 'HLA-B*39:02', 'HLA-B*08:01', 'HLA-B*18:01', 'HLA-B*44:02', + 'HLA-B*49:01', 'HLA-DRB1*07:01', 'HLA-B*14:02', 'HLA-A*01:01']) __supported_length = frozenset([8, 9, 10, 11]) __name = "syfpeithi" __version = "1.0" @@ -177,11 +174,10 @@ class BIMAS(APSSMEpitopePrediction): __alleles = frozenset(['HLA-B*04:01', 'HLA-A*31:01', 'HLA-B*58:01', 'HLA-C*06:02', 'HLA-A*03:01', 'HLA-B*35:01', 'HLA-B*35:01', 'HLA-B*15:01', 'HLA-A*02:05', 'HLA-B*27:05', 'HLA-B*27:05', 'HLA-A*33:02', 'HLA-B*39:01', 'HLA-B*38:01', 'HLA-B*40:', 'HLA-A*24:02', 'HLA-B*51:01', 'HLA-B*07:02', - 'HLA-B*08:01', - 'HLA-B*51:02', 'HLA-B*40:06', 'HLA-B*40:06', 'HLA-B*51:02', 'HLA-B*37:01', 'HLA-A*11:01', - 'HLA-B*08:01', 'HLA-B*44:03', 'HLA-A*68:01', 'HLA-B*51:03', 'HLA-B*52:01', 'HLA-A*02:01', - 'HLA-A*01:01', 'HLA-C*07:02', 'HLA-C*03:01', 'HLA-B*40:01', 'HLA-B*51:01', 'HLA-B*39:02', - 'HLA-B*52:01', 'HLA-C*04:01', 'HLA-B*27:02', 'HLA-B*39:01']) + 'HLA-B*08:01', 'HLA-B*51:02', 'HLA-B*40:06', 'HLA-B*40:06', 'HLA-B*51:02', 'HLA-B*37:01', + 'HLA-A*11:01', 'HLA-B*08:01', 'HLA-B*44:03', 'HLA-A*68:01', 'HLA-B*51:03', 'HLA-B*52:01', + 'HLA-A*02:01', 'HLA-A*01:01', 'HLA-C*07:02', 'HLA-C*03:01', 'HLA-B*40:01', 'HLA-B*51:01', + 'HLA-B*39:02', 'HLA-B*52:01', 'HLA-C*04:01', 'HLA-B*27:02', 'HLA-B*39:01']) __supported_length = frozenset([8, 9]) __name = "bimas" __version = "1.0" @@ -366,25 +362,17 @@ class SMM(APSSMEpitopePrediction): __alleles = frozenset( ['HLA-B*27:20', 'HLA-B*83:01', 'HLA-A*32:15', 'HLA-B*15:17', 'HLA-B*40:13', 'HLA-A*24:02', 'HLA-A*24:03', - 'HLA-B*53:01', - 'HLA-B*15:01', 'HLA-B*27:05', 'HLA-B*42:01', 'HLA-B*39:01', 'HLA-B*38:01', 'HLA-A*23:01', 'HLA-A*25:01', - 'HLA-C*04:01', - 'HLA-A*29:02', 'HLA-A*02:06', 'HLA-A*02:01', 'HLA-A*02:02', 'HLA-A*02:03', 'HLA-A*26:02', 'HLA-A*26:03', - 'HLA-A*26:01', - 'HLA-C*03:03', 'E*01:01', 'E*01:03', 'HLA-B*58:01', 'HLA-A*31:01', 'HLA-C*06:02', 'HLA-B*07:02', 'HLA-A*66:01', - 'HLA-B*57:01', 'HLA-A*68:01', 'HLA-A*68:02', 'HLA-C*14:02', 'HLA-B*35:01', 'HLA-B*15:09', 'HLA-B*35:03', - 'HLA-A*80:01', - 'HLA-B*15:03', 'HLA-B*15:02', 'HLA-A*32:01', 'HLA-A*02:50', 'HLA-A*32:07', 'HLA-B*58:02', 'HLA-A*69:01', - 'HLA-A*68:23', - 'HLA-A*11:01', 'HLA-A*03:01', 'HLA-B*73:01', 'HLA-B*40:01', 'HLA-B*44:03', 'HLA-B*46:01', 'HLA-B*40:02', - 'HLA-C*12:03', - 'HLA-B*44:02', 'HLA-A*30:01', 'HLA-A*02:19', 'HLA-A*30:02', 'HLA-A*02:17', 'HLA-A*02:16', 'HLA-B*51:01', - 'HLA-B*45:01', + 'HLA-B*53:01', 'HLA-B*15:01', 'HLA-B*27:05', 'HLA-B*42:01', 'HLA-B*39:01', 'HLA-B*38:01', 'HLA-A*23:01', + 'HLA-A*25:01', 'HLA-C*04:01', 'HLA-A*29:02', 'HLA-A*02:06', 'HLA-A*02:01', 'HLA-A*02:02', 'HLA-A*02:03', + 'HLA-A*26:02', 'HLA-A*26:03', 'HLA-A*26:01', 'HLA-C*03:03', 'E*01:01', 'E*01:03', 'HLA-B*58:01', 'HLA-A*31:01', + 'HLA-C*06:02', 'HLA-B*07:02', 'HLA-A*66:01', 'HLA-B*57:01', 'HLA-A*68:01', 'HLA-A*68:02', 'HLA-C*14:02', + 'HLA-B*35:01', 'HLA-B*15:09', 'HLA-B*35:03', 'HLA-A*80:01', 'HLA-B*15:03', 'HLA-B*15:02', 'HLA-A*32:01', + 'HLA-A*02:50', 'HLA-A*32:07', 'HLA-B*58:02', 'HLA-A*69:01', 'HLA-A*68:23', 'HLA-A*11:01', 'HLA-A*03:01', + 'HLA-B*73:01', 'HLA-B*40:01', 'HLA-B*44:03', 'HLA-B*46:01', 'HLA-B*40:02', 'HLA-C*12:03', 'HLA-B*44:02', + 'HLA-A*30:01', 'HLA-A*02:19', 'HLA-A*30:02', 'HLA-A*02:17', 'HLA-A*02:16', 'HLA-B*51:01', 'HLA-B*45:01', 'HLA-A*02:12', 'HLA-A*02:11', 'HLA-B*54:01', 'HLA-B*08:01', 'HLA-B*18:01', 'HLA-B*08:03', 'HLA-B*08:02', - 'HLA-C*05:01', - 'HLA-C*15:02', 'HLA-A*33:01', 'HLA-B*14:02', 'HLA-C*07:01', 'HLA-B*48:01', 'HLA-B*15:42', 'HLA-C*07:02', - 'HLA-A*01:01', - 'HLA-C*08:02']) + 'HLA-C*05:01', 'HLA-C*15:02', 'HLA-A*33:01', 'HLA-B*14:02', 'HLA-C*07:01', 'HLA-B*48:01', 'HLA-B*15:42', + 'HLA-C*07:02', 'HLA-A*01:01', 'HLA-C*08:02']) __supported_length = frozenset([8, 9, 10, 11]) __name = "smm" __version = "1.0" @@ -454,24 +442,17 @@ class SMMPMBEC(APSSMEpitopePrediction): __alleles = frozenset( ['HLA-A*01:01', 'HLA-A*02:01', 'HLA-A*02:02', 'HLA-A*02:03', 'HLA-A*02:06', 'HLA-A*02:11', 'HLA-A*02:12', - 'HLA-A*02:16', 'HLA-A*02:17', - 'HLA-A*02:19', 'HLA-A*02:50', 'HLA-A*03:01', 'HLA-A*11:01', 'HLA-A*23:01', 'HLA-A*24:02', 'HLA-A*24:03', - 'HLA-A*25:01', 'HLA-A*26:01', - 'HLA-A*26:02', 'HLA-A*26:03', 'HLA-A*29:02', 'HLA-A*30:01', 'HLA-A*30:02', 'HLA-A*31:01', 'HLA-A*32:01', - 'HLA-A*32:07', 'HLA-A*32:15', - 'HLA-A*33:01', 'HLA-A*66:01', 'HLA-A*68:01', 'HLA-A*68:02', 'HLA-A*68:23', 'HLA-A*69:01', 'HLA-A*80:01', - 'HLA-B*07:02', 'HLA-B*08:01', - 'HLA-B*08:02', 'HLA-B*08:03', 'HLA-B*14:02', 'HLA-B*15:01', 'HLA-B*15:02', 'HLA-B*15:03', 'HLA-B*15:09', - 'HLA-B*15:17', 'HLA-B*15:42', - 'HLA-B*18:01', 'HLA-B*27:03', 'HLA-B*27:05', 'HLA-B*27:20', 'HLA-B*35:01', 'HLA-B*35:03', 'HLA-B*38:01', - 'HLA-B*39:01', 'HLA-B*40:01', - 'HLA-B*40:02', 'HLA-B*40:13', 'HLA-B*42:01', 'HLA-B*44:02', 'HLA-B*44:03', 'HLA-B*45:01', 'HLA-B*45:06', - 'HLA-B*46:01', 'HLA-B*48:01', + 'HLA-A*02:16', 'HLA-A*02:17', 'HLA-A*02:19', 'HLA-A*02:50', 'HLA-A*03:01', 'HLA-A*11:01', 'HLA-A*23:01', + 'HLA-A*24:02', 'HLA-A*24:03', 'HLA-A*25:01', 'HLA-A*26:01', 'HLA-A*26:02', 'HLA-A*26:03', 'HLA-A*29:02', + 'HLA-A*30:01', 'HLA-A*30:02', 'HLA-A*31:01', 'HLA-A*32:01', 'HLA-A*32:07', 'HLA-A*32:15', 'HLA-A*33:01', + 'HLA-A*66:01', 'HLA-A*68:01', 'HLA-A*68:02', 'HLA-A*68:23', 'HLA-A*69:01', 'HLA-A*80:01', 'HLA-B*07:02', + 'HLA-B*08:01', 'HLA-B*08:02', 'HLA-B*08:03', 'HLA-B*14:02', 'HLA-B*15:01', 'HLA-B*15:02', 'HLA-B*15:03', + 'HLA-B*15:09', 'HLA-B*15:17', 'HLA-B*15:42', 'HLA-B*18:01', 'HLA-B*27:03', 'HLA-B*27:05', 'HLA-B*27:20', + 'HLA-B*35:01', 'HLA-B*35:03', 'HLA-B*38:01', 'HLA-B*39:01', 'HLA-B*40:01', 'HLA-B*40:02', 'HLA-B*40:13', + 'HLA-B*42:01', 'HLA-B*44:02', 'HLA-B*44:03', 'HLA-B*45:01', 'HLA-B*45:06', 'HLA-B*46:01', 'HLA-B*48:01', 'HLA-B*51:01', 'HLA-B*53:01', 'HLA-B*54:01', 'HLA-B*57:01', 'HLA-B*58:01', 'HLA-B*58:02', 'HLA-B*73:01', - 'HLA-B*83:01', 'HLA-C*03:03', - 'HLA-C*04:01', 'HLA-C*05:01', 'HLA-C*06:02', 'HLA-C*07:01', 'HLA-C*07:02', 'HLA-C*08:02', 'HLA-C*12:03', - 'HLA-C*14:02', 'HLA-C*15:02', - 'E*01:01', 'E*01:03']) + 'HLA-B*83:01', 'HLA-C*03:03', 'HLA-C*04:01', 'HLA-C*05:01', 'HLA-C*06:02', 'HLA-C*07:01', 'HLA-C*07:02', + 'HLA-C*08:02', 'HLA-C*12:03', 'HLA-C*14:02', 'HLA-C*15:02', 'E*01:01', 'E*01:03']) __supported_length = frozenset([8, 9, 10, 11]) __name = "smmpmbec" __version = "1.0" @@ -542,18 +523,14 @@ class ARB(APSSMEpitopePrediction): __alleles = frozenset( ['HLA-A*01:01', 'HLA-A*02:01', 'HLA-A*02:02', 'HLA-A*02:03', 'HLA-A*02:06', 'HLA-A*02:11', 'HLA-A*02:12', - 'HLA-A*02:16', 'HLA-A*02:19', - 'HLA-A*02:50', 'HLA-A*03:01', 'HLA-A*11:01', 'HLA-A*23:01', 'HLA-A*24:02', 'HLA-A*24:03', 'HLA-A*25:01', - 'HLA-A*26:01', 'HLA-A*26:02', - 'HLA-A*26:03', 'HLA-A*29:02', 'HLA-A*30:01', 'HLA-A*30:02', 'HLA-A*31:01', 'HLA-A*32:01', 'HLA-A*33:01', - 'HLA-A*68:01', 'HLA-A*68:02', - 'HLA-A*69:01', 'HLA-A*80:01', 'HLA-B*07:02', 'HLA-B*08:01', 'HLA-B*08:02', 'HLA-B*08:03', 'HLA-B*15:01', - 'HLA-B*15:02', 'HLA-B*15:03', - 'HLA-B*15:09', 'HLA-B*15:17', 'HLA-B*18:01', 'HLA-B*27:03', 'HLA-B*27:05', 'HLA-B*35:01', 'HLA-B*38:01', - 'HLA-B*39:01', 'HLA-B*40:01', - 'HLA-B*40:02', 'HLA-B*44:02', 'HLA-B*44:03', 'HLA-B*45:01', 'HLA-B*46:01', 'HLA-B*48:01', 'HLA-B*51:01', - 'HLA-B*53:01', 'HLA-B*54:01', - 'HLA-B*57:01', 'HLA-B*58:01', 'HLA-B*73:01']) + 'HLA-A*02:16', 'HLA-A*02:19', 'HLA-A*02:50', 'HLA-A*03:01', 'HLA-A*11:01', 'HLA-A*23:01', 'HLA-A*24:02', + 'HLA-A*24:03', 'HLA-A*25:01', 'HLA-A*26:01', 'HLA-A*26:02', 'HLA-A*26:03', 'HLA-A*29:02', 'HLA-A*30:01', + 'HLA-A*30:02', 'HLA-A*31:01', 'HLA-A*32:01', 'HLA-A*33:01', 'HLA-A*68:01', 'HLA-A*68:02', 'HLA-A*69:01', + 'HLA-A*80:01', 'HLA-B*07:02', 'HLA-B*08:01', 'HLA-B*08:02', 'HLA-B*08:03', 'HLA-B*15:01', 'HLA-B*15:02', + 'HLA-B*15:03', 'HLA-B*15:09', 'HLA-B*15:17', 'HLA-B*18:01', 'HLA-B*27:03', 'HLA-B*27:05', 'HLA-B*35:01', + 'HLA-B*38:01', 'HLA-B*39:01', 'HLA-B*40:01', 'HLA-B*40:02', 'HLA-B*44:02', 'HLA-B*44:03', 'HLA-B*45:01', + 'HLA-B*46:01', 'HLA-B*48:01', 'HLA-B*51:01', 'HLA-B*53:01', 'HLA-B*54:01', 'HLA-B*57:01', 'HLA-B*58:01', + 'HLA-B*73:01']) __supported_length = frozenset([8, 9, 10, 11]) __name = "arb" __version = "1.0" @@ -686,8 +663,8 @@ class ComblibSidney2008(APSSMEpitopePrediction): __alleles = frozenset( ['HLA-B*35:01', 'HLA-B*51:01', 'HLA-B*54:01', 'HLA-B*58:02', 'HLA-A*02:01', 'HLA-A*68:02', 'HLA-B*27:05', - 'HLA-B*08:01', 'HLA-B*07:02', - 'HLA-A*32:01', 'HLA-B*53:01', 'HLA-A*30:01', 'HLA-B*15:03', 'HLA-B*15:01', 'HLA-B*58:01']) + 'HLA-B*08:01', 'HLA-B*07:02', 'HLA-A*32:01', 'HLA-B*53:01', 'HLA-A*30:01', 'HLA-B*15:03', 'HLA-B*15:01', + 'HLA-B*58:01']) __supported_length = frozenset([9]) __name = "comblibsidney" __version = "1.0" @@ -743,7 +720,8 @@ def predict(self, peptides, alleles=None, **kwargs): """ return EpitopePredictionResult( super(ComblibSidney2008, self).predict(peptides, - alleles=alleles, **kwargs).applymap(lambda x: math.pow(10, x))) + alleles=alleles, + **kwargs).applymap(lambda x: math.pow(10, x))) class TEPITOPEpan(APSSMEpitopePrediction): @@ -759,214 +737,128 @@ class TEPITOPEpan(APSSMEpitopePrediction): __alleles = frozenset( ['HLA-DRB1*01:01', 'HLA-DRB1*01:02', 'HLA-DRB1*01:03', 'HLA-DRB1*01:04', 'HLA-DRB1*01:05', 'HLA-DRB1*01:06', - 'HLA-DRB1*01:07', - 'HLA-DRB1*01:08', 'HLA-DRB1*01:09', 'HLA-DRB1*01:10', 'HLA-DRB1*01:11', 'HLA-DRB1*01:12', 'HLA-DRB1*01:13', - 'HLA-DRB1*01:14', - 'HLA-DRB1*01:15', 'HLA-DRB1*01:16', 'HLA-DRB1*01:17', 'HLA-DRB1*01:18', 'HLA-DRB1*01:19', 'HLA-DRB1*01:20', - 'HLA-DRB1*01:21', - 'HLA-DRB1*01:22', 'HLA-DRB1*01:23', 'HLA-DRB1*01:24', 'HLA-DRB1*01:25', 'HLA-DRB1*01:26', 'HLA-DRB1*01:27', - 'HLA-DRB1*01:28', - 'HLA-DRB1*01:29', 'HLA-DRB1*01:30', 'HLA-DRB1*01:31', 'HLA-DRB1*01:32', 'HLA-DRB1*01:34', 'HLA-DRB1*01:35', - 'HLA-DRB1*01:36', - 'HLA-DRB1*03:01', 'HLA-DRB1*03:02', 'HLA-DRB1*03:03', 'HLA-DRB1*03:04', 'HLA-DRB1*03:05', 'HLA-DRB1*03:06', - 'HLA-DRB1*03:07', + 'HLA-DRB1*01:07', 'HLA-DRB1*01:08', 'HLA-DRB1*01:09', 'HLA-DRB1*01:10', 'HLA-DRB1*01:11', 'HLA-DRB1*01:12', + 'HLA-DRB1*01:13', 'HLA-DRB1*01:14', 'HLA-DRB1*01:15', 'HLA-DRB1*01:16', 'HLA-DRB1*01:17', 'HLA-DRB1*01:18', + 'HLA-DRB1*01:19', 'HLA-DRB1*01:20', 'HLA-DRB1*01:21', 'HLA-DRB1*01:22', 'HLA-DRB1*01:23', 'HLA-DRB1*01:24', + 'HLA-DRB1*01:25', 'HLA-DRB1*01:26', 'HLA-DRB1*01:27', 'HLA-DRB1*01:28', 'HLA-DRB1*01:29', 'HLA-DRB1*01:30', + 'HLA-DRB1*01:31', 'HLA-DRB1*01:32', 'HLA-DRB1*01:34', 'HLA-DRB1*01:35', 'HLA-DRB1*01:36', 'HLA-DRB1*03:01', + 'HLA-DRB1*03:02', 'HLA-DRB1*03:03', 'HLA-DRB1*03:04', 'HLA-DRB1*03:05', 'HLA-DRB1*03:06', 'HLA-DRB1*03:07', 'HLA-DRB1*03:08', 'HLA-DRB1*03:09', 'HLA-DRB1*03:10', 'HLA-DRB1*03:11', 'HLA-DRB1*03:12', 'HLA-DRB1*03:13', - 'HLA-DRB1*03:14', - 'HLA-DRB1*03:15', 'HLA-DRB1*03:16', 'HLA-DRB1*03:17', 'HLA-DRB1*03:18', 'HLA-DRB1*03:19', 'HLA-DRB1*03:20', - 'HLA-DRB1*03:21', - 'HLA-DRB1*03:22', 'HLA-DRB1*03:23', 'HLA-DRB1*03:24', 'HLA-DRB1*03:25', 'HLA-DRB1*03:26', 'HLA-DRB1*03:27', - 'HLA-DRB1*03:28', - 'HLA-DRB1*03:29', 'HLA-DRB1*03:30', 'HLA-DRB1*03:31', 'HLA-DRB1*03:32', 'HLA-DRB1*03:33', 'HLA-DRB1*03:34', - 'HLA-DRB1*03:35', - 'HLA-DRB1*03:36', 'HLA-DRB1*03:37', 'HLA-DRB1*03:38', 'HLA-DRB1*03:39', 'HLA-DRB1*03:40', 'HLA-DRB1*03:41', - 'HLA-DRB1*03:42', - 'HLA-DRB1*03:43', 'HLA-DRB1*03:44', 'HLA-DRB1*03:45', 'HLA-DRB1*03:46', 'HLA-DRB1*03:47', 'HLA-DRB1*03:48', - 'HLA-DRB1*03:49', + 'HLA-DRB1*03:14', 'HLA-DRB1*03:15', 'HLA-DRB1*03:16', 'HLA-DRB1*03:17', 'HLA-DRB1*03:18', 'HLA-DRB1*03:19', + 'HLA-DRB1*03:20', 'HLA-DRB1*03:21', 'HLA-DRB1*03:22', 'HLA-DRB1*03:23', 'HLA-DRB1*03:24', 'HLA-DRB1*03:25', + 'HLA-DRB1*03:26', 'HLA-DRB1*03:27', 'HLA-DRB1*03:28', 'HLA-DRB1*03:29', 'HLA-DRB1*03:30', 'HLA-DRB1*03:31', + 'HLA-DRB1*03:32', 'HLA-DRB1*03:33', 'HLA-DRB1*03:34', 'HLA-DRB1*03:35', 'HLA-DRB1*03:36', 'HLA-DRB1*03:37', + 'HLA-DRB1*03:38', 'HLA-DRB1*03:39', 'HLA-DRB1*03:40', 'HLA-DRB1*03:41', 'HLA-DRB1*03:42', 'HLA-DRB1*03:43', + 'HLA-DRB1*03:44', 'HLA-DRB1*03:45', 'HLA-DRB1*03:46', 'HLA-DRB1*03:47', 'HLA-DRB1*03:48', 'HLA-DRB1*03:49', 'HLA-DRB1*03:50', 'HLA-DRB1*03:51', 'HLA-DRB1*03:52', 'HLA-DRB1*03:53', 'HLA-DRB1*03:54', 'HLA-DRB1*03:55', - 'HLA-DRB1*03:56', - 'HLA-DRB1*03:57', 'HLA-DRB1*03:58', 'HLA-DRB1*03:59', 'HLA-DRB1*03:60', 'HLA-DRB1*03:61', 'HLA-DRB1*03:62', - 'HLA-DRB1*03:63', - 'HLA-DRB1*03:64', 'HLA-DRB1*04:01', 'HLA-DRB1*04:02', 'HLA-DRB1*04:03', 'HLA-DRB1*04:04', 'HLA-DRB1*04:05', - 'HLA-DRB1*04:06', - 'HLA-DRB1*04:07', 'HLA-DRB1*04:08', 'HLA-DRB1*04:09', 'HLA-DRB1*04:10', 'HLA-DRB1*04:11', 'HLA-DRB1*04:12', - 'HLA-DRB1*04:13', - 'HLA-DRB1*04:14', 'HLA-DRB1*04:15', 'HLA-DRB1*04:16', 'HLA-DRB1*04:17', 'HLA-DRB1*04:18', 'HLA-DRB1*04:19', - 'HLA-DRB1*04:20', - 'HLA-DRB1*04:21', 'HLA-DRB1*04:22', 'HLA-DRB1*04:23', 'HLA-DRB1*04:24', 'HLA-DRB1*04:25', 'HLA-DRB1*04:26', - 'HLA-DRB1*04:27', + 'HLA-DRB1*03:56', 'HLA-DRB1*03:57', 'HLA-DRB1*03:58', 'HLA-DRB1*03:59', 'HLA-DRB1*03:60', 'HLA-DRB1*03:61', + 'HLA-DRB1*03:62', 'HLA-DRB1*03:63', 'HLA-DRB1*03:64', 'HLA-DRB1*04:01', 'HLA-DRB1*04:02', 'HLA-DRB1*04:03', + 'HLA-DRB1*04:04', 'HLA-DRB1*04:05', 'HLA-DRB1*04:06', 'HLA-DRB1*04:07', 'HLA-DRB1*04:08', 'HLA-DRB1*04:09', + 'HLA-DRB1*04:10', 'HLA-DRB1*04:11', 'HLA-DRB1*04:12', 'HLA-DRB1*04:13', 'HLA-DRB1*04:14', 'HLA-DRB1*04:15', + 'HLA-DRB1*04:16', 'HLA-DRB1*04:17', 'HLA-DRB1*04:18', 'HLA-DRB1*04:19', 'HLA-DRB1*04:20', 'HLA-DRB1*04:21', + 'HLA-DRB1*04:22', 'HLA-DRB1*04:23', 'HLA-DRB1*04:24', 'HLA-DRB1*04:25', 'HLA-DRB1*04:26', 'HLA-DRB1*04:27', 'HLA-DRB1*04:28', 'HLA-DRB1*04:29', 'HLA-DRB1*04:30', 'HLA-DRB1*04:31', 'HLA-DRB1*04:32', 'HLA-DRB1*04:33', - 'HLA-DRB1*04:34', - 'HLA-DRB1*04:35', 'HLA-DRB1*04:36', 'HLA-DRB1*04:37', 'HLA-DRB1*04:38', 'HLA-DRB1*04:39', 'HLA-DRB1*04:40', - 'HLA-DRB1*04:41', - 'HLA-DRB1*04:42', 'HLA-DRB1*04:43', 'HLA-DRB1*04:44', 'HLA-DRB1*04:45', 'HLA-DRB1*04:46', 'HLA-DRB1*04:47', - 'HLA-DRB1*04:48', - 'HLA-DRB1*04:49', 'HLA-DRB1*04:50', 'HLA-DRB1*04:51', 'HLA-DRB1*04:52', 'HLA-DRB1*04:53', 'HLA-DRB1*04:54', - 'HLA-DRB1*04:55', - 'HLA-DRB1*04:56', 'HLA-DRB1*04:57', 'HLA-DRB1*04:58', 'HLA-DRB1*04:59', 'HLA-DRB1*04:60', 'HLA-DRB1*04:61', - 'HLA-DRB1*04:62', - 'HLA-DRB1*04:63', 'HLA-DRB1*04:64', 'HLA-DRB1*04:65', 'HLA-DRB1*04:66', 'HLA-DRB1*04:67', 'HLA-DRB1*04:68', - 'HLA-DRB1*04:69', + 'HLA-DRB1*04:34', 'HLA-DRB1*04:35', 'HLA-DRB1*04:36', 'HLA-DRB1*04:37', 'HLA-DRB1*04:38', 'HLA-DRB1*04:39', + 'HLA-DRB1*04:40', 'HLA-DRB1*04:41', 'HLA-DRB1*04:42', 'HLA-DRB1*04:43', 'HLA-DRB1*04:44', 'HLA-DRB1*04:45', + 'HLA-DRB1*04:46', 'HLA-DRB1*04:47', 'HLA-DRB1*04:48', 'HLA-DRB1*04:49', 'HLA-DRB1*04:50', 'HLA-DRB1*04:51', + 'HLA-DRB1*04:52', 'HLA-DRB1*04:53', 'HLA-DRB1*04:54', 'HLA-DRB1*04:55', 'HLA-DRB1*04:56', 'HLA-DRB1*04:57', + 'HLA-DRB1*04:58', 'HLA-DRB1*04:59', 'HLA-DRB1*04:60', 'HLA-DRB1*04:61', 'HLA-DRB1*04:62', 'HLA-DRB1*04:63', + 'HLA-DRB1*04:64', 'HLA-DRB1*04:65', 'HLA-DRB1*04:66', 'HLA-DRB1*04:67', 'HLA-DRB1*04:68', 'HLA-DRB1*04:69', 'HLA-DRB1*04:70', 'HLA-DRB1*04:71', 'HLA-DRB1*04:72', 'HLA-DRB1*04:73', 'HLA-DRB1*04:74', 'HLA-DRB1*04:75', - 'HLA-DRB1*04:76', - 'HLA-DRB1*04:77', 'HLA-DRB1*04:78', 'HLA-DRB1*04:79', 'HLA-DRB1*04:80', 'HLA-DRB1*04:82', 'HLA-DRB1*04:83', - 'HLA-DRB1*04:84', - 'HLA-DRB1*04:85', 'HLA-DRB1*04:86', 'HLA-DRB1*04:87', 'HLA-DRB1*04:88', 'HLA-DRB1*04:89', 'HLA-DRB1*04:90', - 'HLA-DRB1*04:91', - 'HLA-DRB1*04:92', 'HLA-DRB1*04:93', 'HLA-DRB1*04:95', 'HLA-DRB1*04:96', 'HLA-DRB1*04:97', 'HLA-DRB1*04:98', - 'HLA-DRB1*07:01', - 'HLA-DRB1*07:03', 'HLA-DRB1*07:04', 'HLA-DRB1*07:05', 'HLA-DRB1*07:06', 'HLA-DRB1*07:07', 'HLA-DRB1*07:08', - 'HLA-DRB1*07:09', - 'HLA-DRB1*07:11', 'HLA-DRB1*07:12', 'HLA-DRB1*07:13', 'HLA-DRB1*07:14', 'HLA-DRB1*07:15', 'HLA-DRB1*07:16', - 'HLA-DRB1*07:17', + 'HLA-DRB1*04:76', 'HLA-DRB1*04:77', 'HLA-DRB1*04:78', 'HLA-DRB1*04:79', 'HLA-DRB1*04:80', 'HLA-DRB1*04:82', + 'HLA-DRB1*04:83', 'HLA-DRB1*04:84', 'HLA-DRB1*04:85', 'HLA-DRB1*04:86', 'HLA-DRB1*04:87', 'HLA-DRB1*04:88', + 'HLA-DRB1*04:89', 'HLA-DRB1*04:90', 'HLA-DRB1*04:91', 'HLA-DRB1*04:92', 'HLA-DRB1*04:93', 'HLA-DRB1*04:95', + 'HLA-DRB1*04:96', 'HLA-DRB1*04:97', 'HLA-DRB1*04:98', 'HLA-DRB1*07:01', 'HLA-DRB1*07:03', 'HLA-DRB1*07:04', + 'HLA-DRB1*07:05', 'HLA-DRB1*07:06', 'HLA-DRB1*07:07', 'HLA-DRB1*07:08', 'HLA-DRB1*07:09', 'HLA-DRB1*07:11', + 'HLA-DRB1*07:12', 'HLA-DRB1*07:13', 'HLA-DRB1*07:14', 'HLA-DRB1*07:15', 'HLA-DRB1*07:16', 'HLA-DRB1*07:17', 'HLA-DRB1*07:18', 'HLA-DRB1*07:19', 'HLA-DRB1*07:20', 'HLA-DRB1*07:21', 'HLA-DRB1*08:01', 'HLA-DRB1*08:02', - 'HLA-DRB1*08:03', - 'HLA-DRB1*08:04', 'HLA-DRB1*08:05', 'HLA-DRB1*08:06', 'HLA-DRB1*08:07', 'HLA-DRB1*08:08', 'HLA-DRB1*08:09', - 'HLA-DRB1*08:10', - 'HLA-DRB1*08:11', 'HLA-DRB1*08:12', 'HLA-DRB1*08:13', 'HLA-DRB1*08:14', 'HLA-DRB1*08:15', 'HLA-DRB1*08:16', - 'HLA-DRB1*08:17', - 'HLA-DRB1*08:18', 'HLA-DRB1*08:19', 'HLA-DRB1*08:20', 'HLA-DRB1*08:21', 'HLA-DRB1*08:22', 'HLA-DRB1*08:23', - 'HLA-DRB1*08:24', - 'HLA-DRB1*08:25', 'HLA-DRB1*08:26', 'HLA-DRB1*08:27', 'HLA-DRB1*08:28', 'HLA-DRB1*08:29', 'HLA-DRB1*08:30', - 'HLA-DRB1*08:31', - 'HLA-DRB1*08:32', 'HLA-DRB1*08:33', 'HLA-DRB1*08:34', 'HLA-DRB1*08:35', 'HLA-DRB1*08:36', 'HLA-DRB1*08:37', - 'HLA-DRB1*08:38', + 'HLA-DRB1*08:03', 'HLA-DRB1*08:04', 'HLA-DRB1*08:05', 'HLA-DRB1*08:06', 'HLA-DRB1*08:07', 'HLA-DRB1*08:08', + 'HLA-DRB1*08:09', 'HLA-DRB1*08:10', 'HLA-DRB1*08:11', 'HLA-DRB1*08:12', 'HLA-DRB1*08:13', 'HLA-DRB1*08:14', + 'HLA-DRB1*08:15', 'HLA-DRB1*08:16', 'HLA-DRB1*08:17', 'HLA-DRB1*08:18', 'HLA-DRB1*08:19', 'HLA-DRB1*08:20', + 'HLA-DRB1*08:21', 'HLA-DRB1*08:22', 'HLA-DRB1*08:23', 'HLA-DRB1*08:24', 'HLA-DRB1*08:25', 'HLA-DRB1*08:26', + 'HLA-DRB1*08:27', 'HLA-DRB1*08:28', 'HLA-DRB1*08:29', 'HLA-DRB1*08:30', 'HLA-DRB1*08:31', 'HLA-DRB1*08:32', + 'HLA-DRB1*08:33', 'HLA-DRB1*08:34', 'HLA-DRB1*08:35', 'HLA-DRB1*08:36', 'HLA-DRB1*08:37', 'HLA-DRB1*08:38', 'HLA-DRB1*08:39', 'HLA-DRB1*08:40', 'HLA-DRB1*08:41', 'HLA-DRB1*08:42', 'HLA-DRB1*08:43', 'HLA-DRB1*08:44', - 'HLA-DRB1*08:45', - 'HLA-DRB1*09:01', 'HLA-DRB1*09:02', 'HLA-DRB1*09:03', 'HLA-DRB1*09:04', 'HLA-DRB1*09:05', 'HLA-DRB1*09:06', - 'HLA-DRB1*09:07', - 'HLA-DRB1*09:08', 'HLA-DRB1*09:09', 'HLA-DRB1*09:10', 'HLA-DRB1*09:11', 'HLA-DRB1*09:12', 'HLA-DRB1*10:01', - 'HLA-DRB1*10:02', - 'HLA-DRB1*10:03', 'HLA-DRB1*11:01', 'HLA-DRB1*11:02', 'HLA-DRB1*11:03', 'HLA-DRB1*11:04', 'HLA-DRB1*11:05', - 'HLA-DRB1*11:06', - 'HLA-DRB1*11:07', 'HLA-DRB1*11:08', 'HLA-DRB1*11:09', 'HLA-DRB1*11:10', 'HLA-DRB1*11:11', 'HLA-DRB1*11:12', - 'HLA-DRB1*11:13', - 'HLA-DRB1*11:14', 'HLA-DRB1*11:15', 'HLA-DRB1*11:16', 'HLA-DRB1*11:17', 'HLA-DRB1*11:18', 'HLA-DRB1*11:19', - 'HLA-DRB1*11:20', + 'HLA-DRB1*08:45', 'HLA-DRB1*09:01', 'HLA-DRB1*09:02', 'HLA-DRB1*09:03', 'HLA-DRB1*09:04', 'HLA-DRB1*09:05', + 'HLA-DRB1*09:06', 'HLA-DRB1*09:07', 'HLA-DRB1*09:08', 'HLA-DRB1*09:09', 'HLA-DRB1*09:10', 'HLA-DRB1*09:11', + 'HLA-DRB1*09:12', 'HLA-DRB1*10:01', 'HLA-DRB1*10:02', 'HLA-DRB1*10:03', 'HLA-DRB1*11:01', 'HLA-DRB1*11:02', + 'HLA-DRB1*11:03', 'HLA-DRB1*11:04', 'HLA-DRB1*11:05', 'HLA-DRB1*11:06', 'HLA-DRB1*11:07', 'HLA-DRB1*11:08', + 'HLA-DRB1*11:09', 'HLA-DRB1*11:10', 'HLA-DRB1*11:11', 'HLA-DRB1*11:12', 'HLA-DRB1*11:13', 'HLA-DRB1*11:14', + 'HLA-DRB1*11:15', 'HLA-DRB1*11:16', 'HLA-DRB1*11:17', 'HLA-DRB1*11:18', 'HLA-DRB1*11:19', 'HLA-DRB1*11:20', 'HLA-DRB1*11:21', 'HLA-DRB1*11:22', 'HLA-DRB1*11:23', 'HLA-DRB1*11:24', 'HLA-DRB1*11:25', 'HLA-DRB1*11:26', - 'HLA-DRB1*11:27', - 'HLA-DRB1*11:28', 'HLA-DRB1*11:29', 'HLA-DRB1*11:30', 'HLA-DRB1*11:31', 'HLA-DRB1*11:32', 'HLA-DRB1*11:33', - 'HLA-DRB1*11:34', - 'HLA-DRB1*11:35', 'HLA-DRB1*11:36', 'HLA-DRB1*11:37', 'HLA-DRB1*11:38', 'HLA-DRB1*11:39', 'HLA-DRB1*11:40', - 'HLA-DRB1*11:41', - 'HLA-DRB1*11:42', 'HLA-DRB1*11:43', 'HLA-DRB1*11:44', 'HLA-DRB1*11:45', 'HLA-DRB1*11:46', 'HLA-DRB1*11:47', - 'HLA-DRB1*11:48', - 'HLA-DRB1*11:49', 'HLA-DRB1*11:50', 'HLA-DRB1*11:51', 'HLA-DRB1*11:52', 'HLA-DRB1*11:53', 'HLA-DRB1*11:54', - 'HLA-DRB1*11:55', - 'HLA-DRB1*11:56', 'HLA-DRB1*11:57', 'HLA-DRB1*11:58', 'HLA-DRB1*11:59', 'HLA-DRB1*11:60', 'HLA-DRB1*11:61', - 'HLA-DRB1*11:62', + 'HLA-DRB1*11:27', 'HLA-DRB1*11:28', 'HLA-DRB1*11:29', 'HLA-DRB1*11:30', 'HLA-DRB1*11:31', 'HLA-DRB1*11:32', + 'HLA-DRB1*11:33', 'HLA-DRB1*11:34', 'HLA-DRB1*11:35', 'HLA-DRB1*11:36', 'HLA-DRB1*11:37', 'HLA-DRB1*11:38', + 'HLA-DRB1*11:39', 'HLA-DRB1*11:40', 'HLA-DRB1*11:41', 'HLA-DRB1*11:42', 'HLA-DRB1*11:43', 'HLA-DRB1*11:44', + 'HLA-DRB1*11:45', 'HLA-DRB1*11:46', 'HLA-DRB1*11:47', 'HLA-DRB1*11:48', 'HLA-DRB1*11:49', 'HLA-DRB1*11:50', + 'HLA-DRB1*11:51', 'HLA-DRB1*11:52', 'HLA-DRB1*11:53', 'HLA-DRB1*11:54', 'HLA-DRB1*11:55', 'HLA-DRB1*11:56', + 'HLA-DRB1*11:57', 'HLA-DRB1*11:58', 'HLA-DRB1*11:59', 'HLA-DRB1*11:60', 'HLA-DRB1*11:61', 'HLA-DRB1*11:62', 'HLA-DRB1*11:63', 'HLA-DRB1*11:64', 'HLA-DRB1*11:65', 'HLA-DRB1*11:66', 'HLA-DRB1*11:67', 'HLA-DRB1*11:68', - 'HLA-DRB1*11:69', - 'HLA-DRB1*11:70', 'HLA-DRB1*11:72', 'HLA-DRB1*11:73', 'HLA-DRB1*11:74', 'HLA-DRB1*11:75', 'HLA-DRB1*11:76', - 'HLA-DRB1*11:77', - 'HLA-DRB1*11:78', 'HLA-DRB1*11:79', 'HLA-DRB1*11:80', 'HLA-DRB1*11:81', 'HLA-DRB1*11:82', 'HLA-DRB1*11:83', - 'HLA-DRB1*11:84', - 'HLA-DRB1*11:85', 'HLA-DRB1*11:86', 'HLA-DRB1*11:87', 'HLA-DRB1*11:88', 'HLA-DRB1*11:89', 'HLA-DRB1*11:90', - 'HLA-DRB1*11:91', - 'HLA-DRB1*11:92', 'HLA-DRB1*11:93', 'HLA-DRB1*11:94', 'HLA-DRB1*11:95', 'HLA-DRB1*11:96', 'HLA-DRB1*11:97', - 'HLA-DRB1*11:98', - 'HLA-DRB1*11:99', 'HLA-DRB1*12:01', 'HLA-DRB1*12:02', 'HLA-DRB1*12:03', 'HLA-DRB1*12:04', 'HLA-DRB1*12:05', - 'HLA-DRB1*12:06', + 'HLA-DRB1*11:69', 'HLA-DRB1*11:70', 'HLA-DRB1*11:72', 'HLA-DRB1*11:73', 'HLA-DRB1*11:74', 'HLA-DRB1*11:75', + 'HLA-DRB1*11:76', 'HLA-DRB1*11:77', 'HLA-DRB1*11:78', 'HLA-DRB1*11:79', 'HLA-DRB1*11:80', 'HLA-DRB1*11:81', + 'HLA-DRB1*11:82', 'HLA-DRB1*11:83', 'HLA-DRB1*11:84', 'HLA-DRB1*11:85', 'HLA-DRB1*11:86', 'HLA-DRB1*11:87', + 'HLA-DRB1*11:88', 'HLA-DRB1*11:89', 'HLA-DRB1*11:90', 'HLA-DRB1*11:91', 'HLA-DRB1*11:92', 'HLA-DRB1*11:93', + 'HLA-DRB1*11:94', 'HLA-DRB1*11:95', 'HLA-DRB1*11:96', 'HLA-DRB1*11:97', 'HLA-DRB1*11:98', 'HLA-DRB1*11:99', + 'HLA-DRB1*12:01', 'HLA-DRB1*12:02', 'HLA-DRB1*12:03', 'HLA-DRB1*12:04', 'HLA-DRB1*12:05', 'HLA-DRB1*12:06', 'HLA-DRB1*12:07', 'HLA-DRB1*12:08', 'HLA-DRB1*12:09', 'HLA-DRB1*12:10', 'HLA-DRB1*12:11', 'HLA-DRB1*12:12', - 'HLA-DRB1*12:13', - 'HLA-DRB1*12:14', 'HLA-DRB1*12:15', 'HLA-DRB1*12:16', 'HLA-DRB1*12:17', 'HLA-DRB1*12:18', 'HLA-DRB1*12:19', - 'HLA-DRB1*12:20', - 'HLA-DRB1*12:21', 'HLA-DRB1*12:22', 'HLA-DRB1*12:23', 'HLA-DRB1*12:25', 'HLA-DRB1*12:26', 'HLA-DRB1*12:27', - 'HLA-DRB1*13:01', - 'HLA-DRB1*13:02', 'HLA-DRB1*13:03', 'HLA-DRB1*13:04', 'HLA-DRB1*13:05', 'HLA-DRB1*13:06', 'HLA-DRB1*13:07', - 'HLA-DRB1*13:08', - 'HLA-DRB1*13:09', 'HLA-DRB1*13:10', 'HLA-DRB1*13:11', 'HLA-DRB1*13:12', 'HLA-DRB1*13:13', 'HLA-DRB1*13:14', - 'HLA-DRB1*13:15', - 'HLA-DRB1*13:16', 'HLA-DRB1*13:17', 'HLA-DRB1*13:18', 'HLA-DRB1*13:19', 'HLA-DRB1*13:20', 'HLA-DRB1*13:21', - 'HLA-DRB1*13:22', + 'HLA-DRB1*12:13', 'HLA-DRB1*12:14', 'HLA-DRB1*12:15', 'HLA-DRB1*12:16', 'HLA-DRB1*12:17', 'HLA-DRB1*12:18', + 'HLA-DRB1*12:19', 'HLA-DRB1*12:20', 'HLA-DRB1*12:21', 'HLA-DRB1*12:22', 'HLA-DRB1*12:23', 'HLA-DRB1*12:25', + 'HLA-DRB1*12:26', 'HLA-DRB1*12:27', 'HLA-DRB1*13:01', 'HLA-DRB1*13:02', 'HLA-DRB1*13:03', 'HLA-DRB1*13:04', + 'HLA-DRB1*13:05', 'HLA-DRB1*13:06', 'HLA-DRB1*13:07', 'HLA-DRB1*13:08', 'HLA-DRB1*13:09', 'HLA-DRB1*13:10', + 'HLA-DRB1*13:11', 'HLA-DRB1*13:12', 'HLA-DRB1*13:13', 'HLA-DRB1*13:14', 'HLA-DRB1*13:15', 'HLA-DRB1*13:16', + 'HLA-DRB1*13:17', 'HLA-DRB1*13:18', 'HLA-DRB1*13:19', 'HLA-DRB1*13:20', 'HLA-DRB1*13:21', 'HLA-DRB1*13:22', 'HLA-DRB1*13:23', 'HLA-DRB1*13:24', 'HLA-DRB1*13:25', 'HLA-DRB1*13:26', 'HLA-DRB1*13:27', 'HLA-DRB1*13:28', - 'HLA-DRB1*13:29', - 'HLA-DRB1*13:30', 'HLA-DRB1*13:31', 'HLA-DRB1*13:32', 'HLA-DRB1*13:33', 'HLA-DRB1*13:34', 'HLA-DRB1*13:35', - 'HLA-DRB1*13:36', - 'HLA-DRB1*13:37', 'HLA-DRB1*13:38', 'HLA-DRB1*13:39', 'HLA-DRB1*13:40', 'HLA-DRB1*13:41', 'HLA-DRB1*13:42', - 'HLA-DRB1*13:43', - 'HLA-DRB1*13:44', 'HLA-DRB1*13:45', 'HLA-DRB1*13:46', 'HLA-DRB1*13:47', 'HLA-DRB1*13:48', 'HLA-DRB1*13:49', - 'HLA-DRB1*13:50', - 'HLA-DRB1*13:51', 'HLA-DRB1*13:52', 'HLA-DRB1*13:53', 'HLA-DRB1*13:54', 'HLA-DRB1*13:55', 'HLA-DRB1*13:56', - 'HLA-DRB1*13:57', - 'HLA-DRB1*13:58', 'HLA-DRB1*13:59', 'HLA-DRB1*13:60', 'HLA-DRB1*13:61', 'HLA-DRB1*13:62', 'HLA-DRB1*13:63', - 'HLA-DRB1*13:64', + 'HLA-DRB1*13:29', 'HLA-DRB1*13:30', 'HLA-DRB1*13:31', 'HLA-DRB1*13:32', 'HLA-DRB1*13:33', 'HLA-DRB1*13:34', + 'HLA-DRB1*13:35', 'HLA-DRB1*13:36', 'HLA-DRB1*13:37', 'HLA-DRB1*13:38', 'HLA-DRB1*13:39', 'HLA-DRB1*13:40', + 'HLA-DRB1*13:41', 'HLA-DRB1*13:42', 'HLA-DRB1*13:43', 'HLA-DRB1*13:44', 'HLA-DRB1*13:45', 'HLA-DRB1*13:46', + 'HLA-DRB1*13:47', 'HLA-DRB1*13:48', 'HLA-DRB1*13:49', 'HLA-DRB1*13:50', 'HLA-DRB1*13:51', 'HLA-DRB1*13:52', + 'HLA-DRB1*13:53', 'HLA-DRB1*13:54', 'HLA-DRB1*13:55', 'HLA-DRB1*13:56', 'HLA-DRB1*13:57', 'HLA-DRB1*13:58', + 'HLA-DRB1*13:59', 'HLA-DRB1*13:60', 'HLA-DRB1*13:61', 'HLA-DRB1*13:62', 'HLA-DRB1*13:63', 'HLA-DRB1*13:64', 'HLA-DRB1*13:65', 'HLA-DRB1*13:66', 'HLA-DRB1*13:67', 'HLA-DRB1*13:68', 'HLA-DRB1*13:69', 'HLA-DRB1*13:70', - 'HLA-DRB1*13:71', - 'HLA-DRB1*13:72', 'HLA-DRB1*13:73', 'HLA-DRB1*13:74', 'HLA-DRB1*13:75', 'HLA-DRB1*13:76', 'HLA-DRB1*13:77', - 'HLA-DRB1*13:78', - 'HLA-DRB1*13:79', 'HLA-DRB1*13:80', 'HLA-DRB1*13:81', 'HLA-DRB1*13:82', 'HLA-DRB1*13:83', 'HLA-DRB1*13:84', - 'HLA-DRB1*13:85', - 'HLA-DRB1*13:86', 'HLA-DRB1*13:87', 'HLA-DRB1*13:88', 'HLA-DRB1*13:89', 'HLA-DRB1*13:90', 'HLA-DRB1*13:91', - 'HLA-DRB1*13:92', - 'HLA-DRB1*13:93', 'HLA-DRB1*13:94', 'HLA-DRB1*13:95', 'HLA-DRB1*13:96', 'HLA-DRB1*13:97', 'HLA-DRB1*13:98', - 'HLA-DRB1*13:99', - 'HLA-DRB1*14:01', 'HLA-DRB1*14:02', 'HLA-DRB1*14:03', 'HLA-DRB1*14:04', 'HLA-DRB1*14:05', 'HLA-DRB1*14:06', - 'HLA-DRB1*14:07', + 'HLA-DRB1*13:71', 'HLA-DRB1*13:72', 'HLA-DRB1*13:73', 'HLA-DRB1*13:74', 'HLA-DRB1*13:75', 'HLA-DRB1*13:76', + 'HLA-DRB1*13:77', 'HLA-DRB1*13:78', 'HLA-DRB1*13:79', 'HLA-DRB1*13:80', 'HLA-DRB1*13:81', 'HLA-DRB1*13:82', + 'HLA-DRB1*13:83', 'HLA-DRB1*13:84', 'HLA-DRB1*13:85', 'HLA-DRB1*13:86', 'HLA-DRB1*13:87', 'HLA-DRB1*13:88', + 'HLA-DRB1*13:89', 'HLA-DRB1*13:90', 'HLA-DRB1*13:91', 'HLA-DRB1*13:92', 'HLA-DRB1*13:93', 'HLA-DRB1*13:94', + 'HLA-DRB1*13:95', 'HLA-DRB1*13:96', 'HLA-DRB1*13:97', 'HLA-DRB1*13:98', 'HLA-DRB1*13:99', 'HLA-DRB1*14:01', + 'HLA-DRB1*14:02', 'HLA-DRB1*14:03', 'HLA-DRB1*14:04', 'HLA-DRB1*14:05', 'HLA-DRB1*14:06', 'HLA-DRB1*14:07', 'HLA-DRB1*14:08', 'HLA-DRB1*14:09', 'HLA-DRB1*14:10', 'HLA-DRB1*14:11', 'HLA-DRB1*14:12', 'HLA-DRB1*14:13', - 'HLA-DRB1*14:14', - 'HLA-DRB1*14:15', 'HLA-DRB1*14:16', 'HLA-DRB1*14:17', 'HLA-DRB1*14:18', 'HLA-DRB1*14:19', 'HLA-DRB1*14:20', - 'HLA-DRB1*14:21', - 'HLA-DRB1*14:22', 'HLA-DRB1*14:23', 'HLA-DRB1*14:24', 'HLA-DRB1*14:25', 'HLA-DRB1*14:26', 'HLA-DRB1*14:27', - 'HLA-DRB1*14:28', - 'HLA-DRB1*14:29', 'HLA-DRB1*14:30', 'HLA-DRB1*14:31', 'HLA-DRB1*14:32', 'HLA-DRB1*14:33', 'HLA-DRB1*14:34', - 'HLA-DRB1*14:35', - 'HLA-DRB1*14:36', 'HLA-DRB1*14:37', 'HLA-DRB1*14:38', 'HLA-DRB1*14:39', 'HLA-DRB1*14:40', 'HLA-DRB1*14:41', - 'HLA-DRB1*14:42', - 'HLA-DRB1*14:43', 'HLA-DRB1*14:44', 'HLA-DRB1*14:45', 'HLA-DRB1*14:46', 'HLA-DRB1*14:47', 'HLA-DRB1*14:48', - 'HLA-DRB1*14:49', + 'HLA-DRB1*14:14', 'HLA-DRB1*14:15', 'HLA-DRB1*14:16', 'HLA-DRB1*14:17', 'HLA-DRB1*14:18', 'HLA-DRB1*14:19', + 'HLA-DRB1*14:20', 'HLA-DRB1*14:21', 'HLA-DRB1*14:22', 'HLA-DRB1*14:23', 'HLA-DRB1*14:24', 'HLA-DRB1*14:25', + 'HLA-DRB1*14:26', 'HLA-DRB1*14:27', 'HLA-DRB1*14:28', 'HLA-DRB1*14:29', 'HLA-DRB1*14:30', 'HLA-DRB1*14:31', + 'HLA-DRB1*14:32', 'HLA-DRB1*14:33', 'HLA-DRB1*14:34', 'HLA-DRB1*14:35', 'HLA-DRB1*14:36', 'HLA-DRB1*14:37', + 'HLA-DRB1*14:38', 'HLA-DRB1*14:39', 'HLA-DRB1*14:40', 'HLA-DRB1*14:41', 'HLA-DRB1*14:42', 'HLA-DRB1*14:43', + 'HLA-DRB1*14:44', 'HLA-DRB1*14:45', 'HLA-DRB1*14:46', 'HLA-DRB1*14:47', 'HLA-DRB1*14:48', 'HLA-DRB1*14:49', 'HLA-DRB1*14:50', 'HLA-DRB1*14:51', 'HLA-DRB1*14:52', 'HLA-DRB1*14:53', 'HLA-DRB1*14:54', 'HLA-DRB1*14:55', - 'HLA-DRB1*14:56', - 'HLA-DRB1*14:57', 'HLA-DRB1*14:58', 'HLA-DRB1*14:59', 'HLA-DRB1*14:60', 'HLA-DRB1*14:61', 'HLA-DRB1*14:62', - 'HLA-DRB1*14:63', - 'HLA-DRB1*14:64', 'HLA-DRB1*14:65', 'HLA-DRB1*14:67', 'HLA-DRB1*14:68', 'HLA-DRB1*14:69', 'HLA-DRB1*14:70', - 'HLA-DRB1*14:71', - 'HLA-DRB1*14:72', 'HLA-DRB1*14:73', 'HLA-DRB1*14:74', 'HLA-DRB1*14:75', 'HLA-DRB1*14:76', 'HLA-DRB1*14:77', - 'HLA-DRB1*14:78', - 'HLA-DRB1*14:79', 'HLA-DRB1*14:80', 'HLA-DRB1*14:81', 'HLA-DRB1*14:82', 'HLA-DRB1*14:83', 'HLA-DRB1*14:84', - 'HLA-DRB1*14:85', - 'HLA-DRB1*14:86', 'HLA-DRB1*14:87', 'HLA-DRB1*14:88', 'HLA-DRB1*14:89', 'HLA-DRB1*14:90', 'HLA-DRB1*14:91', - 'HLA-DRB1*14:93', + 'HLA-DRB1*14:56', 'HLA-DRB1*14:57', 'HLA-DRB1*14:58', 'HLA-DRB1*14:59', 'HLA-DRB1*14:60', 'HLA-DRB1*14:61', + 'HLA-DRB1*14:62', 'HLA-DRB1*14:63', 'HLA-DRB1*14:64', 'HLA-DRB1*14:65', 'HLA-DRB1*14:67', 'HLA-DRB1*14:68', + 'HLA-DRB1*14:69', 'HLA-DRB1*14:70', 'HLA-DRB1*14:71', 'HLA-DRB1*14:72', 'HLA-DRB1*14:73', 'HLA-DRB1*14:74', + 'HLA-DRB1*14:75', 'HLA-DRB1*14:76', 'HLA-DRB1*14:77', 'HLA-DRB1*14:78', 'HLA-DRB1*14:79', 'HLA-DRB1*14:80', + 'HLA-DRB1*14:81', 'HLA-DRB1*14:82', 'HLA-DRB1*14:83', 'HLA-DRB1*14:84', 'HLA-DRB1*14:85', 'HLA-DRB1*14:86', + 'HLA-DRB1*14:87', 'HLA-DRB1*14:88', 'HLA-DRB1*14:89', 'HLA-DRB1*14:90', 'HLA-DRB1*14:91', 'HLA-DRB1*14:93', 'HLA-DRB1*14:94', 'HLA-DRB1*14:95', 'HLA-DRB1*14:96', 'HLA-DRB1*14:97', 'HLA-DRB1*14:98', 'HLA-DRB1*14:99', - 'HLA-DRB1*15:01', - 'HLA-DRB1*15:02', 'HLA-DRB1*15:03', 'HLA-DRB1*15:04', 'HLA-DRB1*15:05', 'HLA-DRB1*15:06', 'HLA-DRB1*15:07', - 'HLA-DRB1*15:08', - 'HLA-DRB1*15:09', 'HLA-DRB1*15:10', 'HLA-DRB1*15:11', 'HLA-DRB1*15:12', 'HLA-DRB1*15:13', 'HLA-DRB1*15:14', - 'HLA-DRB1*15:15', - 'HLA-DRB1*15:16', 'HLA-DRB1*15:18', 'HLA-DRB1*15:19', 'HLA-DRB1*15:20', 'HLA-DRB1*15:21', 'HLA-DRB1*15:22', - 'HLA-DRB1*15:23', - 'HLA-DRB1*15:24', 'HLA-DRB1*15:25', 'HLA-DRB1*15:26', 'HLA-DRB1*15:27', 'HLA-DRB1*15:28', 'HLA-DRB1*15:29', - 'HLA-DRB1*15:30', - 'HLA-DRB1*15:31', 'HLA-DRB1*15:32', 'HLA-DRB1*15:33', 'HLA-DRB1*15:34', 'HLA-DRB1*15:35', 'HLA-DRB1*15:36', - 'HLA-DRB1*15:37', + 'HLA-DRB1*15:01', 'HLA-DRB1*15:02', 'HLA-DRB1*15:03', 'HLA-DRB1*15:04', 'HLA-DRB1*15:05', 'HLA-DRB1*15:06', + 'HLA-DRB1*15:07', 'HLA-DRB1*15:08', 'HLA-DRB1*15:09', 'HLA-DRB1*15:10', 'HLA-DRB1*15:11', 'HLA-DRB1*15:12', + 'HLA-DRB1*15:13', 'HLA-DRB1*15:14', 'HLA-DRB1*15:15', 'HLA-DRB1*15:16', 'HLA-DRB1*15:18', 'HLA-DRB1*15:19', + 'HLA-DRB1*15:20', 'HLA-DRB1*15:21', 'HLA-DRB1*15:22', 'HLA-DRB1*15:23', 'HLA-DRB1*15:24', 'HLA-DRB1*15:25', + 'HLA-DRB1*15:26', 'HLA-DRB1*15:27', 'HLA-DRB1*15:28', 'HLA-DRB1*15:29', 'HLA-DRB1*15:30', 'HLA-DRB1*15:31', + 'HLA-DRB1*15:32', 'HLA-DRB1*15:33', 'HLA-DRB1*15:34', 'HLA-DRB1*15:35', 'HLA-DRB1*15:36', 'HLA-DRB1*15:37', 'HLA-DRB1*15:38', 'HLA-DRB1*15:39', 'HLA-DRB1*15:40', 'HLA-DRB1*15:41', 'HLA-DRB1*15:42', 'HLA-DRB1*15:43', - 'HLA-DRB1*15:44', - 'HLA-DRB1*15:45', 'HLA-DRB1*15:46', 'HLA-DRB1*15:47', 'HLA-DRB1*15:48', 'HLA-DRB1*15:49', 'HLA-DRB1*15:51', - 'HLA-DRB1*15:52', - 'HLA-DRB1*15:53', 'HLA-DRB1*15:54', 'HLA-DRB1*15:55', 'HLA-DRB1*15:56', 'HLA-DRB1*15:57', 'HLA-DRB1*16:01', - 'HLA-DRB1*16:02', - 'HLA-DRB1*16:03', 'HLA-DRB1*16:04', 'HLA-DRB1*16:05', 'HLA-DRB1*16:07', 'HLA-DRB1*16:08', 'HLA-DRB1*16:09', - 'HLA-DRB1*16:10', - 'HLA-DRB1*16:11', 'HLA-DRB1*16:12', 'HLA-DRB1*16:14', 'HLA-DRB1*16:15', 'HLA-DRB1*16:16', 'HLA-DRB1*16:17', - 'HLA-DRB1*16:18', - 'HLA-DRB3*01:01', 'HLA-DRB3*01:02', 'HLA-DRB3*01:03', 'HLA-DRB3*01:04', 'HLA-DRB3*01:05', 'HLA-DRB3*01:06', - 'HLA-DRB3*01:07', + 'HLA-DRB1*15:44', 'HLA-DRB1*15:45', 'HLA-DRB1*15:46', 'HLA-DRB1*15:47', 'HLA-DRB1*15:48', 'HLA-DRB1*15:49', + 'HLA-DRB1*15:51', 'HLA-DRB1*15:52', 'HLA-DRB1*15:53', 'HLA-DRB1*15:54', 'HLA-DRB1*15:55', 'HLA-DRB1*15:56', + 'HLA-DRB1*15:57', 'HLA-DRB1*16:01', 'HLA-DRB1*16:02', 'HLA-DRB1*16:03', 'HLA-DRB1*16:04', 'HLA-DRB1*16:05', + 'HLA-DRB1*16:07', 'HLA-DRB1*16:08', 'HLA-DRB1*16:09', 'HLA-DRB1*16:10', 'HLA-DRB1*16:11', 'HLA-DRB1*16:12', + 'HLA-DRB1*16:14', 'HLA-DRB1*16:15', 'HLA-DRB1*16:16', 'HLA-DRB1*16:17', 'HLA-DRB1*16:18', 'HLA-DRB3*01:01', + 'HLA-DRB3*01:02', 'HLA-DRB3*01:03', 'HLA-DRB3*01:04', 'HLA-DRB3*01:05', 'HLA-DRB3*01:06', 'HLA-DRB3*01:07', 'HLA-DRB3*01:08', 'HLA-DRB3*01:09', 'HLA-DRB3*01:10', 'HLA-DRB3*01:11', 'HLA-DRB3*01:12', 'HLA-DRB3*01:13', - 'HLA-DRB3*01:14', - 'HLA-DRB3*01:15', 'HLA-DRB3*02:01', 'HLA-DRB3*02:02', 'HLA-DRB3*02:03', 'HLA-DRB3*02:04', 'HLA-DRB3*02:05', - 'HLA-DRB3*02:06', - 'HLA-DRB3*02:07', 'HLA-DRB3*02:08', 'HLA-DRB3*02:09', 'HLA-DRB3*02:10', 'HLA-DRB3*02:11', 'HLA-DRB3*02:12', - 'HLA-DRB3*02:13', - 'HLA-DRB3*02:14', 'HLA-DRB3*02:15', 'HLA-DRB3*02:16', 'HLA-DRB3*02:17', 'HLA-DRB3*02:18', 'HLA-DRB3*02:19', - 'HLA-DRB3*02:20', - 'HLA-DRB3*02:21', 'HLA-DRB3*02:22', 'HLA-DRB3*02:23', 'HLA-DRB3*02:24', 'HLA-DRB3*02:25', 'HLA-DRB3*02:26', - 'HLA-DRB3*02:27', - 'HLA-DRB3*02:28', 'HLA-DRB3*03:01', 'HLA-DRB3*03:02', 'HLA-DRB3*03:03', 'HLA-DRB4*01:01', 'HLA-DRB4*01:03', - 'HLA-DRB4*01:04', + 'HLA-DRB3*01:14', 'HLA-DRB3*01:15', 'HLA-DRB3*02:01', 'HLA-DRB3*02:02', 'HLA-DRB3*02:03', 'HLA-DRB3*02:04', + 'HLA-DRB3*02:05', 'HLA-DRB3*02:06', 'HLA-DRB3*02:07', 'HLA-DRB3*02:08', 'HLA-DRB3*02:09', 'HLA-DRB3*02:10', + 'HLA-DRB3*02:11', 'HLA-DRB3*02:12', 'HLA-DRB3*02:13', 'HLA-DRB3*02:14', 'HLA-DRB3*02:15', 'HLA-DRB3*02:16', + 'HLA-DRB3*02:17', 'HLA-DRB3*02:18', 'HLA-DRB3*02:19', 'HLA-DRB3*02:20', 'HLA-DRB3*02:21', 'HLA-DRB3*02:22', + 'HLA-DRB3*02:23', 'HLA-DRB3*02:24', 'HLA-DRB3*02:25', 'HLA-DRB3*02:26', 'HLA-DRB3*02:27', 'HLA-DRB3*02:28', + 'HLA-DRB3*03:01', 'HLA-DRB3*03:02', 'HLA-DRB3*03:03', 'HLA-DRB4*01:01', 'HLA-DRB4*01:03', 'HLA-DRB4*01:04', 'HLA-DRB4*01:05', 'HLA-DRB4*01:06', 'HLA-DRB4*01:07', 'HLA-DRB4*01:08', 'HLA-DRB5*01:01', 'HLA-DRB5*01:02', - 'HLA-DRB5*01:04', - 'HLA-DRB5*01:05', 'HLA-DRB5*01:06', 'HLA-DRB5*01:07', 'HLA-DRB5*01:08', 'HLA-DRB5*01:09', 'HLA-DRB5*01:11', - 'HLA-DRB5*01:12', - 'HLA-DRB5*01:13', 'HLA-DRB5*01:14', 'HLA-DRB5*02:02', 'HLA-DRB5*02:03', 'HLA-DRB5*02:04', 'HLA-DRB5*02:05']) + 'HLA-DRB5*01:04', 'HLA-DRB5*01:05', 'HLA-DRB5*01:06', 'HLA-DRB5*01:07', 'HLA-DRB5*01:08', 'HLA-DRB5*01:09', + 'HLA-DRB5*01:11', 'HLA-DRB5*01:12', 'HLA-DRB5*01:13', 'HLA-DRB5*01:14', 'HLA-DRB5*02:02', 'HLA-DRB5*02:03', + 'HLA-DRB5*02:04', 'HLA-DRB5*02:05']) __supported_length = frozenset([9]) __name = "tepitopepan" __version = "1.0" From eb92fc89f8b49a1154e2260dc60b05c85d11f44b Mon Sep 17 00:00:00 2001 From: Zethson Date: Sun, 12 May 2019 16:16:56 +0200 Subject: [PATCH 04/16] [FIX] added HLA- prefix to mhcflurry alleles --- Fred2/EpitopePrediction/PSSM.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Fred2/EpitopePrediction/PSSM.py b/Fred2/EpitopePrediction/PSSM.py index a96c6457..e6266926 100644 --- a/Fred2/EpitopePrediction/PSSM.py +++ b/Fred2/EpitopePrediction/PSSM.py @@ -1306,15 +1306,18 @@ class MHCFlurryPredictor(APSSMEpitopePrediction): Available at: https://www.cell.com/cell-systems/fulltext/S2405-4712(18)30232-1. """ __alleles = frozenset( - ["A*01:01", "A*02:01", "A*02:02", "A*02:03", "A*02:05", "A*02:06", "A*02:07", "A*02:11", "A*02:12", - "A*02:16", "A*02:17", "A*02:19", "A*02:50", "A*03:01", "A*11:01", "A*23:01", "A*24:02", "A*24:03", - "A*25:01", "A*26:01", "A*26:02", "A*26:03", "A*29:02", "A*30:01", 'A*30:02', "A*31:01", "A*32:01", - "A*33:01", "A*66:01", "A*68:01", "A*68:02", "A*68:23", "A*69:01", "A*80:01", "B*07:01", "B*07:02", - "B*08:01", "B*08:02", "B*08:03", "B*14:02", "B*15:01", "B*15:02", "B*15:03", "B*15:09", "B*15:17", - "B*18:01", "B*27:02", "B*27:03", "B*27:04", "B*27:05", "B*27:06", "B*35:01", "B*35:03", "B*37:01", - "B*38:01", "B*39:01", "B*39:06", "B*40:01", "B*40:02", "B*42:01", "B*44:02", "B*44:03", "B*45:01", - "B*46:01", "B*48:01", "B*51:01", "B*53:01", "B*54:01", "B*57:01", "B*58:01", "B*83:01", "C*03:03", - "C*04:01", "C*05:01", "C*06:02", "C*07:02", "C*08:02", "C*12:03", "C*14:02", "C*15:02"]) + ["HLA-A*01:01", "HLA-A*02:01", "HLA-A*02:02", "HLA-A*02:03", "HLA-A*02:05", "HLA-A*02:06", "HLA-A*02:07", + "HLA-A*02:11", "HLA-A*02:12", "HLA-A*02:16", "HLA-A*02:17", "HLA-A*02:19", "HLA-A*02:50", "HLA-A*03:01", + "HLA-A*11:01", "HLA-A*23:01", "HLA-A*24:02", "HLA-A*24:03", "HLA-A*25:01", "HLA-A*26:01", "HLA-A*26:02", + "HLA-A*26:03", "HLA-A*29:02", "HLA-A*30:01", 'HLA-A*30:02', "HLA-A*31:01", "HLA-A*32:01", "HLA-A*33:01", + "HLA-A*66:01", "HLA-A*68:01", "HLA-A*68:02", "HLA-A*68:23", "HLA-A*69:01", "HLA-A*80:01", "HLA-B*07:01", + "HLA-B*07:02", "HLA-B*08:01", "HLA-B*08:02", "HLA-B*08:03", "HLA-B*14:02", "HLA-B*15:01", "HLA-B*15:02", + "HLA-B*15:03", "HLA-B*15:09", "HLA-B*15:17", "HLA-B*18:01", "HLA-B*27:02", "HLA-B*27:03", "HLA-B*27:04", + "HLA-B*27:05", "HLA-B*27:06", "HLA-B*35:01", "HLA-B*35:03", "HLA-B*37:01", "HLA-B*38:01", "HLA-B*39:01", + "HLA-B*39:06", "HLA-B*40:01", "HLA-B*40:02", "HLA-B*42:01", "HLA-B*44:02", "HLA-B*44:03", "HLA-B*45:01", + "HLA-B*46:01", "HLA-B*48:01", "HLA-B*51:01", "HLA-B*53:01", "HLA-B*54:01", "HLA-B*57:01", "HLA-B*58:01", + "HLA-B*83:01", "HLA-C*03:03", "HLA-C*04:01", "HLA-C*05:01", "HLA-C*06:02", "HLA-C*07:02", "HLA-C*08:02", + "HLA-C*12:03", "HLA-C*14:02", "HLA-C*15:02"]) __supported_length = [8, 9, 10, 11, 12, 13, 14, 15] __name = "mhcflurry" __version = "1.2.2" From d2403cf18d67fccda30d080346ac22e8db73f358 Mon Sep 17 00:00:00 2001 From: Zethson Date: Sun, 12 May 2019 16:21:10 +0200 Subject: [PATCH 05/16] [FEATURE] __supported_length now with frozensets --- Fred2/EpitopePrediction/PSSM.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Fred2/EpitopePrediction/PSSM.py b/Fred2/EpitopePrediction/PSSM.py index e6266926..528b200f 100644 --- a/Fred2/EpitopePrediction/PSSM.py +++ b/Fred2/EpitopePrediction/PSSM.py @@ -1059,7 +1059,7 @@ class MHCNuggetsPredictor_1(APSSMEpitopePrediction): "HLA-B51:02", "HLA-B52:01", "HLA-B53:01", "HLA-B54:01", "HLA-B55:01", "HLA-B55:02", "HLA-B56:01", "HLA-B57:01", "HLA-B57:02", "HLA-B57:03", "HLA-B58:01", "HLA-B58:02", "HLA-B60:01", "HLA-B61:01", "HLA-B62:01", "HLA-B73:01", "HLA-B81:01", "HLA-B83:01"]) - __supported_length = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] + __supported_length = frozenset([5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]) __name = "mhcnuggets-class-1" __version = "2.0" @@ -1199,7 +1199,7 @@ class MHCNuggetsPredictor_2(APSSMEpitopePrediction): "HLA-DRB11501", "HLA-DRB11502", "HLA-DRB11503", "HLA-DRB11601", "HLA-DRB11602", "HLA-DRB30101", "HLA-DRB30202", "HLA-DRB30301", "HLA-DRB40101", "HLA-DRB40103", "HLA-DRB50101", "HLA-DRB50102"]) - __supported_length = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25] + __supported_length = frozenset([5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]) __name = "mhcnuggets-class-2" __version = "2.0" @@ -1318,7 +1318,7 @@ class MHCFlurryPredictor(APSSMEpitopePrediction): "HLA-B*46:01", "HLA-B*48:01", "HLA-B*51:01", "HLA-B*53:01", "HLA-B*54:01", "HLA-B*57:01", "HLA-B*58:01", "HLA-B*83:01", "HLA-C*03:03", "HLA-C*04:01", "HLA-C*05:01", "HLA-C*06:02", "HLA-C*07:02", "HLA-C*08:02", "HLA-C*12:03", "HLA-C*14:02", "HLA-C*15:02"]) - __supported_length = [8, 9, 10, 11, 12, 13, 14, 15] + __supported_length = frozenset([8, 9, 10, 11, 12, 13, 14, 15]) __name = "mhcflurry" __version = "1.2.2" From addde4c01f7a152affb4d8243a1f6b32812e9c52 Mon Sep 17 00:00:00 2001 From: Zethson Date: Sun, 12 May 2019 16:26:31 +0200 Subject: [PATCH 06/16] [FEATURE] removed a few unnecessary comments --- Fred2/EpitopePrediction/PSSM.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Fred2/EpitopePrediction/PSSM.py b/Fred2/EpitopePrediction/PSSM.py index 528b200f..1911e679 100644 --- a/Fred2/EpitopePrediction/PSSM.py +++ b/Fred2/EpitopePrediction/PSSM.py @@ -1087,15 +1087,10 @@ def version(self): # the interface defines a function converting Fred2's HLA allele presentation # into an internal presentation used by different methods. # for this predictor we won't need it but still have to provide it! - # the function consumes a list of alleles and converts them into the internally used presentation def convert_alleles(self, alleles): # we just use the identity function return alleles - # additionally the interface defines a function `predict` - # that consumes a list of peptides or a single peptide and optionally a list - # of allele objects - # # this method implements the complete prediction routine def predict(self, peptides, alleles=None, binary=False): @@ -1227,15 +1222,10 @@ def version(self): # the interface defines a function converting Fred2's HLA allele presentation # into an internal presentation used by different methods. # for this predictor we won't need it but still have to provide it! - # the function consumes a list of alleles and converts them into the internally used presentation def convert_alleles(self, alleles): # we just use the identity function return alleles - # additionally the interface defines a function `predict` - # that consumes a list of peptides or a single peptide and optionally a list - # of allele objects - # # this method implements the complete prediction routine def predict(self, peptides, alleles=None, binary=False): @@ -1346,15 +1336,10 @@ def version(self): # the interface defines a function converting Fred2's HLA allele presentation # into an internal presentation used by different methods. # for this predictor we won't need it but still have to provide it! - # the function consumes a list of alleles and converts them into the internally used presentation def convert_alleles(self, alleles): # we just use the identity function return alleles - # additionally the interface defines a function `predict` - # that consumes a list of peptides or a single peptide and optionally a list - # of allele objects - # # this method implements the complete prediction routine def predict(self, peptides, alleles=None, binary=False): From 0d1db6387ecc156ad9dd05229343eda152b170b3 Mon Sep 17 00:00:00 2001 From: Zethson Date: Sun, 12 May 2019 16:31:41 +0200 Subject: [PATCH 07/16] [FIX] formatting --- Fred2/EpitopePrediction/PSSM.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Fred2/EpitopePrediction/PSSM.py b/Fred2/EpitopePrediction/PSSM.py index 1911e679..3eba64c8 100644 --- a/Fred2/EpitopePrediction/PSSM.py +++ b/Fred2/EpitopePrediction/PSSM.py @@ -1178,11 +1178,9 @@ class MHCNuggetsPredictor_2(APSSMEpitopePrediction): "HLA-DQB10302", "HLA-DQB10319", "HLA-DQB10402", "HLA-DQB10501", "HLA-DQB10502", "HLA-DQB10503", "HLA-DQB10602", "HLA-DQB10603", "HLA-DQB10604", "HLA-DRA0101-DRB10101", "HLA-DRA0101-DRB10301", "HLA-DRA0101-DRB10401", "HLA-DRA0101-DRB10404", - "HLA-DRA0101-DRB10701", - "HLA-DRA0101-DRB10801", "HLA-DRA0101-DRB10901", "HLA-DRA0101-DRB11101", - "HLA-DRA0101-DRB11301", - "HLA-DRA0101-DRB11454", "HLA-DRA0101-DRB11501", "HLA-DRA0101-DRB30101", - "HLA-DRA0101-DRB30202", + "HLA-DRA0101-DRB10701", "HLA-DRA0101-DRB10801", "HLA-DRA0101-DRB10901", + "HLA-DRA0101-DRB11101", "HLA-DRA0101-DRB11301", "HLA-DRA0101-DRB11454", + "HLA-DRA0101-DRB11501", "HLA-DRA0101-DRB30101", "HLA-DRA0101-DRB30202", "HLA-DRA0101-DRB30301", "HLA-DRA0101-DRB40103", "HLA-DRA0101-DRB50101", "HLA-DRB10101", "HLA-DRB10102", "HLA-DRB10103", "HLA-DRB10301", "HLA-DRB10302", "HLA-DRB10303", "HLA-DRB10304", "HLA-DRB10305", "HLA-DRB10401", "HLA-DRB10402", "HLA-DRB10403", From 13ed72817ed4d048c8176bd9a1319ce5fd6cb8ee Mon Sep 17 00:00:00 2001 From: Zethson Date: Sun, 12 May 2019 16:40:02 +0200 Subject: [PATCH 08/16] [FIX] comment --- Fred2/EpitopePrediction/PSSM.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Fred2/EpitopePrediction/PSSM.py b/Fred2/EpitopePrediction/PSSM.py index 3eba64c8..1f48ed96 100644 --- a/Fred2/EpitopePrediction/PSSM.py +++ b/Fred2/EpitopePrediction/PSSM.py @@ -1352,7 +1352,7 @@ def predict(self, peptides, alleles=None, binary=False): # filter for supported alleles alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) - # test mhcflurry models are available => download if not + # test whether mhcflurry models are available => download if not p = subprocess.Popen(['mhcflurry-downloads', 'path', 'models_class1'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) if p is not 0: From 9c813ae6402fdd90d118f07626076e3f9be9957f Mon Sep 17 00:00:00 2001 From: Zethson Date: Mon, 13 May 2019 19:30:55 +0200 Subject: [PATCH 09/16] [FEATURE][FIX] Added ANN interface + mhcnuggets-2 allele names --- Fred2/EpitopePrediction/ANN.py | 464 ++++++++++++++++++++++++++++ Fred2/EpitopePrediction/PSSM.py | 353 --------------------- Fred2/EpitopePrediction/__init__.py | 1 + 3 files changed, 465 insertions(+), 353 deletions(-) create mode 100644 Fred2/EpitopePrediction/ANN.py diff --git a/Fred2/EpitopePrediction/ANN.py b/Fred2/EpitopePrediction/ANN.py new file mode 100644 index 00000000..4b47215b --- /dev/null +++ b/Fred2/EpitopePrediction/ANN.py @@ -0,0 +1,464 @@ +# coding=utf-8 +# This code is part of the Fred2 distribution and governed by its +# license. Please see the LICENSE file that should have been included +# as part of this package. +""" +.. module:: EpitopePrediction.ANN + :synopsis: This module contains all classes for ANN-based epitope prediction. +.. moduleauthor:: heumos + +""" +import itertools +import warnings +import subprocess +import csv +import tempfile +import pandas + +from mhcflurry import Class1AffinityPredictor +from mhcnuggets.src.predict import predict +from Fred2.Core import EpitopePredictionResult +from Fred2.Core.Allele import Allele +from Fred2.Core.Peptide import Peptide +from Fred2.Core.Base import AEpitopePrediction + + +class AANNEpitopePrediction(AEpitopePrediction): + """ + Abstract base class for ANN predictions. + Implements predict functionality + """ + + def predict(self, peptides, alleles=None, **kwargs): + """ + Returns predictions for given peptides an :class:`~Fred2.Core.Allele.Allele`. If no + :class:`~Fred2.Core.Allele.Allele` are given, predictions for all available models are made. + + :param peptides: A single :class:`~Fred2.Core.Peptide.Peptide` or a list of :class:`~Fred2.Core.Peptide.Peptide` + :type peptides: list(:class:`~Fred2.Core.Peptide.Peptide`) or :class:`~Fred2.Core.Peptide.Peptide` + :param alleles: A list of :class:`~Fred2.Core.Allele.Allele` + :type alleles: list(:class:`~Fred2.Core.Allele.Allele`) or class:`~Fred2.Core.Allele.Allele` + :param kwargs: optional parameter (not used yet) + :return: Returns a :class:`~Fred2.Core.Result.EpitopePredictionResult` object with the prediction results + :rtype: :class:`~Fred2.Core.Result.EpitopePredictionResult` + """ + + def __load_allele_model(allele, length): + return allele + + if isinstance(peptides, Peptide): + pep_seqs = {str(peptides): peptides} + else: + pep_seqs = {} + for p in peptides: + if not isinstance(p, Peptide): + raise ValueError("Input is not of type Protein or Peptide") + pep_seqs[str(p)] = p + + if alleles is None: + al = [Allele(a) for a in self.supportedAlleles] + alleles_string = {conv_a: a for conv_a, a in itertools.izip(self.convert_alleles(al), al)} + else: + if isinstance(alleles, Allele): + alleles = [alleles] + if any(not isinstance(p, Allele) for p in alleles): + raise ValueError("Input is not of type Allele") + alleles_string = {conv_a: a for conv_a, a in itertools.izip(self.convert_alleles(alleles), alleles)} + + result = {} + pep_groups = pep_seqs.keys() + pep_groups.sort(key=len) + for length, peps in itertools.groupby(pep_groups, key=len): + + if self.supportedLength is not None and length not in self.supportedLength: + warnings.warn("Peptide length of %i is not supported by %s" % (length, self.name)) + continue + + for a in alleles_string.keys(): + if self.supportedAlleles is not None and a not in self.supportedAlleles: + warnings.warn("Allele %i is not supported by %s" % (a, self.name)) + + if not result: + raise ValueError("No predictions could be made with " + self.name + " for given input." + " Check your epitope length and HLA allele combination.") + + df_result = EpitopePredictionResult.from_dict(result) + df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], + names=['Seq', 'Method']) + return df_result + + +class MHCNuggetsPredictor_1(AANNEpitopePrediction): + """ + Implements MHCNuggets Class I + + .. note:: + Evaluation of machine learning methods to predict peptide binding to MHC Class I proteins + Rohit Bhattacharya, Ashok Sivakumar, Collin Tokheim, Violeta Beleva Guthrie, Valsamo Anagnostou, + Victor E. Velculescu, Rachel Karchin (2017) bioRxiv + """ + __alleles = frozenset( + ["HLA-A01:01", "HLA-A02:01", "HLA-A02:02", "HLA-A02:03", "HLA-A02:04", "HLA-A02:05", "HLA-A02:06", + "HLA-A02:07", "HLA-A02:08", "HLA-A02:09", "HLA-A02:10", "HLA-A02:11", "HLA-A02:12", "HLA-A02:14", + "HLA-A02:16", "HLA-A02:17", "HLA-A02:19", "HLA-A02:50", "HLA-A03:01", "HLA-A03:02", "HLA-A03:19", + "HLA-A11:01", "HLA-A11:02", "HLA-A23:01", "HLA-A24:01", "HLA-A24:02", "HLA-A24:03", "HLA-A25:01", + "HLA-A26:01", "HLA-A26:02", "HLA-A26:03", "HLA-A29:01", "HLA-A29:02", "HLA-A30:01", "HLA-A30:02", + "HLA-A30:03", "HLA-A30:04", "HLA-A31:01", "HLA-A32:01", "HLA-A32:07", "HLA-A32:15", "HLA-A33:01", + "HLA-A33:03", "HLA-A66:01", "HLA-A68:01", "HLA-A68:02", "HLA-A68:23", "HLA-A69:01", "HLA-A74:01", + "HLA-A80:01", "HLA-B07:01", "HLA-B07:02", "HLA-B08:01", "HLA-B08:02", "HLA-B08:03", "HLA-B12:01", + "HLA-B13:02", "HLA-B14:01", "HLA-B14:02", "HLA-B15:01", "HLA-B15:02", "HLA-B15:03", "HLA-B15:08", + "HLA-B15:09", "HLA-B15:10", "HLA-B15:13", "HLA-B15:16", "HLA-B15:17", "HLA-B15:42", "HLA-B18:01", + "HLA-B27:01", "HLA-B27:02", "HLA-B27:03", "HLA-B27:04", "HLA-B27:05", "HLA-B27:06", "HLA-B27:09", + "HLA-B27:10", "HLA-B27:20", "HLA-B35:01", "HLA-B35:02", "HLA-B35:03", "HLA-B35:08", "HLA-B37:01", + "HLA-B38:01", "HLA-B39:01", "HLA-B39:06", "HLA-B39:09", "HLA-B39:10", "HLA-B40:01", "HLA-B40:02", + "HLA-B40:13", "HLA-B41:03", "HLA-B41:04", "HLA-B42:01", "HLA-B42:02", "HLA-B44:01", "HLA-B44:02", + "HLA-B44:03", "HLA-B44:05", "HLA-B45:01", "HLA-B45:06", "HLA-B46:01", "HLA-B48:01", "HLA-B51:01", + "HLA-B51:02", "HLA-B52:01", "HLA-B53:01", "HLA-B54:01", "HLA-B55:01", "HLA-B55:02", "HLA-B56:01", + "HLA-B57:01", "HLA-B57:02", "HLA-B57:03", "HLA-B58:01", "HLA-B58:02", "HLA-B60:01", "HLA-B61:01", + "HLA-B62:01", "HLA-B73:01", "HLA-B81:01", "HLA-B83:01"]) + __supported_length = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] + __name = "mhcnuggets-class-1" + __version = "2.0" + + # the interface defines three class properties + @property + def name(self): + # retunrs the name of the predictor + return self.__name + + @property + def supportedAlleles(self): + # returns the supported alleles as strings (without the HLA prefix) + return self.__alleles + + @property + def supportedLength(self): + # returns the supported epitope lengths as iterable + return self.__supported_length + + @property + def version(self): + # returns the version of the predictor + return self.__version + + # the interface defines a function converting Fred2's HLA allele presentation + # into an internal presentation used by different methods. + # for this predictor we won't need it but still have to provide it! + # the function consumes a list of alleles and converts them into the internally used presentation + def convert_alleles(self, alleles): + # we just use the identity function + return alleles + + # additionally the interface defines a function `predict` + # that consumes a list of peptides or a single peptide and optionally a list + # of allele objects + # + # this method implements the complete prediction routine + def predict(self, peptides, alleles=None, binary=False): + + # test whether one peptide or a list + if isinstance(peptides, basestring): + peptides = list(peptides) + + # if no alleles are specified do predictions for all supported alleles + if alleles is None: + alleles = self.supportedAlleles + else: + # filter for supported alleles + alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) + + result = {} + + # fetch peptides as strings + peptides = [str(peptide) for peptide in peptides] + + # write peptides temporarily, new line separated + tmp_input_file = tempfile.NamedTemporaryFile().name + with open(tmp_input_file, 'wb') as file: + for peptide in peptides: + file.write(peptide + "\n") + + # predict bindings + for a in alleles: + result[a] = {} + tmp_output_file = tempfile.NamedTemporaryFile().name + predict(class_='I', + peptides_path=tmp_input_file, + mhc=a, + output=tmp_output_file + a) + + # read predicted binding affinities back + with open(tmp_output_file + a, 'rb') as csvfile: + reader = csv.reader(csvfile, delimiter=' ', quotechar='|') + # skip header + reader.next() + + for row in reader: + content = row[0].split(',') + peptide = content[0] + binding_affinity = content[1] + if binary: + if binding_affinity <= 500: + result[a][peptide] = 1.0 + else: + result[a][peptide] = 0.0 + else: + result[a][peptide] = binding_affinity + + # create EpitopePredictionResult object. This is a multi-indexed DataFrame + # with Peptide and Method as multi-index and alleles as columns + df_result = EpitopePredictionResult.from_dict(result) + df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], + names=['Seq', 'Method']) + return df_result + + +class MHCNuggetsPredictor_2(AANNEpitopePrediction): + """ + Implements MHCNuggets Class II + + .. note:: + Evaluation of machine learning methods to predict peptide binding to MHC Class I proteins + Rohit Bhattacharya, Ashok Sivakumar, Collin Tokheim, Violeta Beleva Guthrie, Valsamo Anagnostou, + Victor E. Velculescu, Rachel Karchin (2017) bioRxiv + """ + __alleles = frozenset(["HLA-DPA1*01:03-DPB1*02:01", "HLA-DPA1*01:03-DPB1*03:01", "HLA-DPA1*01:03-DPB1*04:01", + "HLA-DPA1*01:03-DPB1*04:02", "HLA-DPA1*02:01-DPB1*01:01", "HLA-DPA1*02:01-DPB1*05:01", + "HLA-DPA1*02:02-DPB1*05:01", "HLA-DPA10301-DPB1*04:02", "HLA-DPB1*01:01", "HLA-DPB1*02:01", + "HLA-DPB1*03:01", "HLA-DPB1*04:01", "HLA-DPB1*04:02", "HLA-DPB1*05:01", "HLA-DPB1*09:01", + "HLA-DPB1*11:01", "HLA-DPB1*14:01", "HLA-DPB1*20:01", "HLA-DQA1*01:01", + "HLA-DQA1*01:01-DQB10501", "HLA-DQA1*01:01-DQB1*05:03", "HLA-DQA1*01:02", + "HLA-DQA1*01:02-DQB1*05:01", "HLA-DQA1*01:02-DQB10502", "HLA-DQA1*01:02-DQB1*06:02", + "HLA-DQA1*01:02-DQB1*06:04", "HLA-DQA1*01:03-DQB10302", "HLA-DQA1*01:03-DQB1*06:01", + "HLA-DQA1*01:03-DQB1*06:03", "HLA-DQA1*01:04-DQB10503", "HLA-DQA1*02:01-DQB1*02:01", + "HLA-DQA1*02:01-DQB1*02:02", "HLA-DQA1*02:01-DQB10301", "HLA-DQA1*02:01-DQB1*03:03", + "HLA-DQA1*02:01-DQB1*04:02", "HLA-DQA1*03:01", "HLA-DQA1*03:01-DQB1*02:01", + "HLA-DQA1*03:01-DQB1*03:01", "HLA-DQA1*03:01-DQB1*03:02", "HLA-DQA1*03:01-DQB10401", + "HLA-DQA1*03:02-DQB10301", "HLA-DQA1*03:02-DQB1*03:03", "HLA-DQA1*03:02-DQB10401", + "HLA-DQA1*03:03-DQB10402", "HLA-DQA1*04:01-DQB1*04:02", "HLA-DQA1*05:01", + "HLA-DQA1*05:01-DQB1*02:01", "HLA-DQA1*05:01-DQB1*03:01", "HLA-DQA1*05:01-DQB1*03:02", + "HLA-DQA1*05:01-DQB10303", "HLA-DQA1*05:01-DQB10402", "HLA-DQA1*05:05-DQB1*03:01", + "HLA-DQA1*06:01-DQB10402", "HLA-DQB1*02:01", "HLA-DQB1*02:02", "HLA-DQB1*03:01", + "HLA-DQB1*03:02", "HLA-DQB1*03:19", "HLA-DQB1*04:02", "HLA-DQB1*05:01", "HLA-DQB1*05:02", + "HLA-DQB1*05:03", "HLA-DQB1*06:02", "HLA-DQB1*06:03", "HLA-DQB1*06:04", + "HLA-DRA0*10:1-DRB1*01:01", "HLA-DRA0*10:1-DRB1*03:01", "HLA-DRA0*10:1-DRB1*04:01", + "HLA-DRA0*10:1-DRB1*04:04", "HLA-DRA01*01-DRB1*07:01", "HLA-DRA0*10:1-DRB1*08:01", + "HLA-DRA0*10:1-DRB1*09:01", "HLA-DRA0*10:1-DRB1*11:01", "HLA-DRA01*01-DRB1*13:01", + "HLA-DRA0*10:1-DRB1*14:54", "HLA-DRA0*10:1-DRB1*15:01", "HLA-DRA0*10:1-DRB3*01:01", + "HLA-DRA01*01-DRB3*02:02", "HLA-DRA0*10:1-DRB3*03:01", "HLA-DRA0*10:1-DRB4*01:03", + "HLA-DRA0*10:1-DRB5*01:01", "HLA-DRB10*10:1", "HLA-DRB1*01:02", "HLA-DRB1*01:03", + "HLA-DRB1*03:01", "HLA-DRB1*03:02", "HLA-DRB1*03:03", "HLA-DRB1*03:04", "HLA-DRB1*03:05", + "HLA-DRB1*04:01", "HLA-DRB1*04:02", "HLA-DRB1*04:03", "HLA-DRB1*04:04", "HLA-DRB1*04:05", + "HLA-DRB1*04:06", "HLA-DRB1*04:07", "HLA-DRB1*04:11", "HLA-DRB1*07:01", "HLA-DRB1*08:01", + "HLA-DRB1*08:02", "HLA-DRB1*08:03", "HLA-DRB1*08:04", "HLA-DRB1*09:01", "HLA-DRB1*10:01", + "HLA-DRB1*11:01", "HLA-DRB1*11:02", "HLA-DRB1*11:03", "HLA-DRB1*11:04", "HLA-DRB1*12:01", + "HLA-DRB1*12:02", "HLA-DRB1*13:01", "HLA-DRB1*13:02", "HLA-DRB1*13:03", "HLA-DRB1*13:04", + "HLA-DRB1*13:05", "HLA-DRB1*14:01", "HLA-DRB1*14:02", "HLA-DRB1*15:01", "HLA-DRB1*15:02", + "HLA-DRB1*15:03", "HLA-DRB1*16:01", "HLA-DRB1*16:02", "HLA-DRB3*01:01", "HLA-DRB3*02:02", + "HLA-DRB3*03:01", "HLA-DRB4*01:01", "HLA-DRB4*01:03", "HLA-DRB5*01:01", "HLA-DRB5*01:02"]) + __supported_length = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25] + __name = "mhcnuggets-class-2" + __version = "2.0" + + # the interface defines three class properties + @property + def name(self): + # returns the name of the predictor + return self.__name + + @property + def supportedAlleles(self): + # returns the supported alleles as strings (without the HLA prefix) + return self.__alleles + + @property + def supportedLength(self): + # returns the supported epitope lengths as iterable + return self.__supported_length + + @property + def version(self): + # returns the version of the predictor + return self.__version + + # the interface defines a function converting Fred2's HLA allele presentation + # into an internal presentation used by different methods. + # for this predictor we won't need it but still have to provide it! + # the function consumes a list of alleles and converts them into the internally used presentation + def convert_alleles(self, alleles): + return [allele.replace(':', '').replace('*', '') for allele in alleles] + + # additionally the interface defines a function `predict` + # that consumes a list of peptides or a single peptide and optionally a list + # of allele objects + # + # this method implements the complete prediction routine + def predict(self, peptides, alleles=None, binary=False): + + # test whether one peptide or a list + if isinstance(peptides, basestring): + peptides = list(peptides) + + # if no alleles are specified do predictions for all supported alleles + if alleles is None: + alleles = self.supportedAlleles + else: + # filter for supported alleles + alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) + + result = {} + + # fetch peptides as strings + peptides = [str(peptide) for peptide in peptides] + + # write peptides temporarily, new line separated + tmp_input_file = tempfile.NamedTemporaryFile().name + with open(tmp_input_file, 'wb') as file: + for peptide in peptides: + file.write(peptide + "\n") + + # predict bindings + for a in alleles: + result[a] = {} + tmp_output_file = tempfile.NamedTemporaryFile().name + + predict(class_='II', + peptides_path=tmp_input_file, + mhc=a, + output=tmp_output_file + a) + + # read predicted binding affinities back + with open(tmp_output_file + a, 'rb') as csvfile: + reader = csv.reader(csvfile, delimiter=' ', quotechar='|') + # skip header + reader.next() + + for row in reader: + content = row[0].split(',') + peptide = content[0] + binding_affinity = content[1] + if binary: + if binding_affinity <= 500: + result[a][peptide] = 1.0 + else: + result[a][peptide] = 0.0 + else: + result[a][peptide] = binding_affinity + + # create EpitopePredictionResult object. This is a multi-indexed DataFrame + # with Peptide and Method as multi-index and alleles as columns + df_result = EpitopePredictionResult.from_dict(result) + df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], + names=['Seq', 'Method']) + return df_result + + +class MHCFlurryPredictor(AANNEpitopePrediction): + """ + Implements MHCFlurry + + .. note:: + T. J. O’Donnell, A. Rubinsteyn, M. Bonsack, A. B. Riemer, U. Laserson, and J. Hammerbacher, + "MHCflurry: Open-Source Class I MHC Binding Affinity Prediction," Cell Systems, 2018. + Available at: https://www.cell.com/cell-systems/fulltext/S2405-4712(18)30232-1. + """ + __alleles = frozenset( + ["HLA-A*01:01", "HLA-A*02:01", "HLA-A*02:02", "HLA-A*02:03", "HLA-A*02:05", "HLA-A*02:06", "HLA-A*02:07", + "HLA-A*02:11", "HLA-A*02:12", + "HLA-A*02:16", "HLA-A*02:17", "HLA-A*02:19", "HLA-A*02:50", "HLA-A*03:01", "HLA-A*11:01", "HLA-A*23:01", + "HLA-A*24:02", "HLA-A*24:03", + "HLA-A*25:01", "HLA-A*26:01", "HLA-A*26:02", "HLA-A*26:03", "HLA-A*29:02", "HLA-A*30:01", 'HLA-A*30:02', + "HLA-A*31:01", "HLA-A*32:01", + "HLA-A*33:01", "HLA-A*66:01", "HLA-A*68:01", "HLA-A*68:02", "HLA-A*68:23", "HLA-A*69:01", "HLA-A*80:01", + "HLA-B*07:01", "HLA-B*07:02", + "HLA-B*08:01", "HLA-B*08:02", "HLA-B*08:03", "HLA-B*14:02", "HLA-B*15:01", "HLA-B*15:02", "HLA-B*15:03", + "HLA-B*15:09", "HLA-B*15:17", + "HLA-B*18:01", "HLA-B*27:02", "HLA-B*27:03", "HLA-B*27:04", "HLA-B*27:05", "HLA-B*27:06", "HLA-B*35:01", + "HLA-B*35:03", "HLA-B*37:01", + "HLA-B*38:01", "HLA-B*39:01", "HLA-B*39:06", "HLA-B*40:01", "HLA-B*40:02", "HLA-B*42:01", "HLA-B*44:02", + "HLA-B*44:03", "HLA-B*45:01", + "HLA-B*46:01", "HLA-B*48:01", "HLA-B*51:01", "HLA-B*53:01", "HLA-B*54:01", "HLA-B*57:01", "HLA-B*58:01", + "HLA-B*83:01", "HLA-C*03:03", + "HLA-C*04:01", "HLA-C*05:01", "HLA-C*06:02", "HLA-C*07:02", "HLA-C*08:02", "HLA-C*12:03", "HLA-C*14:02", + "HLA-C*15:02"]) + __supported_length = [8, 9, 10, 11, 12, 13, 14, 15] + __name = "mhcflurry" + __version = "1.2.2" + + # the interface defines three class properties + @property + def name(self): + # returns the name of the predictor + return self.__name + + @property + def supportedAlleles(self): + # returns the supported alleles as strings (without the HLA prefix) + return self.__alleles + + @property + def supportedLength(self): + # returns the supported epitope lengths as iterable + return self.__supported_length + + @property + def version(self): + # returns the version of the predictor + return self.__version + + # the interface defines a function converting Fred2's HLA allele presentation + # into an internal presentation used by different methods. + # for this predictor we won't need it but still have to provide it! + # the function consumes a list of alleles and converts them into the internally used presentation + def convert_alleles(self, alleles): + # we just use the identity function + return alleles + + # additionally the interface defines a function `predict` + # that consumes a list of peptides or a single peptide and optionally a list + # of allele objects + # + # this method implements the complete prediction routine + def predict(self, peptides, alleles=None, binary=False): + + # test whether one peptide or a list + if isinstance(peptides, basestring): + peptides = list(peptides) + + # if no alleles are specified do predictions for all supported alleles + if alleles is None: + alleles = self.supportedAlleles + else: + # filter for supported alleles + alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) + + # test mhcflurry models are available => download if not + p = subprocess.Popen(['mhcflurry-downloads', 'path', 'models_class1'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if p is not 0: + subprocess.call(['mhcflurry-downloads', 'fetch', 'models_class1']) + + # load model + predictor = Class1AffinityPredictor.load() + + result = {} + + for a in alleles: + result[a] = {} + for p in peptides: + seq = p.__str__() + binding_affinity = predictor.predict(allele=a, peptides=[seq]) + if binary: + if binding_affinity <= 500: + result[a][p] = 1.0 + else: + result[a][p] = 0.0 + else: + result[a][p] = binding_affinity + + # create EpitopePredictionResult object. This is a multi-indexed DataFrame + # with Peptide and Method as multi-index and alleles as columns + df_result = EpitopePredictionResult.from_dict(result) + df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], + names=['Seq', 'Method']) + return df_result diff --git a/Fred2/EpitopePrediction/PSSM.py b/Fred2/EpitopePrediction/PSSM.py index 1f48ed96..6fbdb7a3 100644 --- a/Fred2/EpitopePrediction/PSSM.py +++ b/Fred2/EpitopePrediction/PSSM.py @@ -1029,356 +1029,3 @@ def __load_allele_model(allele, length): def convert_alleles(self, alleles): return map(lambda x: x.name.replace("*", "").replace(":", ""), alleles) - - -class MHCNuggetsPredictor_1(APSSMEpitopePrediction): - """ - Implements MHCNuggets Class I - - .. note:: - Evaluation of machine learning methods to predict peptide binding to MHC Class I proteins - Rohit Bhattacharya, Ashok Sivakumar, Collin Tokheim, Violeta Beleva Guthrie, Valsamo Anagnostou, - Victor E. Velculescu, Rachel Karchin (2017) bioRxiv - """ - __alleles = frozenset( - ["HLA-A01:01", "HLA-A02:01", "HLA-A02:02", "HLA-A02:03", "HLA-A02:04", "HLA-A02:05", "HLA-A02:06", - "HLA-A02:07", "HLA-A02:08", "HLA-A02:09", "HLA-A02:10", "HLA-A02:11", "HLA-A02:12", "HLA-A02:14", - "HLA-A02:16", "HLA-A02:17", "HLA-A02:19", "HLA-A02:50", "HLA-A03:01", "HLA-A03:02", "HLA-A03:19", - "HLA-A11:01", "HLA-A11:02", "HLA-A23:01", "HLA-A24:01", "HLA-A24:02", "HLA-A24:03", "HLA-A25:01", - "HLA-A26:01", "HLA-A26:02", "HLA-A26:03", "HLA-A29:01", "HLA-A29:02", "HLA-A30:01", "HLA-A30:02", - "HLA-A30:03", "HLA-A30:04", "HLA-A31:01", "HLA-A32:01", "HLA-A32:07", "HLA-A32:15", "HLA-A33:01", - "HLA-A33:03", "HLA-A66:01", "HLA-A68:01", "HLA-A68:02", "HLA-A68:23", "HLA-A69:01", "HLA-A74:01", - "HLA-A80:01", "HLA-B07:01", "HLA-B07:02", "HLA-B08:01", "HLA-B08:02", "HLA-B08:03", "HLA-B12:01", - "HLA-B13:02", "HLA-B14:01", "HLA-B14:02", "HLA-B15:01", "HLA-B15:02", "HLA-B15:03", "HLA-B15:08", - "HLA-B15:09", "HLA-B15:10", "HLA-B15:13", "HLA-B15:16", "HLA-B15:17", "HLA-B15:42", "HLA-B18:01", - "HLA-B27:01", "HLA-B27:02", "HLA-B27:03", "HLA-B27:04", "HLA-B27:05", "HLA-B27:06", "HLA-B27:09", - "HLA-B27:10", "HLA-B27:20", "HLA-B35:01", "HLA-B35:02", "HLA-B35:03", "HLA-B35:08", "HLA-B37:01", - "HLA-B38:01", "HLA-B39:01", "HLA-B39:06", "HLA-B39:09", "HLA-B39:10", "HLA-B40:01", "HLA-B40:02", - "HLA-B40:13", "HLA-B41:03", "HLA-B41:04", "HLA-B42:01", "HLA-B42:02", "HLA-B44:01", "HLA-B44:02", - "HLA-B44:03", "HLA-B44:05", "HLA-B45:01", "HLA-B45:06", "HLA-B46:01", "HLA-B48:01", "HLA-B51:01", - "HLA-B51:02", "HLA-B52:01", "HLA-B53:01", "HLA-B54:01", "HLA-B55:01", "HLA-B55:02", "HLA-B56:01", - "HLA-B57:01", "HLA-B57:02", "HLA-B57:03", "HLA-B58:01", "HLA-B58:02", "HLA-B60:01", "HLA-B61:01", - "HLA-B62:01", "HLA-B73:01", "HLA-B81:01", "HLA-B83:01"]) - __supported_length = frozenset([5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]) - __name = "mhcnuggets-class-1" - __version = "2.0" - - # the interface defines three class properties - @property - def name(self): - # retunrs the name of the predictor - return self.__name - - @property - def supportedAlleles(self): - # returns the supported alleles as strings (without the HLA prefix) - return self.__alleles - - @property - def supportedLength(self): - # returns the supported epitope lengths as iterable - return self.__supported_length - - @property - def version(self): - # returns the version of the predictor - return self.__version - - # the interface defines a function converting Fred2's HLA allele presentation - # into an internal presentation used by different methods. - # for this predictor we won't need it but still have to provide it! - def convert_alleles(self, alleles): - # we just use the identity function - return alleles - - # this method implements the complete prediction routine - def predict(self, peptides, alleles=None, binary=False): - - # test whether one peptide or a list - if isinstance(peptides, basestring): - peptides = list(peptides) - - # if no alleles are specified do predictions for all supported alleles - if alleles is None: - alleles = self.supportedAlleles - else: - # filter for supported alleles - alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) - - # fetch peptides as strings - peptides = [str(peptide) for peptide in peptides] - - # write peptides temporarily, new line separated - tmp_input_file = tempfile.NamedTemporaryFile().name - with open(tmp_input_file, 'wb') as file: - for peptide in peptides: - file.write(peptide + "\n") - - # predict bindings - result = {} - for a in alleles: - result[a] = {} - tmp_output_file = tempfile.NamedTemporaryFile().name - predict(class_='I', - peptides_path=tmp_input_file, - mhc=a, - output=tmp_output_file + a) - - # read predicted binding affinities back - with open(tmp_output_file + a, 'rb') as csvfile: - reader = csv.reader(csvfile, delimiter=' ', quotechar='|') - # skip header - reader.next() - - for row in reader: - content = row[0].split(',') - peptide = content[0] - binding_affinity = content[1] - if binary: - if binding_affinity <= 500: - result[a][peptide] = 1.0 - else: - result[a][peptide] = 0.0 - else: - result[a][peptide] = binding_affinity - - # create EpitopePredictionResult object. This is a multi-indexed DataFrame - # with Peptide and Method as multi-index and alleles as columns - df_result = EpitopePredictionResult.from_dict(result) - df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], - names=['Seq', 'Method']) - return df_result - - -class MHCNuggetsPredictor_2(APSSMEpitopePrediction): - """ - Implements MHCNuggets Class II - - .. note:: - Evaluation of machine learning methods to predict peptide binding to MHC Class I proteins - Rohit Bhattacharya, Ashok Sivakumar, Collin Tokheim, Violeta Beleva Guthrie, Valsamo Anagnostou, - Victor E. Velculescu, Rachel Karchin (2017) bioRxiv - """ - __alleles = frozenset(["HLA-DPA10103-DPB10201", "HLA-DPA10103-DPB10301", "HLA-DPA10103-DPB10401", - "HLA-DPA10103-DPB10402", "HLA-DPA10201-DPB10101", "HLA-DPA10201-DPB10501", - "HLA-DPA10202-DPB10501", "HLA-DPA10301-DPB10402", "HLA-DPB10101", "HLA-DPB10201", - "HLA-DPB10301", "HLA-DPB10401", "HLA-DPB10402", "HLA-DPB10501", "HLA-DPB10901", - "HLA-DPB11101", "HLA-DPB11401", "HLA-DPB12001", "HLA-DQA10101", - "HLA-DQA10101-DQB10501", "HLA-DQA10101-DQB10503", "HLA-DQA10102", "HLA-DQA10102-DQB10501", - "HLA-DQA10102-DQB10502", "HLA-DQA10102-DQB10602", "HLA-DQA10102-DQB10604", - "HLA-DQA10103-DQB10302", "HLA-DQA10103-DQB10601", "HLA-DQA10103-DQB10603", - "HLA-DQA10104-DQB10503", "HLA-DQA10201-DQB10201", "HLA-DQA10201-DQB10202", - "HLA-DQA10201-DQB10301", "HLA-DQA10201-DQB10303", "HLA-DQA10201-DQB10402", - "HLA-DQA10301", "HLA-DQA10301-DQB10201", "HLA-DQA10301-DQB10301", "HLA-DQA10301-DQB10302", - "HLA-DQA10301-DQB10401", "HLA-DQA10302-DQB10301", "HLA-DQA10302-DQB10303", - "HLA-DQA10302-DQB10401", "HLA-DQA10303-DQB10402", "HLA-DQA10401-DQB10402", - "HLA-DQA10501", "HLA-DQA10501-DQB10201", "HLA-DQA10501-DQB10301", "HLA-DQA10501-DQB10302", - "HLA-DQA10501-DQB10303", "HLA-DQA10501-DQB10402", "HLA-DQA10505-DQB10301", - "HLA-DQA10601-DQB10402", "HLA-DQB10201", "HLA-DQB10202", "HLA-DQB10301", - "HLA-DQB10302", "HLA-DQB10319", "HLA-DQB10402", "HLA-DQB10501", "HLA-DQB10502", - "HLA-DQB10503", "HLA-DQB10602", "HLA-DQB10603", "HLA-DQB10604", "HLA-DRA0101-DRB10101", - "HLA-DRA0101-DRB10301", "HLA-DRA0101-DRB10401", "HLA-DRA0101-DRB10404", - "HLA-DRA0101-DRB10701", "HLA-DRA0101-DRB10801", "HLA-DRA0101-DRB10901", - "HLA-DRA0101-DRB11101", "HLA-DRA0101-DRB11301", "HLA-DRA0101-DRB11454", - "HLA-DRA0101-DRB11501", "HLA-DRA0101-DRB30101", "HLA-DRA0101-DRB30202", - "HLA-DRA0101-DRB30301", "HLA-DRA0101-DRB40103", "HLA-DRA0101-DRB50101", "HLA-DRB10101", - "HLA-DRB10102", "HLA-DRB10103", "HLA-DRB10301", "HLA-DRB10302", "HLA-DRB10303", - "HLA-DRB10304", "HLA-DRB10305", "HLA-DRB10401", "HLA-DRB10402", "HLA-DRB10403", - "HLA-DRB10404", "HLA-DRB10405", "HLA-DRB10406", "HLA-DRB10407", "HLA-DRB10411", - "HLA-DRB10701", "HLA-DRB10801", "HLA-DRB10802", "HLA-DRB10803", "HLA-DRB10804", - "HLA-DRB10901", "HLA-DRB11001", "HLA-DRB11101", "HLA-DRB11102", "HLA-DRB11103", - "HLA-DRB11104", "HLA-DRB11201", "HLA-DRB11202", "HLA-DRB11301", "HLA-DRB11302", - "HLA-DRB11303", "HLA-DRB11304", "HLA-DRB11305", "HLA-DRB11401", "HLA-DRB11402", - "HLA-DRB11501", "HLA-DRB11502", "HLA-DRB11503", "HLA-DRB11601", "HLA-DRB11602", - "HLA-DRB30101", "HLA-DRB30202", "HLA-DRB30301", "HLA-DRB40101", - "HLA-DRB40103", "HLA-DRB50101", "HLA-DRB50102"]) - __supported_length = frozenset([5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]) - __name = "mhcnuggets-class-2" - __version = "2.0" - - # the interface defines three class properties - @property - def name(self): - # retunrs the name of the predictor - return self.__name - - @property - def supportedAlleles(self): - # returns the supported alleles as strings (without the HLA prefix) - return self.__alleles - - @property - def supportedLength(self): - # returns the supported epitope lengths as iterable - return self.__supported_length - - @property - def version(self): - # returns the version of the predictor - return self.__version - - # the interface defines a function converting Fred2's HLA allele presentation - # into an internal presentation used by different methods. - # for this predictor we won't need it but still have to provide it! - def convert_alleles(self, alleles): - # we just use the identity function - return alleles - - # this method implements the complete prediction routine - def predict(self, peptides, alleles=None, binary=False): - - # test whether one peptide or a list - if isinstance(peptides, basestring): - peptides = list(peptides) - - # if no alleles are specified do predictions for all supported alleles - if alleles is None: - alleles = self.supportedAlleles - else: - # filter for supported alleles - alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) - - # fetch peptides as strings - peptides = [str(peptide) for peptide in peptides] - - # write peptides temporarily, new line separated - tmp_input_file = tempfile.NamedTemporaryFile().name - with open(tmp_input_file, 'wb') as file: - for peptide in peptides: - file.write(peptide + "\n") - - # predict bindings - result = {} - for a in alleles: - result[a] = {} - tmp_output_file = tempfile.NamedTemporaryFile().name - - predict(class_='II', - peptides_path=tmp_input_file, - mhc=a, - output=tmp_output_file + a) - - # read predicted binding affinities back - with open(tmp_output_file + a, 'rb') as csvfile: - reader = csv.reader(csvfile, delimiter=' ', quotechar='|') - # skip header - reader.next() - - for row in reader: - content = row[0].split(',') - peptide = content[0] - binding_affinity = content[1] - if binary: - if binding_affinity <= 500: - result[a][peptide] = 1.0 - else: - result[a][peptide] = 0.0 - else: - result[a][peptide] = binding_affinity - - # create EpitopePredictionResult object. This is a multi-indexed DataFrame - # with Peptide and Method as multi-index and alleles as columns - df_result = EpitopePredictionResult.from_dict(result) - df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], - names=['Seq', 'Method']) - return df_result - - -class MHCFlurryPredictor(APSSMEpitopePrediction): - """ - Implements MHCFlurry - - .. note:: - T. J. O’Donnell, A. Rubinsteyn, M. Bonsack, A. B. Riemer, U. Laserson, and J. Hammerbacher, - "MHCflurry: Open-Source Class I MHC Binding Affinity Prediction," Cell Systems, 2018. - Available at: https://www.cell.com/cell-systems/fulltext/S2405-4712(18)30232-1. - """ - __alleles = frozenset( - ["HLA-A*01:01", "HLA-A*02:01", "HLA-A*02:02", "HLA-A*02:03", "HLA-A*02:05", "HLA-A*02:06", "HLA-A*02:07", - "HLA-A*02:11", "HLA-A*02:12", "HLA-A*02:16", "HLA-A*02:17", "HLA-A*02:19", "HLA-A*02:50", "HLA-A*03:01", - "HLA-A*11:01", "HLA-A*23:01", "HLA-A*24:02", "HLA-A*24:03", "HLA-A*25:01", "HLA-A*26:01", "HLA-A*26:02", - "HLA-A*26:03", "HLA-A*29:02", "HLA-A*30:01", 'HLA-A*30:02', "HLA-A*31:01", "HLA-A*32:01", "HLA-A*33:01", - "HLA-A*66:01", "HLA-A*68:01", "HLA-A*68:02", "HLA-A*68:23", "HLA-A*69:01", "HLA-A*80:01", "HLA-B*07:01", - "HLA-B*07:02", "HLA-B*08:01", "HLA-B*08:02", "HLA-B*08:03", "HLA-B*14:02", "HLA-B*15:01", "HLA-B*15:02", - "HLA-B*15:03", "HLA-B*15:09", "HLA-B*15:17", "HLA-B*18:01", "HLA-B*27:02", "HLA-B*27:03", "HLA-B*27:04", - "HLA-B*27:05", "HLA-B*27:06", "HLA-B*35:01", "HLA-B*35:03", "HLA-B*37:01", "HLA-B*38:01", "HLA-B*39:01", - "HLA-B*39:06", "HLA-B*40:01", "HLA-B*40:02", "HLA-B*42:01", "HLA-B*44:02", "HLA-B*44:03", "HLA-B*45:01", - "HLA-B*46:01", "HLA-B*48:01", "HLA-B*51:01", "HLA-B*53:01", "HLA-B*54:01", "HLA-B*57:01", "HLA-B*58:01", - "HLA-B*83:01", "HLA-C*03:03", "HLA-C*04:01", "HLA-C*05:01", "HLA-C*06:02", "HLA-C*07:02", "HLA-C*08:02", - "HLA-C*12:03", "HLA-C*14:02", "HLA-C*15:02"]) - __supported_length = frozenset([8, 9, 10, 11, 12, 13, 14, 15]) - __name = "mhcflurry" - __version = "1.2.2" - - # the interface defines three class properties - @property - def name(self): - # returns the name of the predictor - return self.__name - - @property - def supportedAlleles(self): - # returns the supported alleles as strings (without the HLA prefix) - return self.__alleles - - @property - def supportedLength(self): - # returns the supported epitope lengths as iterable - return self.__supported_length - - @property - def version(self): - # returns the version of the predictor - return self.__version - - # the interface defines a function converting Fred2's HLA allele presentation - # into an internal presentation used by different methods. - # for this predictor we won't need it but still have to provide it! - def convert_alleles(self, alleles): - # we just use the identity function - return alleles - - # this method implements the complete prediction routine - def predict(self, peptides, alleles=None, binary=False): - - # test whether one peptide or a list - if isinstance(peptides, basestring): - peptides = list(peptides) - - # if no alleles are specified do predictions for all supported alleles - if alleles is None: - alleles = self.supportedAlleles - else: - # filter for supported alleles - alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) - - # test whether mhcflurry models are available => download if not - p = subprocess.Popen(['mhcflurry-downloads', 'path', 'models_class1'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - if p is not 0: - subprocess.call(['mhcflurry-downloads', 'fetch', 'models_class1']) - - # load model - predictor = Class1AffinityPredictor.load() - - # predict bindings - result = {} - for a in alleles: - result[a] = {} - for p in peptides: - seq = p.__str__() - binding_affinity = predictor.predict(allele=a, peptides=[seq]) - if binary: - if binding_affinity <= 500: - result[a][p] = 1.0 - else: - result[a][p] = 0.0 - else: - result[a][p] = binding_affinity - - # create EpitopePredictionResult object. This is a multi-indexed DataFrame - # with Peptide and Method as multi-index and alleles as columns - df_result = EpitopePredictionResult.from_dict(result) - df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], - names=['Seq', 'Method']) - return df_result diff --git a/Fred2/EpitopePrediction/__init__.py b/Fred2/EpitopePrediction/__init__.py index 7af6131d..7bdbdb61 100644 --- a/Fred2/EpitopePrediction/__init__.py +++ b/Fred2/EpitopePrediction/__init__.py @@ -13,6 +13,7 @@ from Fred2.EpitopePrediction.External import * from Fred2.EpitopePrediction.PSSM import * from Fred2.EpitopePrediction.SVM import * +from Fred2.EpitopePrediction.ANN import * try: from fred_plugin import * except ImportError: From 9fe693dcc11852137724ccb51a99211bc83f6716 Mon Sep 17 00:00:00 2001 From: Zethson Date: Mon, 13 May 2019 19:36:11 +0200 Subject: [PATCH 10/16] [FEATURE] Improved error handling and removed unnecessary stuff for ANN interface --- Fred2/EpitopePrediction/ANN.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Fred2/EpitopePrediction/ANN.py b/Fred2/EpitopePrediction/ANN.py index 4b47215b..c9019b8d 100644 --- a/Fred2/EpitopePrediction/ANN.py +++ b/Fred2/EpitopePrediction/ANN.py @@ -78,9 +78,10 @@ def __load_allele_model(allele, length): if self.supportedAlleles is not None and a not in self.supportedAlleles: warnings.warn("Allele %i is not supported by %s" % (a, self.name)) - if not result: - raise ValueError("No predictions could be made with " + self.name + " for given input." - " Check your epitope length and HLA allele combination.") + if not self.supportedLength is not None and length not in self.supportedLength and \ + self.supportedAlleles is not None and a not in self.supportedAlleles: + raise ValueError("No predictions could be made with " + + self.name + " for given input. Check your epitope length and HLA allele combination.") df_result = EpitopePredictionResult.from_dict(result) df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], From c8cfae867d93f2c1f46c2e1200b2c14c1dbd1146 Mon Sep 17 00:00:00 2001 From: Zethson Date: Mon, 13 May 2019 19:41:10 +0200 Subject: [PATCH 11/16] [FIX] mhcflurry allele formatting --- Fred2/EpitopePrediction/ANN.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/Fred2/EpitopePrediction/ANN.py b/Fred2/EpitopePrediction/ANN.py index c9019b8d..48fcecb3 100644 --- a/Fred2/EpitopePrediction/ANN.py +++ b/Fred2/EpitopePrediction/ANN.py @@ -365,23 +365,17 @@ class MHCFlurryPredictor(AANNEpitopePrediction): """ __alleles = frozenset( ["HLA-A*01:01", "HLA-A*02:01", "HLA-A*02:02", "HLA-A*02:03", "HLA-A*02:05", "HLA-A*02:06", "HLA-A*02:07", - "HLA-A*02:11", "HLA-A*02:12", - "HLA-A*02:16", "HLA-A*02:17", "HLA-A*02:19", "HLA-A*02:50", "HLA-A*03:01", "HLA-A*11:01", "HLA-A*23:01", - "HLA-A*24:02", "HLA-A*24:03", - "HLA-A*25:01", "HLA-A*26:01", "HLA-A*26:02", "HLA-A*26:03", "HLA-A*29:02", "HLA-A*30:01", 'HLA-A*30:02', - "HLA-A*31:01", "HLA-A*32:01", - "HLA-A*33:01", "HLA-A*66:01", "HLA-A*68:01", "HLA-A*68:02", "HLA-A*68:23", "HLA-A*69:01", "HLA-A*80:01", - "HLA-B*07:01", "HLA-B*07:02", - "HLA-B*08:01", "HLA-B*08:02", "HLA-B*08:03", "HLA-B*14:02", "HLA-B*15:01", "HLA-B*15:02", "HLA-B*15:03", - "HLA-B*15:09", "HLA-B*15:17", - "HLA-B*18:01", "HLA-B*27:02", "HLA-B*27:03", "HLA-B*27:04", "HLA-B*27:05", "HLA-B*27:06", "HLA-B*35:01", - "HLA-B*35:03", "HLA-B*37:01", - "HLA-B*38:01", "HLA-B*39:01", "HLA-B*39:06", "HLA-B*40:01", "HLA-B*40:02", "HLA-B*42:01", "HLA-B*44:02", - "HLA-B*44:03", "HLA-B*45:01", + "HLA-A*02:11", "HLA-A*02:12", "HLA-A*02:16", "HLA-A*02:17", "HLA-A*02:19", "HLA-A*02:50", "HLA-A*03:01", + "HLA-A*11:01", "HLA-A*23:01", "HLA-A*24:02", "HLA-A*24:03", "HLA-A*25:01", "HLA-A*26:01", "HLA-A*26:02", + "HLA-A*26:03", "HLA-A*29:02", "HLA-A*30:01", 'HLA-A*30:02', "HLA-A*31:01", "HLA-A*32:01", "HLA-A*33:01", + "HLA-A*66:01", "HLA-A*68:01", "HLA-A*68:02", "HLA-A*68:23", "HLA-A*69:01", "HLA-A*80:01", "HLA-B*07:01", + "HLA-B*07:02", "HLA-B*08:01", "HLA-B*08:02", "HLA-B*08:03", "HLA-B*14:02", "HLA-B*15:01", "HLA-B*15:02", + "HLA-B*15:03", "HLA-B*15:09", "HLA-B*15:17", "HLA-B*18:01", "HLA-B*27:02", "HLA-B*27:03", "HLA-B*27:04", + "HLA-B*27:05", "HLA-B*27:06", "HLA-B*35:01", "HLA-B*35:03", "HLA-B*37:01", "HLA-B*38:01", "HLA-B*39:01", + "HLA-B*39:06", "HLA-B*40:01", "HLA-B*40:02", "HLA-B*42:01", "HLA-B*44:02", "HLA-B*44:03", "HLA-B*45:01", "HLA-B*46:01", "HLA-B*48:01", "HLA-B*51:01", "HLA-B*53:01", "HLA-B*54:01", "HLA-B*57:01", "HLA-B*58:01", - "HLA-B*83:01", "HLA-C*03:03", - "HLA-C*04:01", "HLA-C*05:01", "HLA-C*06:02", "HLA-C*07:02", "HLA-C*08:02", "HLA-C*12:03", "HLA-C*14:02", - "HLA-C*15:02"]) + "HLA-B*83:01", "HLA-C*03:03", "HLA-C*04:01", "HLA-C*05:01", "HLA-C*06:02", "HLA-C*07:02", "HLA-C*08:02", + "HLA-C*12:03", "HLA-C*14:02", "HLA-C*15:02"]) __supported_length = [8, 9, 10, 11, 12, 13, 14, 15] __name = "mhcflurry" __version = "1.2.2" From 357a0df7e4f6ea206efe911332f9648cdca7d443 Mon Sep 17 00:00:00 2001 From: Zethson Date: Mon, 13 May 2019 20:28:08 +0200 Subject: [PATCH 12/16] [FIX] removed unnecessary mhcflurry comments and added a frozenset --- Fred2/EpitopePrediction/ANN.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Fred2/EpitopePrediction/ANN.py b/Fred2/EpitopePrediction/ANN.py index 48fcecb3..ef5a4ae7 100644 --- a/Fred2/EpitopePrediction/ANN.py +++ b/Fred2/EpitopePrediction/ANN.py @@ -376,7 +376,7 @@ class MHCFlurryPredictor(AANNEpitopePrediction): "HLA-B*46:01", "HLA-B*48:01", "HLA-B*51:01", "HLA-B*53:01", "HLA-B*54:01", "HLA-B*57:01", "HLA-B*58:01", "HLA-B*83:01", "HLA-C*03:03", "HLA-C*04:01", "HLA-C*05:01", "HLA-C*06:02", "HLA-C*07:02", "HLA-C*08:02", "HLA-C*12:03", "HLA-C*14:02", "HLA-C*15:02"]) - __supported_length = [8, 9, 10, 11, 12, 13, 14, 15] + __supported_length = frozenset([8, 9, 10, 11, 12, 13, 14, 15]) __name = "mhcflurry" __version = "1.2.2" @@ -410,10 +410,6 @@ def convert_alleles(self, alleles): return alleles # additionally the interface defines a function `predict` - # that consumes a list of peptides or a single peptide and optionally a list - # of allele objects - # - # this method implements the complete prediction routine def predict(self, peptides, alleles=None, binary=False): # test whether one peptide or a list From 44fbfd89c0ba6b360094e347ae2913c295ebf0af Mon Sep 17 00:00:00 2001 From: Zethson Date: Mon, 20 May 2019 23:26:59 +0200 Subject: [PATCH 13/16] [FEATURE] abstract meta class + class 2 formatting --- Fred2/EpitopePrediction/ANN.py | 815 ++++++++++++++++----------------- test.py | 6 + 2 files changed, 407 insertions(+), 414 deletions(-) create mode 100644 test.py diff --git a/Fred2/EpitopePrediction/ANN.py b/Fred2/EpitopePrediction/ANN.py index ef5a4ae7..34c9d7fb 100644 --- a/Fred2/EpitopePrediction/ANN.py +++ b/Fred2/EpitopePrediction/ANN.py @@ -8,20 +8,44 @@ .. moduleauthor:: heumos """ -import itertools -import warnings import subprocess import csv import tempfile +from abc import abstractmethod + import pandas from mhcflurry import Class1AffinityPredictor -from mhcnuggets.src.predict import predict +from mhcnuggets.src.predict import predict as mhcnuggets_predict from Fred2.Core import EpitopePredictionResult -from Fred2.Core.Allele import Allele -from Fred2.Core.Peptide import Peptide from Fred2.Core.Base import AEpitopePrediction +import inspect + + +class BadSignatureException(Exception): + pass + + +class SignatureCheckerMeta(type): + def __new__(cls, name, baseClasses, d): + # For each method in d, check to see if any base class already + # defined a method with that name. If so, make sure the + # signatures are the same. + for methodName in d: + f = d[methodName] + for baseClass in baseClasses: + try: + fBase = getattr(baseClass, methodName).__func__ + if not inspect.getargspec(f) == inspect.getargspec(fBase): + raise BadSignatureException(str(methodName)) + except AttributeError: + # This method was not defined in this base class, + # So just go to the next base class. + continue + + return type(name, baseClasses, d) + class AANNEpitopePrediction(AEpitopePrediction): """ @@ -29,427 +53,390 @@ class AANNEpitopePrediction(AEpitopePrediction): Implements predict functionality """ - def predict(self, peptides, alleles=None, **kwargs): + @abstractmethod + def predict(self, peptides, alleles=None, binary=False, **kwargs): """ - Returns predictions for given peptides an :class:`~Fred2.Core.Allele.Allele`. If no - :class:`~Fred2.Core.Allele.Allele` are given, predictions for all available models are made. + All ANN based predictors have to implement their custom predict method. + Furthermore, all of them have to use the metaclass SignatureCheckerMeta to check for any contract violations. + They have to adhere to the following contract :param peptides: A single :class:`~Fred2.Core.Peptide.Peptide` or a list of :class:`~Fred2.Core.Peptide.Peptide` :type peptides: list(:class:`~Fred2.Core.Peptide.Peptide`) or :class:`~Fred2.Core.Peptide.Peptide` - :param alleles: A list of :class:`~Fred2.Core.Allele.Allele` - :type alleles: list(:class:`~Fred2.Core.Allele.Allele`) or class:`~Fred2.Core.Allele.Allele` :param kwargs: optional parameter (not used yet) - :return: Returns a :class:`~Fred2.Core.Result.EpitopePredictionResult` object with the prediction results - :rtype: :class:`~Fred2.Core.Result.EpitopePredictionResult` + :return: Returns a :class:`pandas.DataFrame` object with the prediction results + :rtype: :class:`pandas.DataFrame` """ - def __load_allele_model(allele, length): - return allele - - if isinstance(peptides, Peptide): - pep_seqs = {str(peptides): peptides} - else: - pep_seqs = {} - for p in peptides: - if not isinstance(p, Peptide): - raise ValueError("Input is not of type Protein or Peptide") - pep_seqs[str(p)] = p - - if alleles is None: - al = [Allele(a) for a in self.supportedAlleles] - alleles_string = {conv_a: a for conv_a, a in itertools.izip(self.convert_alleles(al), al)} - else: - if isinstance(alleles, Allele): - alleles = [alleles] - if any(not isinstance(p, Allele) for p in alleles): - raise ValueError("Input is not of type Allele") - alleles_string = {conv_a: a for conv_a, a in itertools.izip(self.convert_alleles(alleles), alleles)} - - result = {} - pep_groups = pep_seqs.keys() - pep_groups.sort(key=len) - for length, peps in itertools.groupby(pep_groups, key=len): - - if self.supportedLength is not None and length not in self.supportedLength: - warnings.warn("Peptide length of %i is not supported by %s" % (length, self.name)) - continue - - for a in alleles_string.keys(): - if self.supportedAlleles is not None and a not in self.supportedAlleles: - warnings.warn("Allele %i is not supported by %s" % (a, self.name)) - - if not self.supportedLength is not None and length not in self.supportedLength and \ - self.supportedAlleles is not None and a not in self.supportedAlleles: - raise ValueError("No predictions could be made with " - + self.name + " for given input. Check your epitope length and HLA allele combination.") - - df_result = EpitopePredictionResult.from_dict(result) - df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], - names=['Seq', 'Method']) - return df_result - - -class MHCNuggetsPredictor_1(AANNEpitopePrediction): - """ - Implements MHCNuggets Class I - - .. note:: - Evaluation of machine learning methods to predict peptide binding to MHC Class I proteins - Rohit Bhattacharya, Ashok Sivakumar, Collin Tokheim, Violeta Beleva Guthrie, Valsamo Anagnostou, - Victor E. Velculescu, Rachel Karchin (2017) bioRxiv - """ - __alleles = frozenset( - ["HLA-A01:01", "HLA-A02:01", "HLA-A02:02", "HLA-A02:03", "HLA-A02:04", "HLA-A02:05", "HLA-A02:06", - "HLA-A02:07", "HLA-A02:08", "HLA-A02:09", "HLA-A02:10", "HLA-A02:11", "HLA-A02:12", "HLA-A02:14", - "HLA-A02:16", "HLA-A02:17", "HLA-A02:19", "HLA-A02:50", "HLA-A03:01", "HLA-A03:02", "HLA-A03:19", - "HLA-A11:01", "HLA-A11:02", "HLA-A23:01", "HLA-A24:01", "HLA-A24:02", "HLA-A24:03", "HLA-A25:01", - "HLA-A26:01", "HLA-A26:02", "HLA-A26:03", "HLA-A29:01", "HLA-A29:02", "HLA-A30:01", "HLA-A30:02", - "HLA-A30:03", "HLA-A30:04", "HLA-A31:01", "HLA-A32:01", "HLA-A32:07", "HLA-A32:15", "HLA-A33:01", - "HLA-A33:03", "HLA-A66:01", "HLA-A68:01", "HLA-A68:02", "HLA-A68:23", "HLA-A69:01", "HLA-A74:01", - "HLA-A80:01", "HLA-B07:01", "HLA-B07:02", "HLA-B08:01", "HLA-B08:02", "HLA-B08:03", "HLA-B12:01", - "HLA-B13:02", "HLA-B14:01", "HLA-B14:02", "HLA-B15:01", "HLA-B15:02", "HLA-B15:03", "HLA-B15:08", - "HLA-B15:09", "HLA-B15:10", "HLA-B15:13", "HLA-B15:16", "HLA-B15:17", "HLA-B15:42", "HLA-B18:01", - "HLA-B27:01", "HLA-B27:02", "HLA-B27:03", "HLA-B27:04", "HLA-B27:05", "HLA-B27:06", "HLA-B27:09", - "HLA-B27:10", "HLA-B27:20", "HLA-B35:01", "HLA-B35:02", "HLA-B35:03", "HLA-B35:08", "HLA-B37:01", - "HLA-B38:01", "HLA-B39:01", "HLA-B39:06", "HLA-B39:09", "HLA-B39:10", "HLA-B40:01", "HLA-B40:02", - "HLA-B40:13", "HLA-B41:03", "HLA-B41:04", "HLA-B42:01", "HLA-B42:02", "HLA-B44:01", "HLA-B44:02", - "HLA-B44:03", "HLA-B44:05", "HLA-B45:01", "HLA-B45:06", "HLA-B46:01", "HLA-B48:01", "HLA-B51:01", - "HLA-B51:02", "HLA-B52:01", "HLA-B53:01", "HLA-B54:01", "HLA-B55:01", "HLA-B55:02", "HLA-B56:01", - "HLA-B57:01", "HLA-B57:02", "HLA-B57:03", "HLA-B58:01", "HLA-B58:02", "HLA-B60:01", "HLA-B61:01", - "HLA-B62:01", "HLA-B73:01", "HLA-B81:01", "HLA-B83:01"]) - __supported_length = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] - __name = "mhcnuggets-class-1" - __version = "2.0" - - # the interface defines three class properties - @property - def name(self): - # retunrs the name of the predictor - return self.__name - - @property - def supportedAlleles(self): - # returns the supported alleles as strings (without the HLA prefix) - return self.__alleles - - @property - def supportedLength(self): - # returns the supported epitope lengths as iterable - return self.__supported_length - - @property - def version(self): - # returns the version of the predictor - return self.__version - - # the interface defines a function converting Fred2's HLA allele presentation - # into an internal presentation used by different methods. - # for this predictor we won't need it but still have to provide it! - # the function consumes a list of alleles and converts them into the internally used presentation - def convert_alleles(self, alleles): - # we just use the identity function - return alleles - - # additionally the interface defines a function `predict` - # that consumes a list of peptides or a single peptide and optionally a list - # of allele objects - # - # this method implements the complete prediction routine - def predict(self, peptides, alleles=None, binary=False): - - # test whether one peptide or a list - if isinstance(peptides, basestring): - peptides = list(peptides) - - # if no alleles are specified do predictions for all supported alleles - if alleles is None: - alleles = self.supportedAlleles - else: - # filter for supported alleles - alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) - - result = {} - - # fetch peptides as strings - peptides = [str(peptide) for peptide in peptides] - - # write peptides temporarily, new line separated - tmp_input_file = tempfile.NamedTemporaryFile().name - with open(tmp_input_file, 'wb') as file: - for peptide in peptides: - file.write(peptide + "\n") - - # predict bindings - for a in alleles: - result[a] = {} - tmp_output_file = tempfile.NamedTemporaryFile().name - predict(class_='I', - peptides_path=tmp_input_file, - mhc=a, - output=tmp_output_file + a) - - # read predicted binding affinities back - with open(tmp_output_file + a, 'rb') as csvfile: - reader = csv.reader(csvfile, delimiter=' ', quotechar='|') - # skip header - reader.next() - - for row in reader: - content = row[0].split(',') - peptide = content[0] - binding_affinity = content[1] - if binary: - if binding_affinity <= 500: - result[a][peptide] = 1.0 - else: - result[a][peptide] = 0.0 - else: - result[a][peptide] = binding_affinity - # create EpitopePredictionResult object. This is a multi-indexed DataFrame - # with Peptide and Method as multi-index and alleles as columns - df_result = EpitopePredictionResult.from_dict(result) - df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], - names=['Seq', 'Method']) - return df_result +try: + class MHCNuggetsPredictor_1(AANNEpitopePrediction): + """ + Implements MHCNuggets Class I + .. note:: + Evaluation of machine learning methods to predict peptide binding to MHC Class I proteins + Rohit Bhattacharya, Ashok Sivakumar, Collin Tokheim, Violeta Beleva Guthrie, Valsamo Anagnostou, + Victor E. Velculescu, Rachel Karchin (2017) bioRxiv + """ + __metaclass__ = SignatureCheckerMeta + __alleles = frozenset( + ["HLA-A01:01", "HLA-A02:01", "HLA-A02:02", "HLA-A02:03", "HLA-A02:04", "HLA-A02:05", "HLA-A02:06", + "HLA-A02:07", "HLA-A02:08", "HLA-A02:09", "HLA-A02:10", "HLA-A02:11", "HLA-A02:12", "HLA-A02:14", + "HLA-A02:16", "HLA-A02:17", "HLA-A02:19", "HLA-A02:50", "HLA-A03:01", "HLA-A03:02", "HLA-A03:19", + "HLA-A11:01", "HLA-A11:02", "HLA-A23:01", "HLA-A24:01", "HLA-A24:02", "HLA-A24:03", "HLA-A25:01", + "HLA-A26:01", "HLA-A26:02", "HLA-A26:03", "HLA-A29:01", "HLA-A29:02", "HLA-A30:01", "HLA-A30:02", + "HLA-A30:03", "HLA-A30:04", "HLA-A31:01", "HLA-A32:01", "HLA-A32:07", "HLA-A32:15", "HLA-A33:01", + "HLA-A33:03", "HLA-A66:01", "HLA-A68:01", "HLA-A68:02", "HLA-A68:23", "HLA-A69:01", "HLA-A74:01", + "HLA-A80:01", "HLA-B07:01", "HLA-B07:02", "HLA-B08:01", "HLA-B08:02", "HLA-B08:03", "HLA-B12:01", + "HLA-B13:02", "HLA-B14:01", "HLA-B14:02", "HLA-B15:01", "HLA-B15:02", "HLA-B15:03", "HLA-B15:08", + "HLA-B15:09", "HLA-B15:10", "HLA-B15:13", "HLA-B15:16", "HLA-B15:17", "HLA-B15:42", "HLA-B18:01", + "HLA-B27:01", "HLA-B27:02", "HLA-B27:03", "HLA-B27:04", "HLA-B27:05", "HLA-B27:06", "HLA-B27:09", + "HLA-B27:10", "HLA-B27:20", "HLA-B35:01", "HLA-B35:02", "HLA-B35:03", "HLA-B35:08", "HLA-B37:01", + "HLA-B38:01", "HLA-B39:01", "HLA-B39:06", "HLA-B39:09", "HLA-B39:10", "HLA-B40:01", "HLA-B40:02", + "HLA-B40:13", "HLA-B41:03", "HLA-B41:04", "HLA-B42:01", "HLA-B42:02", "HLA-B44:01", "HLA-B44:02", + "HLA-B44:03", "HLA-B44:05", "HLA-B45:01", "HLA-B45:06", "HLA-B46:01", "HLA-B48:01", "HLA-B51:01", + "HLA-B51:02", "HLA-B52:01", "HLA-B53:01", "HLA-B54:01", "HLA-B55:01", "HLA-B55:02", "HLA-B56:01", + "HLA-B57:01", "HLA-B57:02", "HLA-B57:03", "HLA-B58:01", "HLA-B58:02", "HLA-B60:01", "HLA-B61:01", + "HLA-B62:01", "HLA-B73:01", "HLA-B81:01", "HLA-B83:01"]) + __supported_length = frozenset([5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]) + __name = "mhcnuggets-class-1" + __version = "2.0" + + # the interface defines three class properties + @property + def name(self): + # returns the name of the predictor + return self.__name + + @property + def supportedAlleles(self): + # returns the supported alleles as strings (without the HLA prefix) + return self.__alleles + + @property + def supportedLength(self): + # returns the supported epitope lengths as iterable + return self.__supported_length + + @property + def version(self): + # returns the version of the predictor + return self.__version + + # the interface defines a function converting Fred2's HLA allele presentation + # into an internal presentation used by different methods. + # for this predictor we won't need it but still have to provide it! + # the function consumes a list of alleles and converts them into the internally used presentation + def convert_alleles(self, alleles): + # we just use the identity function + return alleles + + # additionally the interface defines a function `predict` + # that consumes a list of peptides or a single peptide and optionally a list of allele objects + # this method implements the complete prediction routine + def predict(self, peptides, alleles=None, binary=False, **kwargs): + + # test whether one peptide or a list + if isinstance(peptides, basestring): + peptides = list(peptides) + + # if no alleles are specified do predictions for all supported alleles + if alleles is None: + alleles = self.supportedAlleles + else: + # filter for supported alleles + alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) + + result = {} + + # fetch peptides as strings + peptides = [str(peptide) for peptide in peptides] + + # write peptides temporarily, new line separated + tmp_input_file = tempfile.NamedTemporaryFile().name + with open(tmp_input_file, 'wb') as file: + for peptide in peptides: + file.write(peptide + "\n") + + # predict bindings + for a in alleles: + result[a] = {} + tmp_output_file = tempfile.NamedTemporaryFile().name + mhcnuggets_predict(class_='I', + peptides_path=tmp_input_file, + mhc=a, + output=tmp_output_file + a) + + # read predicted binding affinities back + with open(tmp_output_file + a, 'rb') as csvfile: + reader = csv.reader(csvfile, delimiter=' ', quotechar='|') + # skip header + reader.next() + + for row in reader: + content = row[0].split(',') + peptide = content[0] + binding_affinity = content[1] + if binary: + if binding_affinity <= 500: + result[a][peptide] = 1.0 + else: + result[a][peptide] = 0.0 + else: + result[a][peptide] = binding_affinity + + # create EpitopePredictionResult object. This is a multi-indexed DataFrame + # with Peptide and Method as multi-index and alleles as columns + df_result = EpitopePredictionResult.from_dict(result) + df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], + names=['Seq', 'Method']) + return df_result +except BadSignatureException: + print "Class MHCNuggetsPredictor_1 cannot be constructed, because of a bad method signature (predict)" + +try: + class MHCNuggetsPredictor_2(AANNEpitopePrediction): + """ + Implements MHCNuggets Class II -class MHCNuggetsPredictor_2(AANNEpitopePrediction): - """ - Implements MHCNuggets Class II + .. note:: + Evaluation of machine learning methods to predict peptide binding to MHC Class I proteins + Rohit Bhattacharya, Ashok Sivakumar, Collin Tokheim, Violeta Beleva Guthrie, Valsamo Anagnostou, + Victor E. Velculescu, Rachel Karchin (2017) bioRxiv + """ + __metaclass__ = SignatureCheckerMeta + __alleles = frozenset(["HLA-DPA1*01:03-DPB1*02:01", "HLA-DPA1*01:03-DPB1*03:01", "HLA-DPA1*01:03-DPB1*04:01", + "HLA-DPA1*01:03-DPB1*04:02", "HLA-DPA1*02:01-DPB1*01:01", "HLA-DPA1*02:01-DPB1*05:01", + "HLA-DPA1*02:02-DPB1*05:01", "HLA-DPA1*03:01-DPB1*04:02", "HLA-DPB1*01:01", + "HLA-DPB1*02:01", "HLA-DPB1*03:01", "HLA-DPB1*04:01", "HLA-DPB1*04:02", "HLA-DPB1*05:01", + "HLA-DPB1*09:01", "HLA-DPB1*11:01", "HLA-DPB1*14:01", "HLA-DPB1*20:01", "HLA-DQA1*01:01", + "HLA-DQA1*01:01-DQB1*05:01", "HLA-DQA1*01:01-DQB1*05:03", "HLA-DQA1*01:02", + "HLA-DQA1*01:02-DQB1*05:01", "HLA-DQA1*01:02-DQB1*05:02", "HLA-DQA1*01:02-DQB1*06:02", + "HLA-DQA1*01:02-DQB1*06:04", "HLA-DQA1*01:03-DQB1*03:02", "HLA-DQA1*01:03-DQB1*06:01", + "HLA-DQA1*01:03-DQB1*06:03", "HLA-DQA1*01:04-DQB1*05:03", "HLA-DQA1*02:01-DQB1*02:01", + "HLA-DQA1*02:01-DQB1*02:02", "HLA-DQA1*02:01-DQB1*03:01", "HLA-DQA1*02:01-DQB1*03:03", + "HLA-DQA1*02:01-DQB1*04:02", "HLA-DQA1*03:01", "HLA-DQA1*03:01-DQB1*02:01", + "HLA-DQA1*03:01-DQB1*03:01", "HLA-DQA1*03:01-DQB1*03:02", "HLA-DQA1*03:01-DQB1*04:01", + "HLA-DQA1*03:02-DQB1*03:01", "HLA-DQA1*03:02-DQB1*03:03", "HLA-DQA1*03:02-DQB1*04:01", + "HLA-DQA1*03:03-DQB1*04:02", "HLA-DQA1*04:01-DQB1*04:02", "HLA-DQA1*05:01", + "HLA-DQA1*05:01-DQB1*02:01", "HLA-DQA1*05:01-DQB1*03:01", "HLA-DQA1*05:01-DQB1*03:02", + "HLA-DQA1*05:01-DQB1*03:03", "HLA-DQA1*05:01-DQB1*04:02", "HLA-DQA1*05:05-DQB1*03:01", + "HLA-DQA1*06:01-DQB1*04:02", "HLA-DQB1*02:01", "HLA-DQB1*02:02", "HLA-DQB1*03:01", + "HLA-DQB1*03:02", "HLA-DQB1*03:19", "HLA-DQB1*04:02", "HLA-DQB1*05:01", "HLA-DQB1*05:02", + "HLA-DQB1*05:03", "HLA-DQB1*06:02", "HLA-DQB1*06:03", "HLA-DQB1*06:04", + "HLA-DRA0*10:1-DRB1*01:01", "HLA-DRA0*10:1-DRB1*03:01", "HLA-DRA0*10:1-DRB1*04:01", + "HLA-DRA0*10:1-DRB1*04:04", "HLA-DRA01*01-DRB1*07:01", "HLA-DRA0*10:1-DRB1*08:01", + "HLA-DRA0*10:1-DRB1*09:01", "HLA-DRA0*10:1-DRB1*11:01", "HLA-DRA0*10:1-DRB1*13:01", + "HLA-DRA0*10:1-DRB1*14:54", "HLA-DRA0*10:1-DRB1*15:01", "HLA-DRA0*10:1-DRB3*01:01", + "HLA-DRA0*10:1-DRB3*02:02", "HLA-DRA0*10:1-DRB3*03:01", "HLA-DRA0*10:1-DRB4*01:03", + "HLA-DRA0*10:1-DRB5*01:01", "HLA-DRB1*01:01", "HLA-DRB1*01:02", "HLA-DRB1*01:03", + "HLA-DRB1*03:01", "HLA-DRB1*03:02", "HLA-DRB1*03:03", "HLA-DRB1*03:04", "HLA-DRB1*03:05", + "HLA-DRB1*04:01", "HLA-DRB1*04:02", "HLA-DRB1*04:03", "HLA-DRB1*04:04", "HLA-DRB1*04:05", + "HLA-DRB1*04:06", "HLA-DRB1*04:07", "HLA-DRB1*04:11", "HLA-DRB1*07:01", "HLA-DRB1*08:01", + "HLA-DRB1*08:02", "HLA-DRB1*08:03", "HLA-DRB1*08:04", "HLA-DRB1*09:01", "HLA-DRB1*10:01", + "HLA-DRB1*11:01", "HLA-DRB1*11:02", "HLA-DRB1*11:03", "HLA-DRB1*11:04", "HLA-DRB1*12:01", + "HLA-DRB1*12:02", "HLA-DRB1*13:01", "HLA-DRB1*13:02", "HLA-DRB1*13:03", "HLA-DRB1*13:04", + "HLA-DRB1*13:05", "HLA-DRB1*14:01", "HLA-DRB1*14:02", "HLA-DRB1*15:01", "HLA-DRB1*15:02", + "HLA-DRB1*15:03", "HLA-DRB1*16:01", "HLA-DRB1*16:02", "HLA-DRB3*01:01", "HLA-DRB3*02:02", + "HLA-DRB3*03:01", "HLA-DRB4*01:01", "HLA-DRB4*01:03", "HLA-DRB5*01:01", "HLA-DRB5*01:02"]) + __supported_length = frozenset([5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]) + __name = "mhcnuggets-class-2" + __version = "2.0" + + # the interface defines three class properties + @property + def name(self): + # returns the name of the predictor + return self.__name + + @property + def supportedAlleles(self): + # returns the supported alleles as strings (without the HLA prefix) + return self.__alleles + + @property + def supportedLength(self): + # returns the supported epitope lengths as iterable + return self.__supported_length + + @property + def version(self): + # returns the version of the predictor + return self.__version + + # the interface defines a function converting Fred2's HLA allele presentation + # into an internal presentation used by different methods. + # for this predictor we won't need it but still have to provide it! + # the function consumes a list of alleles and converts them into the internally used presentation + def convert_alleles(self, alleles): + return [allele.replace(':', '').replace('*', '') for allele in alleles] + + # additionally the interface defines a function `predict` + # that consumes a list of peptides or a single peptide and optionally a list + # of allele objects + # + # this method implements the complete prediction routine + def predict(self, peptides, alleles=None, binary=False, **kwargs): + + # test whether one peptide or a list + if isinstance(peptides, basestring): + peptides = list(peptides) + + # if no alleles are specified do predictions for all supported alleles + if alleles is None: + alleles = self.supportedAlleles + else: + # filter for supported alleles + alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) + + result = {} + + # fetch peptides as strings + peptides = [str(peptide) for peptide in peptides] + + # write peptides temporarily, new line separated + tmp_input_file = tempfile.NamedTemporaryFile().name + with open(tmp_input_file, 'wb') as file: + for peptide in peptides: + file.write(peptide + "\n") + + # predict bindings + for a in alleles: + result[a] = {} + tmp_output_file = tempfile.NamedTemporaryFile().name + + mhcnuggets_predict(class_='II', + peptides_path=tmp_input_file, + mhc=a, + output=tmp_output_file + a) + + # read predicted binding affinities back + with open(tmp_output_file + a, 'rb') as csvfile: + reader = csv.reader(csvfile, delimiter=' ', quotechar='|') + # skip header + reader.next() + + for row in reader: + content = row[0].split(',') + peptide = content[0] + binding_affinity = content[1] + if binary: + if binding_affinity <= 500: + result[a][peptide] = 1.0 + else: + result[a][peptide] = 0.0 + else: + result[a][peptide] = binding_affinity + + # create EpitopePredictionResult object. This is a multi-indexed DataFrame + # with Peptide and Method as multi-index and alleles as columns + df_result = EpitopePredictionResult.from_dict(result) + df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], + names=['Seq', 'Method']) + return df_result +except BadSignatureException: + print "Class MHCNuggetsPredictor_2 cannot be constructed, because of a bad method signature (predict)" + +try: + class MHCFlurryPredictor(AANNEpitopePrediction): + """ + Implements MHCFlurry - .. note:: - Evaluation of machine learning methods to predict peptide binding to MHC Class I proteins - Rohit Bhattacharya, Ashok Sivakumar, Collin Tokheim, Violeta Beleva Guthrie, Valsamo Anagnostou, - Victor E. Velculescu, Rachel Karchin (2017) bioRxiv - """ - __alleles = frozenset(["HLA-DPA1*01:03-DPB1*02:01", "HLA-DPA1*01:03-DPB1*03:01", "HLA-DPA1*01:03-DPB1*04:01", - "HLA-DPA1*01:03-DPB1*04:02", "HLA-DPA1*02:01-DPB1*01:01", "HLA-DPA1*02:01-DPB1*05:01", - "HLA-DPA1*02:02-DPB1*05:01", "HLA-DPA10301-DPB1*04:02", "HLA-DPB1*01:01", "HLA-DPB1*02:01", - "HLA-DPB1*03:01", "HLA-DPB1*04:01", "HLA-DPB1*04:02", "HLA-DPB1*05:01", "HLA-DPB1*09:01", - "HLA-DPB1*11:01", "HLA-DPB1*14:01", "HLA-DPB1*20:01", "HLA-DQA1*01:01", - "HLA-DQA1*01:01-DQB10501", "HLA-DQA1*01:01-DQB1*05:03", "HLA-DQA1*01:02", - "HLA-DQA1*01:02-DQB1*05:01", "HLA-DQA1*01:02-DQB10502", "HLA-DQA1*01:02-DQB1*06:02", - "HLA-DQA1*01:02-DQB1*06:04", "HLA-DQA1*01:03-DQB10302", "HLA-DQA1*01:03-DQB1*06:01", - "HLA-DQA1*01:03-DQB1*06:03", "HLA-DQA1*01:04-DQB10503", "HLA-DQA1*02:01-DQB1*02:01", - "HLA-DQA1*02:01-DQB1*02:02", "HLA-DQA1*02:01-DQB10301", "HLA-DQA1*02:01-DQB1*03:03", - "HLA-DQA1*02:01-DQB1*04:02", "HLA-DQA1*03:01", "HLA-DQA1*03:01-DQB1*02:01", - "HLA-DQA1*03:01-DQB1*03:01", "HLA-DQA1*03:01-DQB1*03:02", "HLA-DQA1*03:01-DQB10401", - "HLA-DQA1*03:02-DQB10301", "HLA-DQA1*03:02-DQB1*03:03", "HLA-DQA1*03:02-DQB10401", - "HLA-DQA1*03:03-DQB10402", "HLA-DQA1*04:01-DQB1*04:02", "HLA-DQA1*05:01", - "HLA-DQA1*05:01-DQB1*02:01", "HLA-DQA1*05:01-DQB1*03:01", "HLA-DQA1*05:01-DQB1*03:02", - "HLA-DQA1*05:01-DQB10303", "HLA-DQA1*05:01-DQB10402", "HLA-DQA1*05:05-DQB1*03:01", - "HLA-DQA1*06:01-DQB10402", "HLA-DQB1*02:01", "HLA-DQB1*02:02", "HLA-DQB1*03:01", - "HLA-DQB1*03:02", "HLA-DQB1*03:19", "HLA-DQB1*04:02", "HLA-DQB1*05:01", "HLA-DQB1*05:02", - "HLA-DQB1*05:03", "HLA-DQB1*06:02", "HLA-DQB1*06:03", "HLA-DQB1*06:04", - "HLA-DRA0*10:1-DRB1*01:01", "HLA-DRA0*10:1-DRB1*03:01", "HLA-DRA0*10:1-DRB1*04:01", - "HLA-DRA0*10:1-DRB1*04:04", "HLA-DRA01*01-DRB1*07:01", "HLA-DRA0*10:1-DRB1*08:01", - "HLA-DRA0*10:1-DRB1*09:01", "HLA-DRA0*10:1-DRB1*11:01", "HLA-DRA01*01-DRB1*13:01", - "HLA-DRA0*10:1-DRB1*14:54", "HLA-DRA0*10:1-DRB1*15:01", "HLA-DRA0*10:1-DRB3*01:01", - "HLA-DRA01*01-DRB3*02:02", "HLA-DRA0*10:1-DRB3*03:01", "HLA-DRA0*10:1-DRB4*01:03", - "HLA-DRA0*10:1-DRB5*01:01", "HLA-DRB10*10:1", "HLA-DRB1*01:02", "HLA-DRB1*01:03", - "HLA-DRB1*03:01", "HLA-DRB1*03:02", "HLA-DRB1*03:03", "HLA-DRB1*03:04", "HLA-DRB1*03:05", - "HLA-DRB1*04:01", "HLA-DRB1*04:02", "HLA-DRB1*04:03", "HLA-DRB1*04:04", "HLA-DRB1*04:05", - "HLA-DRB1*04:06", "HLA-DRB1*04:07", "HLA-DRB1*04:11", "HLA-DRB1*07:01", "HLA-DRB1*08:01", - "HLA-DRB1*08:02", "HLA-DRB1*08:03", "HLA-DRB1*08:04", "HLA-DRB1*09:01", "HLA-DRB1*10:01", - "HLA-DRB1*11:01", "HLA-DRB1*11:02", "HLA-DRB1*11:03", "HLA-DRB1*11:04", "HLA-DRB1*12:01", - "HLA-DRB1*12:02", "HLA-DRB1*13:01", "HLA-DRB1*13:02", "HLA-DRB1*13:03", "HLA-DRB1*13:04", - "HLA-DRB1*13:05", "HLA-DRB1*14:01", "HLA-DRB1*14:02", "HLA-DRB1*15:01", "HLA-DRB1*15:02", - "HLA-DRB1*15:03", "HLA-DRB1*16:01", "HLA-DRB1*16:02", "HLA-DRB3*01:01", "HLA-DRB3*02:02", - "HLA-DRB3*03:01", "HLA-DRB4*01:01", "HLA-DRB4*01:03", "HLA-DRB5*01:01", "HLA-DRB5*01:02"]) - __supported_length = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25] - __name = "mhcnuggets-class-2" - __version = "2.0" - - # the interface defines three class properties - @property - def name(self): - # returns the name of the predictor - return self.__name - - @property - def supportedAlleles(self): - # returns the supported alleles as strings (without the HLA prefix) - return self.__alleles - - @property - def supportedLength(self): - # returns the supported epitope lengths as iterable - return self.__supported_length - - @property - def version(self): - # returns the version of the predictor - return self.__version - - # the interface defines a function converting Fred2's HLA allele presentation - # into an internal presentation used by different methods. - # for this predictor we won't need it but still have to provide it! - # the function consumes a list of alleles and converts them into the internally used presentation - def convert_alleles(self, alleles): - return [allele.replace(':', '').replace('*', '') for allele in alleles] - - # additionally the interface defines a function `predict` - # that consumes a list of peptides or a single peptide and optionally a list - # of allele objects - # - # this method implements the complete prediction routine - def predict(self, peptides, alleles=None, binary=False): - - # test whether one peptide or a list - if isinstance(peptides, basestring): - peptides = list(peptides) - - # if no alleles are specified do predictions for all supported alleles - if alleles is None: - alleles = self.supportedAlleles - else: - # filter for supported alleles - alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) - - result = {} - - # fetch peptides as strings - peptides = [str(peptide) for peptide in peptides] - - # write peptides temporarily, new line separated - tmp_input_file = tempfile.NamedTemporaryFile().name - with open(tmp_input_file, 'wb') as file: - for peptide in peptides: - file.write(peptide + "\n") - - # predict bindings - for a in alleles: - result[a] = {} - tmp_output_file = tempfile.NamedTemporaryFile().name - - predict(class_='II', - peptides_path=tmp_input_file, - mhc=a, - output=tmp_output_file + a) - - # read predicted binding affinities back - with open(tmp_output_file + a, 'rb') as csvfile: - reader = csv.reader(csvfile, delimiter=' ', quotechar='|') - # skip header - reader.next() - - for row in reader: - content = row[0].split(',') - peptide = content[0] - binding_affinity = content[1] + .. note:: + T. J. O’Donnell, A. Rubinsteyn, M. Bonsack, A. B. Riemer, U. Laserson, and J. Hammerbacher, + "MHCflurry: Open-Source Class I MHC Binding Affinity Prediction," Cell Systems, 2018. + Available at: https://www.cell.com/cell-systems/fulltext/S2405-4712(18)30232-1. + """ + __metaclass__ = SignatureCheckerMeta + __alleles = frozenset( + ["HLA-A*01:01", "HLA-A*02:01", "HLA-A*02:02", "HLA-A*02:03", "HLA-A*02:05", "HLA-A*02:06", "HLA-A*02:07", + "HLA-A*02:11", "HLA-A*02:12", "HLA-A*02:16", "HLA-A*02:17", "HLA-A*02:19", "HLA-A*02:50", "HLA-A*03:01", + "HLA-A*11:01", "HLA-A*23:01", "HLA-A*24:02", "HLA-A*24:03", "HLA-A*25:01", "HLA-A*26:01", "HLA-A*26:02", + "HLA-A*26:03", "HLA-A*29:02", "HLA-A*30:01", 'HLA-A*30:02', "HLA-A*31:01", "HLA-A*32:01", "HLA-A*33:01", + "HLA-A*66:01", "HLA-A*68:01", "HLA-A*68:02", "HLA-A*68:23", "HLA-A*69:01", "HLA-A*80:01", "HLA-B*07:01", + "HLA-B*07:02", "HLA-B*08:01", "HLA-B*08:02", "HLA-B*08:03", "HLA-B*14:02", "HLA-B*15:01", "HLA-B*15:02", + "HLA-B*15:03", "HLA-B*15:09", "HLA-B*15:17", "HLA-B*18:01", "HLA-B*27:02", "HLA-B*27:03", "HLA-B*27:04", + "HLA-B*27:05", "HLA-B*27:06", "HLA-B*35:01", "HLA-B*35:03", "HLA-B*37:01", "HLA-B*38:01", "HLA-B*39:01", + "HLA-B*39:06", "HLA-B*40:01", "HLA-B*40:02", "HLA-B*42:01", "HLA-B*44:02", "HLA-B*44:03", "HLA-B*45:01", + "HLA-B*46:01", "HLA-B*48:01", "HLA-B*51:01", "HLA-B*53:01", "HLA-B*54:01", "HLA-B*57:01", "HLA-B*58:01", + "HLA-B*83:01", "HLA-C*03:03", "HLA-C*04:01", "HLA-C*05:01", "HLA-C*06:02", "HLA-C*07:02", "HLA-C*08:02", + "HLA-C*12:03", "HLA-C*14:02", "HLA-C*15:02"]) + __supported_length = frozenset([8, 9, 10, 11, 12, 13, 14, 15]) + __name = "mhcflurry" + __version = "1.2.2" + + # the interface defines three class properties + @property + def name(self): + # returns the name of the predictor + return self.__name + + @property + def supportedAlleles(self): + # returns the supported alleles as strings (without the HLA prefix) + return self.__alleles + + @property + def supportedLength(self): + # returns the supported epitope lengths as iterable + return self.__supported_length + + @property + def version(self): + # returns the version of the predictor + return self.__version + + # the interface defines a function converting Fred2's HLA allele presentation + # into an internal presentation used by different methods. + # for this predictor we won't need it but still have to provide it! + # the function consumes a list of alleles and converts them into the internally used presentation + def convert_alleles(self, alleles): + # we just use the identity function + return alleles + + # additionally the interface defines a function `predict` + def predict(self, peptides, alleles=None, binary=False, **kwargs): + + # test whether one peptide or a list + if isinstance(peptides, basestring): + peptides = list(peptides) + + # if no alleles are specified do predictions for all supported alleles + if alleles is None: + alleles = self.supportedAlleles + else: + # filter for supported alleles + alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) + + # test mhcflurry models are available => download if not + p = subprocess.Popen(['mhcflurry-downloads', 'path', 'models_class1'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if p is not 0: + subprocess.call(['mhcflurry-downloads', 'fetch', 'models_class1']) + + # load model + predictor = Class1AffinityPredictor.load() + + result = {} + + for a in alleles: + result[a] = {} + for p in peptides: + seq = p.__str__() + binding_affinity = predictor.predict(allele=a, peptides=[seq]) if binary: if binding_affinity <= 500: - result[a][peptide] = 1.0 + result[a][p] = 1.0 else: - result[a][peptide] = 0.0 - else: - result[a][peptide] = binding_affinity - - # create EpitopePredictionResult object. This is a multi-indexed DataFrame - # with Peptide and Method as multi-index and alleles as columns - df_result = EpitopePredictionResult.from_dict(result) - df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], - names=['Seq', 'Method']) - return df_result - - -class MHCFlurryPredictor(AANNEpitopePrediction): - """ - Implements MHCFlurry - - .. note:: - T. J. O’Donnell, A. Rubinsteyn, M. Bonsack, A. B. Riemer, U. Laserson, and J. Hammerbacher, - "MHCflurry: Open-Source Class I MHC Binding Affinity Prediction," Cell Systems, 2018. - Available at: https://www.cell.com/cell-systems/fulltext/S2405-4712(18)30232-1. - """ - __alleles = frozenset( - ["HLA-A*01:01", "HLA-A*02:01", "HLA-A*02:02", "HLA-A*02:03", "HLA-A*02:05", "HLA-A*02:06", "HLA-A*02:07", - "HLA-A*02:11", "HLA-A*02:12", "HLA-A*02:16", "HLA-A*02:17", "HLA-A*02:19", "HLA-A*02:50", "HLA-A*03:01", - "HLA-A*11:01", "HLA-A*23:01", "HLA-A*24:02", "HLA-A*24:03", "HLA-A*25:01", "HLA-A*26:01", "HLA-A*26:02", - "HLA-A*26:03", "HLA-A*29:02", "HLA-A*30:01", 'HLA-A*30:02', "HLA-A*31:01", "HLA-A*32:01", "HLA-A*33:01", - "HLA-A*66:01", "HLA-A*68:01", "HLA-A*68:02", "HLA-A*68:23", "HLA-A*69:01", "HLA-A*80:01", "HLA-B*07:01", - "HLA-B*07:02", "HLA-B*08:01", "HLA-B*08:02", "HLA-B*08:03", "HLA-B*14:02", "HLA-B*15:01", "HLA-B*15:02", - "HLA-B*15:03", "HLA-B*15:09", "HLA-B*15:17", "HLA-B*18:01", "HLA-B*27:02", "HLA-B*27:03", "HLA-B*27:04", - "HLA-B*27:05", "HLA-B*27:06", "HLA-B*35:01", "HLA-B*35:03", "HLA-B*37:01", "HLA-B*38:01", "HLA-B*39:01", - "HLA-B*39:06", "HLA-B*40:01", "HLA-B*40:02", "HLA-B*42:01", "HLA-B*44:02", "HLA-B*44:03", "HLA-B*45:01", - "HLA-B*46:01", "HLA-B*48:01", "HLA-B*51:01", "HLA-B*53:01", "HLA-B*54:01", "HLA-B*57:01", "HLA-B*58:01", - "HLA-B*83:01", "HLA-C*03:03", "HLA-C*04:01", "HLA-C*05:01", "HLA-C*06:02", "HLA-C*07:02", "HLA-C*08:02", - "HLA-C*12:03", "HLA-C*14:02", "HLA-C*15:02"]) - __supported_length = frozenset([8, 9, 10, 11, 12, 13, 14, 15]) - __name = "mhcflurry" - __version = "1.2.2" - - # the interface defines three class properties - @property - def name(self): - # returns the name of the predictor - return self.__name - - @property - def supportedAlleles(self): - # returns the supported alleles as strings (without the HLA prefix) - return self.__alleles - - @property - def supportedLength(self): - # returns the supported epitope lengths as iterable - return self.__supported_length - - @property - def version(self): - # returns the version of the predictor - return self.__version - - # the interface defines a function converting Fred2's HLA allele presentation - # into an internal presentation used by different methods. - # for this predictor we won't need it but still have to provide it! - # the function consumes a list of alleles and converts them into the internally used presentation - def convert_alleles(self, alleles): - # we just use the identity function - return alleles - - # additionally the interface defines a function `predict` - def predict(self, peptides, alleles=None, binary=False): - - # test whether one peptide or a list - if isinstance(peptides, basestring): - peptides = list(peptides) - - # if no alleles are specified do predictions for all supported alleles - if alleles is None: - alleles = self.supportedAlleles - else: - # filter for supported alleles - alleles = filter(lambda a: a.name in self.supportedAlleles, alleles) - - # test mhcflurry models are available => download if not - p = subprocess.Popen(['mhcflurry-downloads', 'path', 'models_class1'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - if p is not 0: - subprocess.call(['mhcflurry-downloads', 'fetch', 'models_class1']) - - # load model - predictor = Class1AffinityPredictor.load() - - result = {} - - for a in alleles: - result[a] = {} - for p in peptides: - seq = p.__str__() - binding_affinity = predictor.predict(allele=a, peptides=[seq]) - if binary: - if binding_affinity <= 500: - result[a][p] = 1.0 + result[a][p] = 0.0 else: - result[a][p] = 0.0 - else: - result[a][p] = binding_affinity - - # create EpitopePredictionResult object. This is a multi-indexed DataFrame - # with Peptide and Method as multi-index and alleles as columns - df_result = EpitopePredictionResult.from_dict(result) - df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], - names=['Seq', 'Method']) - return df_result + result[a][p] = binding_affinity + + # create EpitopePredictionResult object. This is a multi-indexed DataFrame + # with Peptide and Method as multi-index and alleles as columns + df_result = EpitopePredictionResult.from_dict(result) + df_result.index = pandas.MultiIndex.from_tuples([tuple((i, self.name)) for i in df_result.index], + names=['Seq', 'Method']) + return df_result +except BadSignatureException: + print "Class MHCFlurryPredictor cannot be constructed, because of a bad method signature (predict)" diff --git a/test.py b/test.py new file mode 100644 index 00000000..7f47815e --- /dev/null +++ b/test.py @@ -0,0 +1,6 @@ +from Fred2.EpitopePrediction import EpitopePredictorFactory, Peptide + +peptides = [Peptide("SYFPEITHI"), Peptide("FIASNGVKL"), Peptide("LLGATCMFV")] +print EpitopePredictorFactory("mhcflurry").predict(peptides) +print EpitopePredictorFactory("mhcnuggets-class-1").predict(peptides) +print EpitopePredictorFactory("mhcnuggets-class-2").predict(peptides) From 49329cbf70b6d70bb8bbf4ebd6e84f39b6481a8f Mon Sep 17 00:00:00 2001 From: Zethson Date: Mon, 20 May 2019 23:28:20 +0200 Subject: [PATCH 14/16] [FIX] removed test script --- test.py | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 test.py diff --git a/test.py b/test.py deleted file mode 100644 index 7f47815e..00000000 --- a/test.py +++ /dev/null @@ -1,6 +0,0 @@ -from Fred2.EpitopePrediction import EpitopePredictorFactory, Peptide - -peptides = [Peptide("SYFPEITHI"), Peptide("FIASNGVKL"), Peptide("LLGATCMFV")] -print EpitopePredictorFactory("mhcflurry").predict(peptides) -print EpitopePredictorFactory("mhcnuggets-class-1").predict(peptides) -print EpitopePredictorFactory("mhcnuggets-class-2").predict(peptides) From a37dc3f29b557150bd73779839ed30f93fd74a0a Mon Sep 17 00:00:00 2001 From: Zethson Date: Mon, 20 May 2019 23:45:59 +0200 Subject: [PATCH 15/16] [FIX] allele formatting --- Fred2/EpitopePrediction/ANN.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Fred2/EpitopePrediction/ANN.py b/Fred2/EpitopePrediction/ANN.py index 34c9d7fb..f6936408 100644 --- a/Fred2/EpitopePrediction/ANN.py +++ b/Fred2/EpitopePrediction/ANN.py @@ -225,7 +225,7 @@ class MHCNuggetsPredictor_2(AANNEpitopePrediction): "HLA-DQB1*03:02", "HLA-DQB1*03:19", "HLA-DQB1*04:02", "HLA-DQB1*05:01", "HLA-DQB1*05:02", "HLA-DQB1*05:03", "HLA-DQB1*06:02", "HLA-DQB1*06:03", "HLA-DQB1*06:04", "HLA-DRA0*10:1-DRB1*01:01", "HLA-DRA0*10:1-DRB1*03:01", "HLA-DRA0*10:1-DRB1*04:01", - "HLA-DRA0*10:1-DRB1*04:04", "HLA-DRA01*01-DRB1*07:01", "HLA-DRA0*10:1-DRB1*08:01", + "HLA-DRA0*10:1-DRB1*04:04", "HLA-DRA0*10:1-DRB1*07:01", "HLA-DRA0*10:1-DRB1*08:01", "HLA-DRA0*10:1-DRB1*09:01", "HLA-DRA0*10:1-DRB1*11:01", "HLA-DRA0*10:1-DRB1*13:01", "HLA-DRA0*10:1-DRB1*14:54", "HLA-DRA0*10:1-DRB1*15:01", "HLA-DRA0*10:1-DRB3*01:01", "HLA-DRA0*10:1-DRB3*02:02", "HLA-DRA0*10:1-DRB3*03:01", "HLA-DRA0*10:1-DRB4*01:03", From f85ad1cee5c9bfb18010d6c4dd833d0cff5ec8e2 Mon Sep 17 00:00:00 2001 From: b-schubert Date: Thu, 4 Jul 2019 09:02:56 +0200 Subject: [PATCH 16/16] Bump Version to 2.0.4 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3f3ecad6..417fd860 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ name='Fred2', # Version: - version='2.0.3', + version='2.0.4', description='A Framework for Epitope Detection and Vaccine Design', long_description=readme,