From 9056148631ea10c7784fc5272b5fc819558f2909 Mon Sep 17 00:00:00 2001 From: James Hadfield Date: Thu, 21 Dec 2023 16:59:24 +1300 Subject: [PATCH] [ancestral] Update test for root-seq arg behaviour This test was modified to confirm my own understanding of the code which allowed the next set of commits (modifying `augur translate`). Rather than drop it, it's helpful to include it in the repo for future reference. This commit is related to . --- tests/functional/ancestral/cram/general.t | 13 +++-- .../simple-genome/nt_muts.no-ref-seq.json | 51 +++++++++++++++++++ 2 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 tests/functional/ancestral/data/simple-genome/nt_muts.no-ref-seq.json diff --git a/tests/functional/ancestral/cram/general.t b/tests/functional/ancestral/cram/general.t index abe7c7d7f..6a791b376 100644 --- a/tests/functional/ancestral/cram/general.t +++ b/tests/functional/ancestral/cram/general.t @@ -22,8 +22,12 @@ node-data JSON we diff against. > "nt_muts.ref-seq.json" {} -Same as above but without a root-sequence so no mutations inferred on the root node -(and thus the inferred reference will be different) +Same as above but without providing a `--root-sequence`. The effect of this on behaviour is: +- The JSON['reference']['nuc'] is not actually the "reference", because we +don't know what this is! Instead it's the inferred root-node sequence. +See for more. +- An array of 'muts' is still present on the root node, but it will never contain any +mutations (as there's nothing to compare the root node to) $ ${AUGUR} ancestral \ > --tree "$TESTDIR/../data/simple-genome/tree.nwk" \ @@ -33,7 +37,6 @@ Same as above but without a root-sequence so no mutations inferred on the root n $ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \ - > "$TESTDIR/../data/simple-genome/nt_muts.ref-seq.json" \ - > "nt_muts.no-ref-seq.json" \ - > --exclude-paths "root['reference']['nuc']" "root['nodes']['node_root']['muts']" + > "$TESTDIR/../data/simple-genome/nt_muts.no-ref-seq.json" \ + > "nt_muts.no-ref-seq.json" {} diff --git a/tests/functional/ancestral/data/simple-genome/nt_muts.no-ref-seq.json b/tests/functional/ancestral/data/simple-genome/nt_muts.no-ref-seq.json new file mode 100644 index 000000000..402055aa5 --- /dev/null +++ b/tests/functional/ancestral/data/simple-genome/nt_muts.no-ref-seq.json @@ -0,0 +1,51 @@ +{ + "annotations": { + "nuc": { + "end": 50, + "start": 1, + "strand": "+", + "type": "source" + } + }, + "generated_by": { + "program": "augur", + "version": "23.1.1" + }, + "mask": "00000000000000000000000000000000000000000000000000", + "nodes": { + "node_AB": { + "muts": [ + "A7G", + "C14T", + "T18C", + "A33G", + "A43T" + ], + "sequence": "AAAACAGAAATGCTCTGCGGGTAAAAAAAAAAGAACTACTTGTCCATAAA" + }, + "node_root": { + "muts": [], + "sequence": "AAAACAAAAATGCCCTGTGGGTAAAAAAAAAAAAACTACTTGACCATAAA" + }, + "sample_A": { + "muts": [ + "G33C", + "C39T" + ], + "sequence": "AAAACAGAAATGCTCTGCGGGTAAAAAAAAAACAACTATTTGTCCATAAA" + }, + "sample_B": { + "muts": [ + "G42A" + ], + "sequence": "AAAACAGAAATGCTCTGCGGGTAAAAAAAAAAGAACTACTTATCCATAAA" + }, + "sample_C": { + "muts": [], + "sequence": "AAAACAAAAATGCCCTGTGGGTAAAAAAAAAAAAACTACTTGACCATAAA" + } + }, + "reference": { + "nuc": "AAAACAAAAATGCCCTGTGGGTAAAAAAAAAAAAACTACTTGACCATAAA" + } +} \ No newline at end of file