General function for reordering nodes in a tree sequence #3466
hyanwong
started this conversation in
Show and tell
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
There have been a number of occasions when I have wanted to reorder the nodes in a tree sequence, for instance, to have the oldest nodes first (this e.g. allows younger nodes to be culled by truncating the table, implementing delete_younger. It's possible to do that using
ts.subset, but that can also have unintended consequences for individual IDs etc. Here's a nice function that simply reorders the nodes. In the long term it could be nice to have this in core, but I'm putting it here until that time:Beta Was this translation helpful? Give feedback.
All reactions