-
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.
Merge pull request #1658: clades: Update Cram tests
- Loading branch information
Showing
20 changed files
with
106 additions
and
94 deletions.
There are no files selected for viewing
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,2 @@ | ||
export AUGUR="${AUGUR:-$TESTDIR/../../../../bin/augur}" | ||
set -o pipefail |
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,18 @@ | ||
Integration tests for augur clades. | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Test custom membership key + label key. The only change should be the key names | ||
|
||
$ ${AUGUR} clades \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --mutations "$TESTDIR/../data/aa_muts.json" "$TESTDIR/../data/nt_muts_small.json" \ | ||
> --clades "$TESTDIR/../data/clades.tsv" \ | ||
> --membership-name lineage --label-name origin \ | ||
> --output-node-data clades_custom.json &>/dev/null | ||
|
||
$ cat clades_custom.json | sed "s/lineage/clade_membership/" | sed "s/origin/clade/" > clades_sed.json | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/clades.json" clades_sed.json \ | ||
> --exclude-paths "root['generated_by']" | ||
{} |
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,12 @@ | ||
Integration tests for augur clades. | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Multiple mutations at the same position on a single branch are a fatal error | ||
|
||
$ ${AUGUR} clades \ | ||
> --tree "$TESTDIR/../data/toy_tree.nwk" \ | ||
> --mutations "$TESTDIR/../data/toy_muts_multiple.json" \ | ||
> --clades "$TESTDIR/../data/toy_clades_nuc.tsv" | ||
ERROR: Multiple mutations at the same position on a single branch were found: Node A (nuc), Node AB (geneName) | ||
[2] |
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,16 @@ | ||
Integration tests for augur clades. | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Test the ability to _not_ export a branch label (same logic as not exporting the membership) | ||
|
||
$ ${AUGUR} clades \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --mutations "$TESTDIR/../data/aa_muts.json" "$TESTDIR/../data/nt_muts_small.json" \ | ||
> --clades "$TESTDIR/../data/clades.tsv" \ | ||
> --label-name none \ | ||
> --output-node-data clades_no-labels.json &>/dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/clades.json" clades_no-labels.json \ | ||
> --exclude-paths "root['generated_by']" | ||
{'dictionary_item_removed': [root['branches']]} |
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,43 @@ | ||
Integration tests for augur clades. | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
A clade which exists at the root is not identified by inferring the root state | ||
(i.e. we don't infer the root state to be A if we observe a subsequent A10T mutation) | ||
This is an oversight and ideally would be fixed | ||
|
||
$ ${AUGUR} clades \ | ||
> --tree "$TESTDIR/../data/toy_tree.nwk" \ | ||
> --mutations "$TESTDIR/../data/toy_muts_no_ref.json" \ | ||
> --clades "$TESTDIR/../data/toy_clades_nuc.tsv" \ | ||
> --output-node-data toy_clades_1.json &>/dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/toy_clades_1.json" toy_clades_1.json \ | ||
> --exclude-paths "root['generated_by']" | ||
{} | ||
|
||
A clade which exists at the root is identified (and correctly propogated) if the root sequence | ||
is explicitly set. | ||
|
||
$ ${AUGUR} clades \ | ||
> --tree "$TESTDIR/../data/toy_tree.nwk" \ | ||
> --mutations "$TESTDIR/../data/toy_muts_ref.json" \ | ||
> --clades "$TESTDIR/../data/toy_clades_nuc.tsv" \ | ||
> --output-node-data toy_clades_2a.json &>/dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/toy_clades_2.json" toy_clades_2a.json \ | ||
> --exclude-paths "root['generated_by']" | ||
{} | ||
|
||
A clade which exists at the root is identified (and correctly propogated) without a root sequence | ||
if the (branch leading to the) root has the clade-defining mutation. | ||
|
||
$ ${AUGUR} clades \ | ||
> --tree "$TESTDIR/../data/toy_tree.nwk" \ | ||
> --mutations "$TESTDIR/../data/toy_muts_explicit_root_mutation.json" \ | ||
> --clades "$TESTDIR/../data/toy_clades_nuc.tsv" \ | ||
> --output-node-data toy_clades_2b.json &>/dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/toy_clades_2.json" toy_clades_2b.json \ | ||
> --exclude-paths "root['generated_by']" | ||
{} |
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,15 @@ | ||
Integration tests for augur clades. | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Test augur clades with simple Zika input files and hierarchical clades. | ||
|
||
$ ${AUGUR} clades \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --mutations "$TESTDIR/../data/aa_muts.json" "$TESTDIR/../data/nt_muts_small.json" \ | ||
> --clades "$TESTDIR/../data/clades.tsv" \ | ||
> --output-node-data clades.json &>/dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/clades.json" clades.json \ | ||
> --exclude-paths "root['generated_by']" | ||
{} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.