Creating polytomies by removing edges #2926
hyanwong
started this conversation in
Show and tell
Replies: 1 comment 3 replies
-
Excellent, this'll be really useful for testing dating. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To test semi-realistic tree sequences with polytomies, it helps to be able to create polytomies in a tree sequence by removing edges (and grafting their descendant edges onto the parent of the removed edge). It turns out that the algorithm to do this over an entire tree sequence has some quite tricky logic, but after chatting to @a-ignatieva, I think the code below should do it. At some point we should test this more thoroughly and maybe even incorporate it into tskit? It turns out to be rather a core function for testing how to deal with polytomies
Test it by removing all edges that have no associated mutation. Note that there are two ways of doing this: we could either remove every interval that has no mutations, or we could remove edges with no mutations (i.e. if a mutation exists on any interval with parent=p and child=c, we keep all intervals with parent=p and child=c). The edge removal approach therefore removes fewer edges:
Beta Was this translation helpful? Give feedback.
All reactions