nextstrain / nextclade

Viral genome alignment, mutation calling, clade assignment, quality checks and phylogenetic placement
https://clades.nextstrain.org
MIT License
214 stars 58 forks source link

Mutations relative to different references #1237

Open rneher opened 1 year ago

rneher commented 1 year ago

We currently report mutations relative to the reference sequences and relative to the nearest node in the reference tree, called private mutations. The former are derived straight from the alignment, the latter are deduced by comparing the full set of differences to the set of differences the attachment node in the tree has. This happens here in the code:

https://github.com/nextstrain/nextclade/blob/12842f182ce946b89c6d18cf77120779e57e91be/packages_rs/nextclade/src/run/nextclade_run_one.rs#L152-L176

We could repeat this for different nodes in the tree, for example vaccines strains for flu. Instead of passing nearest_node to the find_private_mutations functions, we can pass any other node.

In some cases, it could also be interesting to display mutations relative to the founder of the parent clade. In this case the the node we compare to would be dependent on the clade assignment of the node.

In the UI, once could move the mutations column to the right next to the sequence view and thereby separate it from the other properties that are independent of the point of comparison.

image

A toggle could allow switching between different options (e.g. reference, VaccineStrain2023, clade_parent) and would also update the sequence view.

ivan-aksamentov commented 1 year ago

Slack thread for more context: https://neherlab.slack.com/archives/C015PFP5V44/p1691781214598009