Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mhc_rank
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patrick Skillman-Lawrence
mhc_rank
Commits
a59fe505
Commit
a59fe505
authored
8 years ago
by
Alex Rubinsteyn
Browse files
Options
Downloads
Patches
Plain Diff
added known epitope tests
parent
eee968c9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mhcflurry/predictor_base.py
+5
-0
5 additions, 0 deletions
mhcflurry/predictor_base.py
test/test_known_class1_epitopes.py
+28
-2
28 additions, 2 deletions
test/test_known_class1_epitopes.py
with
33 additions
and
2 deletions
mhcflurry/predictor_base.py
+
5
−
0
View file @
a59fe505
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
test/test_known_class1_epitopes.py
+
28
−
2
View file @
a59fe505
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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment