-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiple trees ("subtrees") have been available in Auspice since late 2021¹ and part of the associated schema since early 2022². Despite this there was no way to produce such datasets within Augur itself, and despite the schema changes the associated `augur validate` command was never updated to allow them. This commit adds multi-tree inputs to `augur export v2` as well as allowing them to validate with our associated validation commands. ¹ <nextstrain/auspice#1442> ² <#851>
- Loading branch information
1 parent
14e32ed
commit ddba55a
Showing
3 changed files
with
100 additions
and
17 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,53 @@ | ||
|
||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Create a small second tree (which has different names/labels than 'tree.nwk') | ||
$ cat > tree2.nwk <<~~ | ||
> (tipG:1,(tipH:1,tipI:1)internalHI:2)SECOND_ROOT:0; | ||
> ~~ | ||
|
||
Minimal export -- no node data, no metadata etc etc | ||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" tree2.nwk \ | ||
> --output minimal.json &> /dev/null | ||
|
||
More realistic export - with node_data for all nodes and metadata for some of them | ||
|
||
$ cat > metadata.tsv <<~~ | ||
> strain something | ||
> tipA foo | ||
> tipB foo | ||
> tipC foo | ||
> tipG bar | ||
> tipH bar | ||
> ~~ | ||
|
||
|
||
$ cat > node-data.json <<~~ | ||
> { | ||
> "nodes": { | ||
> "ROOT": {"mutation_length": 0}, | ||
> "tipA": {"mutation_length": 1}, | ||
> "internalBC": {"mutation_length": 2}, | ||
> "tipB": {"mutation_length": 1}, | ||
> "tipC": {"mutation_length": 1}, | ||
> "internalDEF": {"mutation_length": 5}, | ||
> "tipD": {"mutation_length": 3}, | ||
> "tipE": {"mutation_length": 4}, | ||
> "tipF": {"mutation_length": 1}, | ||
> "SECOND_ROOT": {"mutation_length": 0}, | ||
> "tipG": {"mutation_length": 1}, | ||
> "internalHI": {"mutation_length": 2}, | ||
> "tipH": {"mutation_length": 1}, | ||
> "tipI": {"mutation_length": 1} | ||
> } | ||
> } | ||
> ~~ | ||
|
||
$ ${AUGUR} export v2 \ | ||
> --tree "$TESTDIR/../data/tree.nwk" tree2.nwk \ | ||
> --metadata metadata.tsv --color-by-metadata something \ | ||
> --node-data node-data.json \ | ||
> --output output.json &> /dev/null |