diff --git a/tests/builds/zika/auspice/zika_tip-frequencies.json b/tests/builds/zika/auspice/zika_tip-frequencies.json index b95d444ae..086656e64 100644 --- a/tests/builds/zika/auspice/zika_tip-frequencies.json +++ b/tests/builds/zika/auspice/zika_tip-frequencies.json @@ -1,92 +1,92 @@ { "BRA/2016/FC_6706": { "frequencies": [ - 0.022579, - 0.011312, - 0.206983, - 0.102282 + 0.022368, + 0.011759, + 0.207309, + 0.102551 ] }, "COL/FLR_00008/2015": { "frequencies": [ - 0.243453, - 0.208443, - 0.008645, - 0.010659 + 0.244555, + 0.204597, + 0.008456, + 0.010737 ] }, "Colombia/2016/ZC204Se": { "frequencies": [ - 0.126056, - 0.231597, - 0.014167, - 0.017099 + 0.12489, + 0.234574, + 0.013671, + 0.017245 ] }, "DOM/2016/BB_0183": { "frequencies": [ - 0.017888, - 0.009342, - 0.183671, - 0.148759 + 0.017736, + 0.009645, + 0.185763, + 0.148494 ] }, "EcEs062_16": { "frequencies": [ - 0.018981, - 0.009763, - 0.190994, - 0.134398 + 0.018817, + 0.010092, + 0.192704, + 0.134289 ] }, "HND/2016/HU_ME59": { "frequencies": [ - 0.009484, - 0.006254, - 0.090552, - 0.457824 + 0.009425, + 0.006444, + 0.093589, + 0.456546 ] }, "PAN/CDC_259359_V1_V3/2015": { "frequencies": [ - 0.224832, - 0.214575, - 0.008963, - 0.011176 + 0.225577, + 0.211235, + 0.008761, + 0.011258 ] }, "PRVABC59": { "frequencies": [ - 0.243453, - 0.208443, - 0.008645, - 0.010659 + 0.244555, + 0.204597, + 0.008456, + 0.010737 ] }, "VEN/UF_1/2016": { "frequencies": [ - 0.030662, - 0.016483, - 0.206983, - 0.070196 + 0.030336, + 0.017436, + 0.204461, + 0.07079 ] }, "ZKC2/2016": { "frequencies": [ - 0.062612, - 0.083787, - 0.080395, - 0.036947 + 0.06174, + 0.089622, + 0.076833, + 0.037353 ] }, "generated_by": { "program": "augur", - "version": "7.0.2" + "version": "19.2.0" }, "pivots": [ - 2015.75, - 2016.0, - 2016.25, - 2016.5 + 2015.7521, + 2016.0041, + 2016.2527, + 2016.5014 ] } \ No newline at end of file diff --git a/tests/functional/frequencies.t b/tests/functional/frequencies.t index 4ba9c0f92..51d7d6cfd 100644 --- a/tests/functional/frequencies.t +++ b/tests/functional/frequencies.t @@ -34,26 +34,24 @@ Pivots get calculated from the requested date range. Calculate KDE-based tip frequencies for a time period with relative dates. Testing relative dates deterministically from the shell is tricky. To keep these tests simple and avoid freezing the system date to specific values, this test checks the logical consistency of the requested relative dates and pivot interval. -With a minimum date of 1 year (12 months) ago, a maximum date of 6 months ago, and a pivot interval of 3 months, we expect only 2 pivots in the final output. -Since the test data are much older than the time period requested, all strains will always have frequencies of 0 for the 2 requested pivots. -As long as we always calculate 2 pivots with frequencies of 0 for all strains, we can ignore the actual pivot values calculated for the relative dates in the diff below. - -TODO: un-comment this test, which is failing on 2022-06-01 with 3 pivot points: https://github.com/nextstrain/augur/runs/6694014041 - -$ ${AUGUR} frequencies \ -> --method kde \ -> --tree "frequencies/tree.nwk" \ -> --metadata "frequencies/metadata.tsv" \ -> --pivot-interval 3 \ -> --min-date 1Y \ -> --max-date 6M \ -> --output "$TMP/tip-frequencies.json" > /dev/null - -$ python3 "$TESTDIR/../../scripts/diff_jsons.py" \ -> --exclude-paths "root['generated_by']['version']" "root['pivots']" -- \ -> "frequencies/zika_tip-frequencies_with_relative_dates.json" \ -> "$TMP/tip-frequencies.json" -{} -$ rm -f "$TMP/tip-frequencies.json" - -$ popd > /dev/null +With a minimum date of 12 months ago, a maximum date of 6 months ago, and a pivot interval of 3 months, we always expect 3 pivots in the final output corresponding to the end date (always included), the 3-month pivot before that end date, and the start date (also should always be included). +Since the test data are much older than the time period requested, all strains will always have frequencies of 0 for the 3 requested pivots. +As long as we always calculate 3 pivots with frequencies of 0 for all strains, we can ignore the actual pivot values calculated for the relative dates in the diff below. + + $ ${AUGUR} frequencies \ + > --method kde \ + > --tree "frequencies/tree.nwk" \ + > --metadata "frequencies/metadata.tsv" \ + > --pivot-interval 3 \ + > --min-date 12M \ + > --max-date 6M \ + > --output "$TMP/tip-frequencies.json" > /dev/null + + $ python3 "$TESTDIR/../../scripts/diff_jsons.py" \ + > --exclude-paths "root['generated_by']['version']" "root['pivots']" -- \ + > "frequencies/zika_tip-frequencies_with_relative_dates.json" \ + > "$TMP/tip-frequencies.json" + {} + $ rm -f "$TMP/tip-frequencies.json" + + $ popd > /dev/null diff --git a/tests/functional/frequencies/zika_tip-frequencies.json b/tests/functional/frequencies/zika_tip-frequencies.json index b95d444ae..086656e64 100644 --- a/tests/functional/frequencies/zika_tip-frequencies.json +++ b/tests/functional/frequencies/zika_tip-frequencies.json @@ -1,92 +1,92 @@ { "BRA/2016/FC_6706": { "frequencies": [ - 0.022579, - 0.011312, - 0.206983, - 0.102282 + 0.022368, + 0.011759, + 0.207309, + 0.102551 ] }, "COL/FLR_00008/2015": { "frequencies": [ - 0.243453, - 0.208443, - 0.008645, - 0.010659 + 0.244555, + 0.204597, + 0.008456, + 0.010737 ] }, "Colombia/2016/ZC204Se": { "frequencies": [ - 0.126056, - 0.231597, - 0.014167, - 0.017099 + 0.12489, + 0.234574, + 0.013671, + 0.017245 ] }, "DOM/2016/BB_0183": { "frequencies": [ - 0.017888, - 0.009342, - 0.183671, - 0.148759 + 0.017736, + 0.009645, + 0.185763, + 0.148494 ] }, "EcEs062_16": { "frequencies": [ - 0.018981, - 0.009763, - 0.190994, - 0.134398 + 0.018817, + 0.010092, + 0.192704, + 0.134289 ] }, "HND/2016/HU_ME59": { "frequencies": [ - 0.009484, - 0.006254, - 0.090552, - 0.457824 + 0.009425, + 0.006444, + 0.093589, + 0.456546 ] }, "PAN/CDC_259359_V1_V3/2015": { "frequencies": [ - 0.224832, - 0.214575, - 0.008963, - 0.011176 + 0.225577, + 0.211235, + 0.008761, + 0.011258 ] }, "PRVABC59": { "frequencies": [ - 0.243453, - 0.208443, - 0.008645, - 0.010659 + 0.244555, + 0.204597, + 0.008456, + 0.010737 ] }, "VEN/UF_1/2016": { "frequencies": [ - 0.030662, - 0.016483, - 0.206983, - 0.070196 + 0.030336, + 0.017436, + 0.204461, + 0.07079 ] }, "ZKC2/2016": { "frequencies": [ - 0.062612, - 0.083787, - 0.080395, - 0.036947 + 0.06174, + 0.089622, + 0.076833, + 0.037353 ] }, "generated_by": { "program": "augur", - "version": "7.0.2" + "version": "19.2.0" }, "pivots": [ - 2015.75, - 2016.0, - 2016.25, - 2016.5 + 2015.7521, + 2016.0041, + 2016.2527, + 2016.5014 ] } \ No newline at end of file diff --git a/tests/functional/frequencies/zika_tip-frequencies_with_fixed_dates.json b/tests/functional/frequencies/zika_tip-frequencies_with_fixed_dates.json index f370935a6..318920e30 100644 --- a/tests/functional/frequencies/zika_tip-frequencies_with_fixed_dates.json +++ b/tests/functional/frequencies/zika_tip-frequencies_with_fixed_dates.json @@ -10,11 +10,11 @@ }, "COL/FLR_00008/2015": { "frequencies": [ - 0.342553, - 0.340179, - 0.337787, - 0.342054, - 0.330097 + 0.34254, + 0.340199, + 0.337813, + 0.34201, + 0.329984 ] }, "Colombia/2016/ZC204Se": { @@ -55,20 +55,20 @@ }, "PAN/CDC_259359_V1_V3/2015": { "frequencies": [ - 0.314894, - 0.319642, - 0.324426, - 0.315891, - 0.339807 + 0.314921, + 0.319602, + 0.324374, + 0.31598, + 0.340033 ] }, "PRVABC59": { "frequencies": [ - 0.342553, - 0.340179, - 0.337787, - 0.342054, - 0.330097 + 0.34254, + 0.340199, + 0.337813, + 0.34201, + 0.329984 ] }, "VEN/UF_1/2016": { @@ -91,13 +91,13 @@ }, "generated_by": { "program": "augur", - "version": "14.1.0" + "version": "19.2.0" }, "pivots": [ - 2015.0, - 2015.25, - 2015.5, - 2015.75, - 2016.0 + 2015.0014, + 2015.2479, + 2015.4973, + 2015.7493, + 2016.0014 ] } \ No newline at end of file diff --git a/tests/functional/frequencies/zika_tip-frequencies_with_relative_dates.json b/tests/functional/frequencies/zika_tip-frequencies_with_relative_dates.json index 056fc9175..8bb7ae524 100644 --- a/tests/functional/frequencies/zika_tip-frequencies_with_relative_dates.json +++ b/tests/functional/frequencies/zika_tip-frequencies_with_relative_dates.json @@ -1,70 +1,81 @@ { "BRA/2016/FC_6706": { "frequencies": [ + 0.0, 0.0, 0.0 ] }, "COL/FLR_00008/2015": { "frequencies": [ + 0.0, 0.0, 0.0 ] }, "Colombia/2016/ZC204Se": { "frequencies": [ + 0.0, 0.0, 0.0 ] }, "DOM/2016/BB_0183": { "frequencies": [ + 0.0, 0.0, 0.0 ] }, "EcEs062_16": { "frequencies": [ + 0.0, 0.0, 0.0 ] }, "HND/2016/HU_ME59": { "frequencies": [ + 0.0, 0.0, 0.0 ] }, "PAN/CDC_259359_V1_V3/2015": { "frequencies": [ + 0.0, 0.0, 0.0 ] }, "PRVABC59": { "frequencies": [ + 0.0, 0.0, 0.0 ] }, "VEN/UF_1/2016": { "frequencies": [ + 0.0, 0.0, 0.0 ] }, "ZKC2/2016": { "frequencies": [ + 0.0, 0.0, 0.0 ] }, "generated_by": { "program": "augur", - "version": "14.1.0" + "version": "19.2.0" }, "pivots": [ - 2021.3333, - 2021.5833 + 2022.0178, + 2022.2644, + 2022.5137 ] } \ No newline at end of file