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
b6107213
Commit
b6107213
authored
9 years ago
by
Alex Rubinsteyn
Browse files
Options
Downloads
Patches
Plain Diff
fixed unit test import name
parent
32c5fa3e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_class1_binding_predictor.py
+15
-16
15 additions, 16 deletions
test/test_class1_binding_predictor.py
with
15 additions
and
16 deletions
test/test_class1_binding_predictor.py
+
15
−
16
View file @
b6107213
import
numpy
as
np
import
dummy_predictors
import
dummy_predictors.always_zero_predictor_with_unknown_AAs
as
predictor
from
dummy_predictors
import
always_zero_predictor_with_unknown_AAs
def
test_always_zero_9mer_inputs
():
...
...
@@ -12,18 +11,18 @@ def test_always_zero_9mer_inputs():
]
n_expected
=
len
(
test_9mer_peptides
)
y
=
predictor
.
predict_peptides
(
test_9mer_peptides
)
y
=
always_zero_predictor_with_unknown_AAs
.
predict_peptides
(
test_9mer_peptides
)
assert
len
(
y
)
==
n_expected
assert
np
.
all
(
y
==
0
)
# call the predict method for 9mers directly
y
=
predictor
.
predict_9mer_peptides
(
test_9mer_peptides
)
y
=
always_zero_predictor_with_unknown_AAs
.
predict_9mer_peptides
(
test_9mer_peptides
)
assert
len
(
y
)
==
n_expected
assert
np
.
all
(
y
==
0
)
ic50
=
predictor
.
predict_peptides_ic50
(
test_9mer_peptides
)
ic50
=
always_zero_predictor_with_unknown_AAs
.
predict_peptides_ic50
(
test_9mer_peptides
)
assert
len
(
y
)
==
n_expected
assert
np
.
all
(
ic50
==
predictor
.
max_ic50
),
ic50
assert
np
.
all
(
ic50
==
always_zero_predictor_with_unknown_AAs
.
max_ic50
),
ic50
def
test_always_zero_8mer_inputs
():
...
...
@@ -33,13 +32,13 @@ def test_always_zero_8mer_inputs():
]
n_expected
=
len
(
test_8mer_peptides
)
y
=
predictor
.
predict_peptides
(
test_8mer_peptides
)
y
=
always_zero_predictor_with_unknown_AAs
.
predict_peptides
(
test_8mer_peptides
)
assert
len
(
y
)
==
n_expected
assert
np
.
all
(
y
==
0
)
ic50
=
predictor
.
predict_peptides_ic50
(
test_8mer_peptides
)
ic50
=
always_zero_predictor_with_unknown_AAs
.
predict_peptides_ic50
(
test_8mer_peptides
)
assert
len
(
y
)
==
n_expected
assert
np
.
all
(
ic50
==
predictor
.
max_ic50
),
ic50
assert
np
.
all
(
ic50
==
always_zero_predictor_with_unknown_AAs
.
max_ic50
),
ic50
def
test_always_zero_10mer_inputs
():
...
...
@@ -50,21 +49,21 @@ def test_always_zero_10mer_inputs():
]
n_expected
=
len
(
test_10mer_peptides
)
y
=
predictor
.
predict_peptides
(
test_10mer_peptides
)
y
=
always_zero_predictor_with_unknown_AAs
.
predict_peptides
(
test_10mer_peptides
)
assert
len
(
y
)
==
n_expected
assert
np
.
all
(
y
==
0
)
ic50
=
predictor
.
predict_peptides_ic50
(
test_10mer_peptides
)
ic50
=
always_zero_predictor_with_unknown_AAs
.
predict_peptides_ic50
(
test_10mer_peptides
)
assert
len
(
y
)
==
n_expected
assert
np
.
all
(
ic50
==
predictor
.
max_ic50
),
ic50
assert
np
.
all
(
ic50
==
always_zero_predictor_with_unknown_AAs
.
max_ic50
),
ic50
def
test_encode_peptides_9mer
():
X
=
predictor
.
encode_9mer_peptides
([
"
AAASSSYYY
"
])
X
=
always_zero_predictor_with_unknown_AAs
.
encode_9mer_peptides
([
"
AAASSSYYY
"
])
assert
X
.
shape
[
0
]
==
1
,
X
.
shape
assert
X
.
shape
[
1
]
==
9
,
X
.
shape
X
,
indices
=
predictor
.
encode_peptides
([
"
AAASSSYYY
"
])
X
,
indices
=
always_zero_predictor_with_unknown_AAs
.
encode_peptides
([
"
AAASSSYYY
"
])
assert
len
(
indices
)
==
1
assert
indices
[
0
]
==
0
assert
X
.
shape
[
0
]
==
1
,
X
.
shape
...
...
@@ -72,7 +71,7 @@ def test_encode_peptides_9mer():
def
test_encode_peptides_8mer
():
X
,
indices
=
predictor
.
encode_peptides
([
"
AAASSSYY
"
])
X
,
indices
=
always_zero_predictor_with_unknown_AAs
.
encode_peptides
([
"
AAASSSYY
"
])
assert
len
(
indices
)
==
9
assert
(
indices
==
0
).
all
()
assert
X
.
shape
[
0
]
==
9
,
(
X
.
shape
,
X
)
...
...
@@ -80,7 +79,7 @@ def test_encode_peptides_8mer():
def
test_encode_peptides_10mer
():
X
,
indices
=
predictor
.
encode_peptides
([
"
AAASSSYYFF
"
])
X
,
indices
=
always_zero_predictor_with_unknown_AAs
.
encode_peptides
([
"
AAASSSYYFF
"
])
assert
len
(
indices
)
==
10
assert
(
indices
==
0
).
all
()
assert
X
.
shape
[
0
]
==
10
,
(
X
.
shape
,
X
)
...
...
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