Skip to content

Commit

Permalink
[ancestral] Update test for root-seq arg behaviour
Browse files Browse the repository at this point in the history
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
<#1362>.
  • Loading branch information
jameshadfield committed Jan 22, 2024
1 parent ca471cf commit 2a9f585
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/functional/ancestral/cram/general.t
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/nextstrain/augur/issues/1362> 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" \
Expand All @@ -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"
{}
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit 2a9f585

Please sign in to comment.