Skip to content

distance: Add option to calculate the cumulative distance from the root node to each tip instead of the pairwise distance #2035

Description

@huddlej

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions