-
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.
Allow branch labels in node-data JSONs
Previously branch labels could not be specified in data passed to `augur export v2` except for two "special cases": (i) AA mutations (stored in node-data-json -> nodes) would create branch labels "aa", if applicable. (ii) `clade_annotation` (stored in node-data-json -> nodes) was interpreted to be the "clade" branch label, and exported as such. Here we extend the allowed node-data structure to include a top-level key `branches` as described in [1] and the test data added here [2]. This data is exported in the appropriate format for Auspice (unchanged). This paves the way for pipelines to define a range of branch labels for export. Currently the only usable key in this dict is 'labels'. If a branch label (via node-data-json -> branches -> node_name -> label) is provided for 'aa' or 'clade' then this will overwrite the values generated above (i, ii). A side-effect of this work is that the requirement for node-data JSONs to specify "nodes" has been relaxed (see [2] for an example); however if neither "nodes" nor "branches" are defined then we raise a validation error. [1] #720 [2] ./tests/functional/export_v2/branch-labels.json
- Loading branch information
1 parent
862bbb6
commit e51bb6b
Showing
8 changed files
with
366 additions
and
52 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
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,33 @@ | ||
{ | ||
"annotations": { | ||
"gene1": { | ||
"end": 150, | ||
"start": 50, | ||
"strand": "+" | ||
}, | ||
"gene2": { | ||
"end": 300, | ||
"start": 200, | ||
"strand": "+" | ||
}, | ||
"nuc": { | ||
"end": 500, | ||
"start": 1, | ||
"strand": "+" | ||
} | ||
}, | ||
"nodes": { | ||
"internalBC": { | ||
"aa_muts": { | ||
"gene1": ["S10G", "P20S"], | ||
"gene2": [] | ||
} | ||
}, | ||
"internalDEF": { | ||
"aa_muts": { | ||
"gene1": ["P20S"], | ||
"gene2": [] | ||
} | ||
} | ||
} | ||
} |
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,36 @@ | ||
{ | ||
"nodes": { | ||
"tipD": { | ||
"clade_membership": "membership D", | ||
"clade_annotation": "set via nodes→clade_annotation" | ||
}, | ||
"tipC": { | ||
"clade_membership": "membership C", | ||
"clade_annotation": "this should be overwritten by custom clade label" | ||
} | ||
}, | ||
"branches": { | ||
"ROOT": { | ||
"labels": { | ||
"fruit": "apple" | ||
} | ||
}, | ||
"tipA": { | ||
"labels": { | ||
"fruit": "orange" | ||
} | ||
}, | ||
"tipC": { | ||
"labels": { | ||
"clade": "clade C" | ||
} | ||
}, | ||
"internalBC": { | ||
"labels": { | ||
"fruit": "pomegranate", | ||
"vegetable": "pumpkin", | ||
"aa": "custom aa label" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.