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

matUtils updates: new subcommand "fix"; improvements to MAT::Tree:move_node and mask --move-nodes #357

Merged
merged 3 commits into from
Nov 2, 2023

Commits on Nov 1, 2023

  1. In move_node, search for an existing child of the destination (new pa…

    …rent) that already has the same mutation(s) as the node to be moved. If a child with the same mutations is found then merge the moved node with the existing child instead of adding it as a new separate child. Handle all combinations of leaf or internal node type for existing child and moved node. Tree::collapse_tree used a breadth-first order for nodes which caused trouble when child nodes were removed due to merging during moves, and later visited in original BFS order. I changed it to recursively descend the tree and process the deepest nodes first.
    AngieHinrichs committed Nov 1, 2023
    Configuration menu
    Copy the full SHA
    3da9754 View commit details
    Browse the repository at this point in the history
  2. 1. Performance tweak in restrictMutationsLocally (--mask-mutations): …

    …for each masked site, instead of copying all mutations that aren't masked, which is almost all mutations in the branch, make a usually-empty list of only the mutations that must be masked and erase those as needed.
    
    2. In moveNodes (--move-nodes), instead of erroring out when the new parent's mutations are not exactly the same as he old parent's, also support the case of a new parent having a strict subset of the old parent's mutations.  In that case, add the mutations that the new parent doesn't have to the node and move the node to become a child of the new parent.
    AngieHinrichs committed Nov 1, 2023
    Configuration menu
    Copy the full SHA
    817202e View commit details
    Browse the repository at this point in the history
  3. New matUtils subcommand fix: finds nodes whose only mutation is a rev…

    …ersion of their grandparent's only mutation, a pattern that causes trouble for several Pango lineages, and moves those nodes to become children of their great-grandparents, having only the parent's mutation.
    AngieHinrichs committed Nov 1, 2023
    Configuration menu
    Copy the full SHA
    d532e07 View commit details
    Browse the repository at this point in the history