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

fixed sequence in MAGE test, added Titin test

parent f0cb596e
No related merge requests found
......@@ -47,9 +47,9 @@ script:
- >
mhcflurry-train-class1-allele-specific-models.py
--alleles HLA-A0101 HLA-A0201
--embedding-size 4
--hidden-layer-size 4
--training-epochs 5
--embedding-size 10
--hidden-layer-size 10
--training-epochs 20
# run tests
- nosetests test --with-coverage --cover-package=mhcflurry && ./lint.sh
after_success:
......
......@@ -16,8 +16,8 @@ N_EPOCHS = 250
ACTIVATION = "tanh"
INITIALIZATION_METHOD = "lecun_uniform"
EMBEDDING_DIM = 32
HIDDEN_LAYER_SIZE = 200
DROPOUT_PROBABILITY = 0.25
HIDDEN_LAYER_SIZE = 100
DROPOUT_PROBABILITY = 0.1
MAX_IC50 = 50000.0
LEARNING_RATE = 0.001
......
......@@ -28,6 +28,7 @@ from .peptide_encoding import (
indices_to_hotshot_encoding,
fixed_length_from_many_peptides
)
from .class1_allele_specific_hyperparameters import MAX_IC50
index_encoding = common_amino_acids.index_encoding
......@@ -67,7 +68,7 @@ def _infer_csv_separator(filename):
def load_dataframe(
filename,
peptide_length=None,
max_ic50=50000.0,
max_ic50=MAX_IC50,
sep=None,
species_column_name="species",
allele_column_name="mhc",
......@@ -148,7 +149,7 @@ def load_dataframe(
def load_allele_dicts(
filename,
max_ic50=50000.0,
max_ic50=MAX_IC50,
regression_output=False,
sep=None,
species_column_name="species",
......@@ -251,7 +252,7 @@ def load_allele_datasets(
filename,
peptide_length=9,
use_multiple_peptide_lengths=True,
max_ic50=50000.0,
max_ic50=MAX_IC50,
flatten_binary_encoding=True,
sep=None,
species_column_name="species",
......
......@@ -128,9 +128,10 @@ if __name__ == "__main__":
n_allele = len(allele_data.Y)
assert len(X) == n_allele
print("\n=== Training predictor for %s: %d samples" % (
print("\n=== Training predictor for %s: %d samples, %d unique" % (
allele_name,
n_allele))
n_allele,
len(set(allele_data.original_peptides))))
model = Class1BindingPredictor.from_hyperparameters(
name=allele_name,
......
from mhcflurry import Class1BindingPredictor
def test_MAGE_epitope():
# Test the A1 MAGE epitope ESDPIVAQY from
def test_A1_Titin_epitope():
# Test the A1 Titin epitope ESDPIVAQY from
# Identification of a Titin-Derived HLA-A1-Presented Peptide
# as a Cross-Reactive Target for Engineered MAGE A3-Directed
# T Cells
......@@ -13,7 +13,19 @@ def test_MAGE_epitope():
ic50 = ic50s[0]
assert ic50 <= 500
def test_HIV_epitope():
def test_A1_MAGE_epitope():
# Test the A1 MAGE epitope EVDPIGHLY 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(["EVDPIGHLY"])
print(ic50s)
assert len(ic50s) == 1
ic50 = ic50s[0]
assert ic50 <= 500
def test_A2_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")
......@@ -25,5 +37,6 @@ def test_HIV_epitope():
if __name__ == "__main__":
test_MAGE_epitope()
test_HIV_epitope()
test_A1_Titin_epitope()
test_A1_MAGE_epitope()
test_A2_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