Skip to content

Commit

Permalink
Merge pull request #1397: Fix failing CI tests (ancestral/translate)
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin committed Jan 25, 2024
2 parents cae562a + 0dd471b commit d83d671
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 16 deletions.
4 changes: 2 additions & 2 deletions tests/functional/ancestral/cram/case-sensitive.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Change the _reference_ to lowercase
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \
> "$TESTDIR/../data/simple-genome/nt_muts.ref-seq.json" \
> "nt_muts.ref-seq.json" \
> --exclude-paths "root['meta']['updated']"
> --exclude-paths "root['generated_by']"
{}


Expand All @@ -38,5 +38,5 @@ be lowecase which will be compared against the uppercase reference
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \
> "$TESTDIR/../data/simple-genome/nt_muts.ref-seq.json" \
> "nt_muts.ref-seq.json" \
> --exclude-paths "root['meta']['updated']"
> --exclude-paths "root['generated_by']"
{}
4 changes: 2 additions & 2 deletions tests/functional/ancestral/cram/general.t
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ node-data JSON we diff against.
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \
> "$TESTDIR/../data/simple-genome/nt_muts.ref-seq.json" \
> "nt_muts.ref-seq.json" \
> --exclude-paths "root['meta']['updated']"
> --exclude-paths "root['generated_by']"
{}

Same as above but without providing a `--root-sequence`. The effect of this on behaviour is:
Expand All @@ -40,5 +40,5 @@ mutations (as there's nothing to compare the root node to)
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \
> "$TESTDIR/../data/simple-genome/nt_muts.no-ref-seq.json" \
> "nt_muts.no-ref-seq.json" \
> --exclude-paths "root['meta']['updated']"
> --exclude-paths "root['generated_by']"
{}
2 changes: 1 addition & 1 deletion tests/functional/ancestral/cram/vcf-multi-allele.t
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ See <https://github.com/nextstrain/augur/issues/1380> for the bug this is testin
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \
> "$DATA/nt_muts.ref-seq.json" \
> nt_muts.json \
> --exclude-regex-paths "root\['nodes'\]\['.+'\]\['sequence'\]"
> --exclude-regex-paths "root\['nodes'\]\['.+'\]\['sequence'\]" "root\['generated_by'\]"
{'iterable_item_added': {"root['nodes']['sample_B']['muts'][0]": 'A30G'}}
$ cat > expected.vcf <<EOF
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/ancestral/cram/vcf.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ but it will have the reference sequence attached.
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" \
> "$DATA/nt_muts.ref-seq.json" \
> "nt_muts.vcf-input.ref-seq.json" \
> --exclude-regex-paths "root\['nodes'\]\['.+'\]\['sequence'\]" "root['meta']['updated']"
> --exclude-regex-paths "root\['nodes'\]\['.+'\]\['sequence'\]" "root\['generated_by'\]"
{}

Here's the same mutations as in $DATA/nt_muts.ref-seq.json,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
"type": "source"
}
},
"generated_by": {
"program": "augur",
"version": "23.1.1"
},
"mask": "00000000000000000000000000000000000000000000000000",
"nodes": {
"node_AB": {
Expand Down
13 changes: 7 additions & 6 deletions tests/functional/translate/cram/root-mutations.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ Setup
$ export DATA="$TESTDIR/../data/simple-genome"

This is the same as the "general.t" test, but we are modifying the input data
such that the reference sequence contains "G" at pos 20 (1-based), and
include a compensating mutation G20A on the root node.
This results in the reference translation of gene1 to be MPCE* not MPCG*.
(Note that the compensating nuc mutation doesn't actually need to be present
in the JSON, `augur translate` just looks at the sequence attached to each node.)
such that the reference sequence contains "G" at pos 20 (1-based), and include a
compensating mutation G20A on the root node. (This manipulation would be much
nicer using `jq` but it's not (yet) available in all nextstrain environments.)
This results in the reference translation of gene1 to be MPCE* not MPCG*. (Note
that the compensating nuc mutation doesn't actually need to be present in the
JSON, `augur translate` just looks at the sequence attached to each node.)

$ sed '29s/^/ "G20A",\n/' "$ANC_DATA/nt_muts.ref-seq.json" |
$ sed '24s/^/ "G20A",\n/' "$ANC_DATA/nt_muts.ref-seq.json" |
> sed 's/"nuc": "AAAAAAAAAATGCCCTGCGGG/"nuc": "AAAAAAAAAATGCCCTGCGAG/' > nt_muts.json

$ ${AUGUR} translate \
Expand Down

0 comments on commit d83d671

Please sign in to comment.