Skip to content
Snippets Groups Projects
Commit a59fe505 authored by Alex Rubinsteyn's avatar Alex Rubinsteyn
Browse files

added known epitope tests

parent eee968c9
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@
from collections import defaultdict
import numpy as np
from six import string_types
from .peptide_encoding import fixed_length_index_encoding
from .amino_acid import (
......@@ -114,6 +115,10 @@ class PredictorBase(object):
amino acid characters. The prediction for a single peptide will be
the average of expanded 9mers.
"""
if isinstance(peptides, string_types):
raise TypeError("Input must be a list of peptides, not %s : %s" % (
peptides, type(peptides)))
input_matrix, original_peptide_indices = self.encode_peptides(peptides)
# non-9mer peptides get multiple predictions, which are then combined
# with the combine_fn argument
......
def test_known_class1_epitopes():
pass
from mhcflurry import Class1BindingPredictor
def test_MAGE_epitope():
# Test the A1 MAGE epitope ESDPIVAQY from
# Identification of a Titin-Derived HLA-A1-Presented Peptide
# as a Cross-Reactive Target for Engineered MAGE A3-Directed
# T Cells
model = Class1BindingPredictor.from_allele_name("HLA-A*01:01")
ic50s = model.predict_peptides_ic50(["ESDPIVAQY"])
print(ic50s)
assert len(ic50s) == 1
ic50 = ic50s[0]
assert ic50 <= 500
def test_HIV_epitope():
# Test the A2 HIV epitope SLYNTVATL from
# The HIV-1 HLA-A2-SLYNTVATL Is a Help-Independent CTL Epitope
model = Class1BindingPredictor.from_allele_name("HLA-A*02:01")
ic50s = model.predict_peptides_ic50(["SLYNTVATL"])
print(ic50s)
assert len(ic50s) == 1
ic50 = ic50s[0]
assert ic50 <= 500
if __name__ == "__main__":
test_MAGE_epitope()
test_HIV_epitope()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment