-
Notifications
You must be signed in to change notification settings - Fork 129
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 #1261: export v2: Remove hardcoding of "strain" as…
… the metadata ID column
- Loading branch information
Showing
9 changed files
with
534 additions
and
8 deletions.
There are no files selected for viewing
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
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
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,32 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Run export with metadata that contains "accession". | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" \ | ||
> --metadata "$TESTDIR/../data/dataset1_metadata_with_strain_and_accession.tsv" \ | ||
> --node-data "$TESTDIR/../data/div_node-data.json" "$TESTDIR/../data/location_node-data.json" \ | ||
> --auspice-config "$TESTDIR/../data/auspice_config1.json" \ | ||
> --maintainers "Nextstrain Team" \ | ||
> --output dataset.json > /dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/dataset-with-accession.json" dataset.json \ | ||
> --exclude-paths "root['meta']['updated']" "root['meta']['maintainers']" | ||
{} | ||
|
||
Run export with metadata that contains "accession", and use "accession" as the ID column. | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree-by-accession.nwk" \ | ||
> --metadata "$TESTDIR/../data/dataset1_metadata_with_strain_and_accession.tsv" \ | ||
> --metadata-id-columns accession \ | ||
> --node-data "$TESTDIR/../data/div_node-data-by-accession.json" "$TESTDIR/../data/location_node-data-by-accession.json" \ | ||
> --auspice-config "$TESTDIR/../data/auspice_config1.json" \ | ||
> --maintainers "Nextstrain Team" \ | ||
> --output dataset.json > /dev/null | ||
|
||
$ python3 "$TESTDIR/../../../../scripts/diff_jsons.py" "$TESTDIR/../data/dataset-with-accession-by-accession.json" dataset.json \ | ||
> --exclude-paths "root['meta']['updated']" "root['meta']['maintainers']" | ||
{} |
211 changes: 211 additions & 0 deletions
211
tests/functional/export_v2/data/dataset-with-accession-by-accession.json
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,211 @@ | ||
{ | ||
"version": "v2", | ||
"meta": { | ||
"updated": "2023-07-24", | ||
"maintainers": [ | ||
{ | ||
"name": "Nextstrain Team" | ||
} | ||
], | ||
"colorings": [ | ||
{ | ||
"key": "location", | ||
"title": "Location", | ||
"type": "categorical", | ||
"scale": [ | ||
[ | ||
"beta", | ||
"#bd0026" | ||
], | ||
[ | ||
"gamma", | ||
"#6a51a3" | ||
] | ||
], | ||
"legend": [ | ||
{ | ||
"value": "alpha", | ||
"display": "\u03b1" | ||
}, | ||
{ | ||
"value": "beta" | ||
} | ||
] | ||
}, | ||
{ | ||
"key": "mutation_length", | ||
"title": "Mutations per branch", | ||
"type": "continuous", | ||
"scale": [ | ||
[ | ||
1, | ||
"#081d58" | ||
], | ||
[ | ||
3, | ||
"#1d91c0" | ||
], | ||
[ | ||
5, | ||
"#c7e9b4" | ||
] | ||
], | ||
"legend": [ | ||
{ | ||
"value": 1, | ||
"display": "0-2", | ||
"bounds": [ | ||
-1, | ||
2 | ||
] | ||
}, | ||
{ | ||
"value": 3, | ||
"display": "3-5", | ||
"bounds": [ | ||
2, | ||
5 | ||
] | ||
}, | ||
{ | ||
"value": 5, | ||
"display": ">5", | ||
"bounds": [ | ||
5, | ||
10 | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"filters": [ | ||
"location" | ||
], | ||
"panels": [ | ||
"tree" | ||
] | ||
}, | ||
"tree": { | ||
"name": "ROOT", | ||
"node_attrs": { | ||
"div": 0, | ||
"mutation_length": { | ||
"value": 0 | ||
} | ||
}, | ||
"branch_attrs": {}, | ||
"children": [ | ||
{ | ||
"name": "accessionA", | ||
"node_attrs": { | ||
"div": 1, | ||
"accession": "accessionA", | ||
"location": { | ||
"value": "delta" | ||
}, | ||
"mutation_length": { | ||
"value": 1 | ||
} | ||
}, | ||
"branch_attrs": {} | ||
}, | ||
{ | ||
"name": "internalBC", | ||
"node_attrs": { | ||
"div": 2, | ||
"mutation_length": { | ||
"value": 2 | ||
} | ||
}, | ||
"branch_attrs": {}, | ||
"children": [ | ||
{ | ||
"name": "accessionB", | ||
"node_attrs": { | ||
"div": 3, | ||
"accession": "accessionB", | ||
"location": { | ||
"value": "gamma" | ||
}, | ||
"mutation_length": { | ||
"value": 1 | ||
} | ||
}, | ||
"branch_attrs": {} | ||
}, | ||
{ | ||
"name": "accessionC", | ||
"node_attrs": { | ||
"div": 3, | ||
"accession": "accessionC", | ||
"location": { | ||
"value": "gamma" | ||
}, | ||
"mutation_length": { | ||
"value": 1 | ||
} | ||
}, | ||
"branch_attrs": {} | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "internalDEF", | ||
"node_attrs": { | ||
"div": 5, | ||
"location": { | ||
"value": "alpha" | ||
}, | ||
"mutation_length": { | ||
"value": 5 | ||
} | ||
}, | ||
"branch_attrs": {}, | ||
"children": [ | ||
{ | ||
"name": "accessionD", | ||
"node_attrs": { | ||
"div": 8, | ||
"accession": "accessionD", | ||
"location": { | ||
"value": "alpha" | ||
}, | ||
"mutation_length": { | ||
"value": 3 | ||
} | ||
}, | ||
"branch_attrs": {} | ||
}, | ||
{ | ||
"name": "accessionE", | ||
"node_attrs": { | ||
"div": 9, | ||
"accession": "accessionE", | ||
"location": { | ||
"value": "alpha" | ||
}, | ||
"mutation_length": { | ||
"value": 4 | ||
} | ||
}, | ||
"branch_attrs": {} | ||
}, | ||
{ | ||
"name": "accessionF", | ||
"node_attrs": { | ||
"div": 6, | ||
"accession": "accessionF", | ||
"location": { | ||
"value": "beta" | ||
}, | ||
"mutation_length": { | ||
"value": 1 | ||
} | ||
}, | ||
"branch_attrs": {} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.