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
09201ca5
Commit
09201ca5
authored
8 years ago
by
Tim O'Donnell
Browse files
Options
Downloads
Patches
Plain Diff
Better error message
parent
37b0585f
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/class1_allele_specific/load.py
+9
-3
9 additions, 3 deletions
mhcflurry/class1_allele_specific/load.py
test/test_class1_allele_specific_cv_and_train_command.py
+1
-0
1 addition, 0 deletions
test/test_class1_allele_specific_cv_and_train_command.py
with
10 additions
and
3 deletions
mhcflurry/class1_allele_specific/load.py
+
9
−
3
View file @
09201ca5
...
...
@@ -23,6 +23,9 @@ import pandas
from
..downloads
import
get_path
from
..common
import
normalize_allele_name
_ALLELE_PREDICTOR_CACHE
=
{}
_PRODUCTION_MODELS_DATAFRAME
=
None
def
from_allele_name
(
allele_name
):
"""
...
...
@@ -42,7 +45,12 @@ def from_allele_name(allele_name):
return
_ALLELE_PREDICTOR_CACHE
[
allele_name
]
models_df
=
production_models_dataframe
()
predictor_name
=
models_df
.
ix
[
allele_name
].
predictor_name
try
:
predictor_name
=
models_df
.
ix
[
allele_name
].
predictor_name
except
KeyError
:
raise
ValueError
(
"
No models for allele
'
%s
'
. Alleles with models: %s
"
%
(
allele_name
,
'
'
.
join
(
supported_alleles
())))
model_path
=
get_path
(
"
models_class1_allele_specific_single
"
,
"
models/%s.pickle
"
%
predictor_name
)
...
...
@@ -52,7 +60,6 @@ def from_allele_name(allele_name):
_ALLELE_PREDICTOR_CACHE
[
allele_name
]
=
predictor
return
predictor
_ALLELE_PREDICTOR_CACHE
=
{}
def
supported_alleles
():
...
...
@@ -75,4 +82,3 @@ def production_models_dataframe():
_PRODUCTION_MODELS_DATAFRAME
.
index
=
(
_PRODUCTION_MODELS_DATAFRAME
.
allele
)
return
_PRODUCTION_MODELS_DATAFRAME
_PRODUCTION_MODELS_DATAFRAME
=
None
This diff is collapsed.
Click to expand it.
test/test_class1_allele_specific_cv_and_train_command.py
+
1
−
0
View file @
09201ca5
...
...
@@ -114,6 +114,7 @@ def verify_trained_models(base_temp_dir):
environ
[
"
MHCFLURRY_DOWNLOADS_DIR
"
]
=
old_dir
downloads
.
configure
()
if
__name__
==
'
__main__
'
:
if
len
(
sys
.
argv
)
>
1
:
# Make it possible to continue from a previous run since this test
...
...
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