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
cdf8b695
Commit
cdf8b695
authored
6 years ago
by
Tim O'Donnell
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
6a292951
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
+2
-6
2 additions, 6 deletions
mhcflurry/allele_encoding.py
with
2 additions
and
6 deletions
mhcflurry/allele_encoding.py
+
2
−
6
View file @
cdf8b695
...
...
@@ -54,13 +54,9 @@ class AlleleEncoding(object):
Returns
-------
list of numpy arrays. Pass it to
numpy.array to get an array with shape
numpy.array to get an array with shape
(num sequences, sequence length, m) where m is
vector_encoding_length(vector_encoding_name)
The reason to return a list instead of an array is that the list can
use much less memory in the common case where many of the rows are
the same.
"""
cache_key
=
(
"
fixed_length_vector_encoding
"
,
...
...
@@ -87,7 +83,7 @@ class AlleleEncoding(object):
else
:
# Raw values
vector_encoded
=
allele_to_fixed_length_sequence
.
values
result
=
[
vector_encoded
[
i
]
for
i
in
indices
]
result
=
numpy
.
array
(
[
vector_encoded
[
i
]
for
i
in
indices
]
)
self
.
encoding_cache
[
cache_key
]
=
result
return
self
.
encoding_cache
[
cache_key
]
...
...
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