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

Don't use nargs in aggregate_report_evaluation parameter #1009

Merged
merged 1 commit into from
Aug 7, 2023
Merged
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
10 changes: 6 additions & 4 deletions pvactools/tools/pvacseq/generate_protein_fasta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand Down
Loading