Opposite of EdgeTable.squash #2657
hyanwong
started this conversation in
Show and tell
Replies: 1 comment
-
This actually turns out to be useful in a number of scenarios. For instance, I just used it in awohns/unified_genealogy_paper#33 for splitting the ultimate ancestor, and it would be useful to create test tree sequences of multiple trees without performing simulations, e.g import tskit
tables = tskit.Tree.generate_balanced(5, span=10).tree_sequence.dump_tables()
unsquash(tables.edges, np.arange(10), [0]) # split the first edge
ts = tables.tree_sequence()
ts.draw_svg() |
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
-
This is something that I would have found useful in two different contexts (one when we split up the root in tsinfer into several nodes, the other when I have been trying to inject phasing error into a tree sequence). I stick it down here for posterity, but I wonder if an opposite of "squash" is a useful thing in the API. I've called it "unsquash", but something like "EdgeTable.slice" would work too. Because of using
itertools.pairwise
this only works on Python 3.10 or greater.Beta Was this translation helpful? Give feedback.
All reactions