Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: zero length branches can still have aa mutations even without nu… #1249

Merged
merged 22 commits into from
Sep 12, 2023

Conversation

rneher
Copy link
Member

@rneher rneher commented Sep 8, 2023

…c muts

This problem arose when we are moving the attachment point across a branch of a node that had aa mutations that didn't correspond to any nucleotide mutations. The problem arose only in the specific case when the branch length of a terminal node is zero.

@vercel
Copy link

vercel bot commented Sep 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nextclade ✅ Ready (Inspect) Visit Preview Sep 12, 2023 6:29am

@rneher
Copy link
Member Author

rneher commented Sep 10, 2023

regarding your concern on the order of union and difference. I don't think this is an issue because in private_mutations each position has to be unique. The same is true for the result of the split operation. A particular position can only be either in the shared, or in the left list. Since a particular position is touched at most in one of the two operations, the order of the operations doesn't matter.

rneher and others added 7 commits September 11, 2023 15:01
by checking first whether the candidate_node equals the current best
node, the set of conditionals gets simplified and multiple previous
conditions are combined into one. There are now three possible results:

 - move to the parent node. Happens whenever best_node==candidate_node
 and all mutations that lead to the candidate_node are also found in
 the private mutations of best_node
 - move to a child (candidate_node!=best_node). This only happens when
 there is at least one mutation shared.
 - stay: in this case, the final placing is either a direct child of
 candidate_node, or splits the branch leading to it.
 - replace `.left.nuc_muts.is_empty()` with a check for `n_left_muts==0`
 which is calculated using the same function as `n_shared_muts`.
 - fix left/right error is split result when attaching to the root
@ivan-aksamentov ivan-aksamentov merged commit fe41dd8 into master Sep 12, 2023
0 of 2 checks passed
@ivan-aksamentov ivan-aksamentov deleted the fix/handle-spurious-aamuts-in-tree branch September 12, 2023 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants