From 74c358d589a1c4398d2c7a90d121e2b6325b037b Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Mon, 31 Jul 2023 13:31:34 +0200 Subject: [PATCH] Don't use nargs in aggregate_report_evaluation parameter --- pvactools/tools/pvacseq/generate_protein_fasta.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pvactools/tools/pvacseq/generate_protein_fasta.py b/pvactools/tools/pvacseq/generate_protein_fasta.py index d0b463073..36f41a636 100644 --- a/pvactools/tools/pvacseq/generate_protein_fasta.py +++ b/pvactools/tools/pvacseq/generate_protein_fasta.py @@ -60,10 +60,9 @@ def define_parser(): ) parser.add_argument( "--aggregate-report-evaluation", - help="When running with an aggregate report input TSV, only include variants with this evaluation. Specifiy multiple times to include multiple evaluation states.", - nargs="*", - default=['Accept'], - choices=["Pending", "Accept", "Reject", "Review"] + help="When running with an aggregate report input TSV, only include variants with this evaluation. Valid values for this field are Accept, Reject, Pending, and Review. Specifiy multiple values as a comma-separated list to include multiple evaluation states.", + default='Accept', + type=lambda s:[e for e in s.split(',')], ) parser.add_argument( "-d", "--downstream-sequence-length", @@ -195,6 +194,9 @@ def main(args_input = sys.argv[1:]): else: sys.exit("The downstream sequence length needs to be a positive integer or 'full'") + if not (set(args.aggregate_report_evaluation)).issubset(set(['Accept', 'Reject', 'Review', 'Pending'])): + sys.exit("Aggregate report evaluation ({}) contains invalid values.".format(args.aggregate_report_evaluation)) + temp_dir = tempfile.mkdtemp() proximal_variants_tsv = convert_vcf(args.input_vcf, temp_dir, args.sample_name, args.phased_proximal_variants_vcf, args.flanking_sequence_length, args.pass_only) generate_fasta(args.flanking_sequence_length, downstream_sequence_length, temp_dir, proximal_variants_tsv)