Replies: 2 comments
-
I've just remembered, the |
Beta Was this translation helpful? Give feedback.
0 replies
-
See related operation in #3045. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to test how we do when dating a tree sequence with locally unary nodes, by removing flanking unary segments (i.e. the unary segments to the left of the leftmost coalescent point for a node, and the right of the rightmost coalescent point (the length of these regions if often overestimated by tsdate).
It's not that clear to me what the efficient way to do this is, although I imagine it involves
zip(ts.trees(), ts.edge_diffs())
and some inspection oftree.num_children_array
. The unary segments need removing so that nearest descendant coalescent node is linked directly to the nearest ancestor coalescent node via a new edge, and the previous edges between unary nodes in that region are removed/shortened.More and more I'm finding that I want to do tree-sequence hacking of this sort (e.g. #2885), and it seems worth including tips and general approaches in the planned edge_diffs tutorial. Does anyone have any tips or tricks? I feel there might be sub functions like tree.ancestors() which are absent from the API and which would help others to write tree-sequence or ARG editing algorithms of this sort.
Beta Was this translation helpful? Give feedback.
All reactions