Skip to content

Commit

Permalink
Merge pull request #161 from openvax/fix-max-mutations-in-report
Browse files Browse the repository at this point in the history
Making --max-mutations-in-report an output arg.
  • Loading branch information
julia326 committed Mar 6, 2018
2 parents 1105c19 + 0f4b6af commit df7a6bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion vaxrank/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.10"
__version__ = "0.7.11"
14 changes: 9 additions & 5 deletions vaxrank/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ def add_output_args(arg_parser):
default="python.log",
help="File path to write the vaxrank Python log to")

output_args_group.add_argument(
"--max-mutations-in-report",
type=int,
help="Number of mutations to report")


def add_vaccine_peptide_args(arg_parser):
vaccine_peptide_group = arg_parser.add_argument_group("Vaccine peptide options")
Expand All @@ -199,11 +204,6 @@ def add_vaccine_peptide_args(arg_parser):
type=int,
help="Number of vaccine peptides to generate for each mutation")

vaccine_peptide_group.add_argument(
"--max-mutations-in-report",
type=int,
help="Number of mutations to report")

vaccine_peptide_group.add_argument(
"--min-epitope-score",
default=1e-10,
Expand Down Expand Up @@ -256,6 +256,10 @@ def ranked_variant_list_with_metadata(args):
# the JSON data from the previous run will have the older args saved, which may need to
# be overridden with args from this run (which all be output related)
data['args'].update(vars(args))

# if we need to truncate the variant list based on max_mutations_in_report, do that here
if len(data['variants']) > args.max_mutations_in_report:
data['variants'] = data['variants'][:args.max_mutations_in_report]
return data

# get various things from user args
Expand Down

0 comments on commit df7a6bf

Please sign in to comment.