Slicing a tree (not a tree sequence) at a specific time #3052
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
-
I wanted to be able to take a time (e.g. of a mutation) and slice one tree in a tree sequence at that time, to find the nodes below each of the sliced lineages. E.g. given a tree like this, with a focal mutation 3 in red, sliced at the dotted line
I want to identify the nodes below the lineages that exist in the tree at that time, i.e. nodes 20, 2, 21, 24, 26, 29, 31, 33, 17, 34.
We can do that using a "timedesc" traversal, like this. I hope that's as efficient as it could be, since we only descend as far as we need to go.
For my purposes, I then wanted to take each of these identified nodes and look how the number of lineages increases through time. We can do that by taking each of these nodes and carrying on the descent from there:
Beta Was this translation helpful? Give feedback.
All reactions