-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ancestral] Check invalid args up-front
Check that provided arguments are compatible. Where possible we use argparse built-ins, but they don't cover everything we want to check. This checking isn't intended to replace conditional checks in the code which check for arg existence (as demonstrated by the additional conditional added here), however by checking for invalid combinations up-front we can exit quickly.
- Loading branch information
1 parent
7cb3848
commit 4af0996
Showing
3 changed files
with
70 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
tests/functional/ancestral/cram/infer-amino-acid-sequences-with-missing-arguments.t
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Input FASTA + VCF output is not possible | ||
|
||
$ ${AUGUR} ancestral \ | ||
> --tree $TESTDIR/../data/tree.nwk \ | ||
> --alignment $TESTDIR/../data/aligned.fasta \ | ||
> --output-vcf "$CRAMTMP/$TESTFILE/output.vcf" > /dev/null | ||
ERROR: VCF output has been requested but the input alignment is not VCF. | ||
[2] | ||
|
||
Input VCF + FASTA output is not possible (Note that the input file doesn't exist, but we exit before that's checked) | ||
|
||
$ ${AUGUR} ancestral \ | ||
> --tree $TESTDIR/../data/tree.nwk \ | ||
> --alignment $TESTDIR/../data/snps.vcf \ | ||
> --output-sequences "$CRAMTMP/$TESTFILE/output.fasta" > /dev/null | ||
ERROR: Sequence (fasta) output has been requested but the input alignment is VCF. | ||
[2] | ||
|
||
Output FASTA _and_ VCF is not possible | ||
|
||
$ ${AUGUR} ancestral \ | ||
> --tree $TESTDIR/../data/tree.nwk \ | ||
> --alignment $TESTDIR/../data/aligned.fasta \ | ||
> --output-vcf "$CRAMTMP/$TESTFILE/output.vcf" \ | ||
> --output-sequences "$CRAMTMP/$TESTFILE/output.fasta" > /dev/null | ||
ERROR: Both sequence (fasta) and VCF output have been requested, but these are incompatible. | ||
[2] | ||
|
||
|
||
Try to infer ancestral amino acid sequences without all required arguments. | ||
This should fail. | ||
|
||
$ ${AUGUR} ancestral \ | ||
> --tree $TESTDIR/../data/tree.nwk \ | ||
> --alignment $TESTDIR/../data/aligned.fasta \ | ||
> --annotation $TESTDIR/../data/zika_outgroup.gb \ | ||
> --genes ENV PRO \ | ||
> --output-node-data "$CRAMTMP/$TESTFILE/ancestral_mutations.json" > /dev/null | ||
ERROR: For amino acid sequence reconstruction, you must provide an annotation file, a list of genes, and a template path to amino acid sequences. | ||
[2] |