Context
augur distance allows users to calculate distances between the root node of a tree and each tip.
Over long time periods, reversions back to the root alleles will cause these pairwise distances to underestimate the total number of mutations that have actually occurred. This underestimation manifests as an apparent "saturation" of mutations over time.
@trvrb recently worked around this issue in the ncov workflow by adding a custom script that calculates the cumulative distance from the root to each tip rather than the pairwise distance.
Description
As @trvrb notes in his ncov PR, we could add a new cumulative option that would calculate the cumulative distance through a pre-order tree traversal instead of the pairwise distance between root and tips.
Possible solution
The actual implementation will require some prototyping, but we may want to add a new --compare-to option like cumulative that performs the desired behavior. A top-level --cumulative argument would be most useful if we wanted cumulative calculations applied for all comparisons including ancestor and pairwise. Cumulative pairwise distances doesn't seem like a real use case, though.
We could use the Claude Code code from @trvrb's PR above as a starting point for the implementation in Augur.
Context
augur distance allows users to calculate distances between the root node of a tree and each tip.
Over long time periods, reversions back to the root alleles will cause these pairwise distances to underestimate the total number of mutations that have actually occurred. This underestimation manifests as an apparent "saturation" of mutations over time.
@trvrb recently worked around this issue in the ncov workflow by adding a custom script that calculates the cumulative distance from the root to each tip rather than the pairwise distance.
Description
As @trvrb notes in his ncov PR, we could add a new
cumulativeoption that would calculate the cumulative distance through a pre-order tree traversal instead of the pairwise distance between root and tips.Possible solution
The actual implementation will require some prototyping, but we may want to add a new
--compare-tooption likecumulativethat performs the desired behavior. A top-level--cumulativeargument would be most useful if we wanted cumulative calculations applied for all comparisons includingancestorandpairwise. Cumulative pairwise distances doesn't seem like a real use case, though.We could use the Claude Code code from @trvrb's PR above as a starting point for the implementation in Augur.