Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making --max-mutations-in-report an output arg. #161

Merged
merged 1 commit into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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