Skip to content

Commit

Permalink
Merge pull request #160 from openvax/fix-read-from-json
Browse files Browse the repository at this point in the history
Fixing serialization of VaccinePeptide objects
  • Loading branch information
julia326 committed Feb 28, 2018
2 parents 75783e5 + b2f7142 commit 1105c19
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cache:
- $HOME/.cache/pyensembl/GRCm38/ensembl87/
- $HOME/.cache/vaxrank
- $HOME/.cache/pip
timeout: 300
before_install:
- |
if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion vaxrank/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.9"
__version__ = "0.7.10"
2 changes: 1 addition & 1 deletion vaxrank/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def _query_wustl(self, predicted_effect, gene_name):
Returns a link to the WUSTL page for this variant, if present.
"""
amino_acids = predicted_effect.short_description
api_url = "http://docm.genome.wustl.edu/api/v1/variants.json?amino_acids=%s&genes=%s" % (
api_url = "http://www.docm.info/api/v1/variants.json?amino_acids=%s&genes=%s" % (
amino_acids, gene_name.upper())
logger.info("WUSTL link: %s", api_url)

Expand Down
7 changes: 5 additions & 2 deletions vaxrank/vaccine_peptide.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"wildtype_epitope_predictions",
"mutant_epitope_score",
"wildtype_epitope_score",
"num_mutant_epitopes_to_keep",
"manufacturability_scores"])

class VaccinePeptide(VaccinePeptideBase):
Expand Down Expand Up @@ -64,6 +65,7 @@ def __new__(
wildtype_epitope_predictions=wildtype_epitope_predictions,
mutant_epitope_score=mutant_epitope_score,
wildtype_epitope_score=wildtype_epitope_score,
num_mutant_epitopes_to_keep=num_mutant_epitopes_to_keep,
manufacturability_scores=ManufacturabilityScores.from_amino_acids(
mutant_protein_fragment.amino_acids))

Expand Down Expand Up @@ -189,8 +191,9 @@ def combined_score(self):
return self.expression_score * self.mutant_epitope_score

def to_dict(self):
epitope_predictions = self.mutant_epitope_predictions + self.wildtype_epitope_predictions
return {
"mutant_protein_fragment": self.mutant_protein_fragment,
"mutant_epitope_predictions": self.mutant_epitope_predictions,
"wildtype_epitope_predictions": self.wildtype_epitope_predictions,
"epitope_predictions": epitope_predictions,
"num_mutant_epitopes_to_keep": self.num_mutant_epitopes_to_keep,
}

0 comments on commit 1105c19

Please sign in to comment.