You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The utility function json_to_tree does not correctly calculates branch length. Instead of calculating the difference between divergence of parent and child node, it simply assigns divergence:
Sets branch length to the difference in divergence between each node and
its parent instead of setting the cumulative branch length from the root
of the tree. Auspice JSONs store the cumulative branch length for easier
plotting in Auspice, but when we import the JSON into Python as a tree,
the branch length should not be cumulative. Since this cumulative branch
length is useful on its own and also required for calculating the actual
branch length (in the current recursive implementation of
`json_to_tree`, at least), this commit adds a `cumulative_branch_length`
attribute to each node of the tree produced by `json_to_tree` and passes
this value as a new optional argument to recursive calls.
We should really reimplement this function as a non-recursive function,
though. See the cartography script for annotating Auspice JSONs [1], for
an example of this kind of non-cursive implementation.
Fixes#714
[1] https://github.com/blab/cartography/blob/master/notebooks/scripts/annotate_tree.py
The utility function
json_to_tree
does not correctly calculates branch length. Instead of calculating the difference between divergence of parent and child node, it simply assigns divergence:https://github.com/nextstrain/augur/blob/master/augur/utils.py#L589
The text was updated successfully, but these errors were encountered: