Eliminate only unary nodes beyond the TMRCA of each tree #3341
Unanswered
RomainPechey
asked this question in
Q&A
Replies: 1 comment 3 replies
-
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


Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I am trying to count the number of ancestors separating each pair of individuals i,j. To do this, I ran simulations in SLiM and extracted tree sequences containing unary nodes.
I would now like to represent these trees, but I am unable to remove the unary nodes located beyond the TMRCA of each tree (the “tail” of each tree).
I looked at the arguments of the simplify() function.
When I use keep_unary=True, all unary nodes are retained; when I switch to keep_unary=False, the trees are cut correctly, but I lose the unary nodes on my branches.
I also tried keep_input_roots=False, but that didn't change anything. Is there a simple function that would solve my problem?
I am attaching an example of a tree that I would like to simplify.
Thank you in advance.
Romain Pechey
Beta Was this translation helpful? Give feedback.
All reactions