Skip to content

Commit

Permalink
cr Alex
Browse files Browse the repository at this point in the history
  • Loading branch information
julia326 committed Oct 28, 2016
1 parent 1838d8b commit 6ab37d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions vaxrank/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import sys
import logging
import logging.config
import pickle
import pkg_resources

from argparse import ArgumentParser
Expand All @@ -28,6 +27,7 @@
mhc_alleles_from_args,
mhc_binding_predictor_from_args,
)
from six.moves import cPickle
from varcode.cli import variant_collection_from_args

from .core_logic import ranked_vaccine_peptides
Expand Down Expand Up @@ -59,7 +59,12 @@ def new_run_arg_parser():


def cached_run_arg_parser():
arg_parser = ArgumentParser()
arg_parser = ArgumentParser(
prog="vaxrank",
description=(
"Select personalized vaccine peptides from cancer variants, "
"expression data, and patient HLA type."),
)
arg_parser.add_argument(
"--input-pickle-file",
default="",
Expand Down Expand Up @@ -178,7 +183,7 @@ def ranked_variant_list_with_saved_args(args):
"""
if hasattr(args, 'input_pickle_file'):
with open(args.input_pickle_file, 'rb') as f:
data = pickle.load(f)
data = cPickle.load(f)
logger.info('Loaded pickle data from %s', args.input_pickle_file)
return data

Expand Down Expand Up @@ -208,7 +213,7 @@ def ranked_variant_list_with_saved_args(args):
# be useful to save the data to be able to iterate just on the formatting
if args.output_pickle_file:
with open(args.output_pickle_file, 'wb') as f:
pickle.dump(data, f)
cPickle.dump(data, f, protocol=2)
logger.info('Wrote pickle file to %s', args.output_pickle_file)

return data
Expand Down
2 changes: 1 addition & 1 deletion vaxrank/manufacturability.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def cysteine_count(amino_acids):
def combine_scoring_functions(*scoring_functions):
"""
Given a list of scoring functions, make a namedtuple with
fields of the same names. Returns a ManufacturabilityScores object.
fields of the same names. Returns the ManufacturabilityScores class.
"""
names = [fn.__name__ for fn in scoring_functions]

Expand Down

0 comments on commit 6ab37d8

Please sign in to comment.