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
67f91b16
Commit
67f91b16
authored
6 years ago
by
Tim O'Donnell
Browse files
Options
Downloads
Patches
Plain Diff
fixes
parent
14a64588
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
mhcflurry/allele_encoding.py
+6
-4
6 additions, 4 deletions
mhcflurry/allele_encoding.py
with
6 additions
and
4 deletions
mhcflurry/allele_encoding.py
+
6
−
4
View file @
67f91b16
...
@@ -38,9 +38,9 @@ class AlleleEncoding(object):
...
@@ -38,9 +38,9 @@ class AlleleEncoding(object):
if
self
.
borrow_from
is
None
:
if
self
.
borrow_from
is
None
:
assert
allele_to_sequence
is
not
None
assert
allele_to_sequence
is
not
None
all_alleles
=
(
all_alleles
=
(
sorted
(
allele_to_sequence
)
sorted
(
allele_to_sequence
)
)
if
alleles
is
None
#
if alleles is None
else
list
(
sorted
(
alleles
.
unique
())))
#
else list(sorted(alleles.unique())))
self
.
allele_to_index
=
dict
(
self
.
allele_to_index
=
dict
(
(
allele
,
i
)
(
allele
,
i
)
for
(
i
,
allele
)
in
enumerate
(
all_alleles
))
for
(
i
,
allele
)
in
enumerate
(
all_alleles
))
...
@@ -58,7 +58,9 @@ class AlleleEncoding(object):
...
@@ -58,7 +58,9 @@ class AlleleEncoding(object):
if
alleles
is
not
None
:
if
alleles
is
not
None
:
assert
all
(
assert
all
(
allele
in
self
.
allele_to_index
for
allele
in
alleles
)
allele
in
self
.
allele_to_index
for
allele
in
alleles
),
\
"
Missing alleles:
"
+
"
"
.
join
([
a
for
a
in
alleles
if
a
not
in
self
.
allele_to_index
])
self
.
indices
=
alleles
.
map
(
self
.
allele_to_index
)
self
.
indices
=
alleles
.
map
(
self
.
allele_to_index
)
assert
not
self
.
indices
.
isnull
().
any
()
assert
not
self
.
indices
.
isnull
().
any
()
else
:
else
:
...
...
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