Checking whether a node has mutations above it in a given tree #2082
Replies: 2 comments 4 replies
-
One way to do this is to iterate over all the mutations in the new tree (very efficient), and check if the |
Beta Was this translation helpful? Give feedback.
-
I would do it the simple way first as Yan suggests above. Let for site in T2.sites:
for mutation in site.mutations:
if mutation.node in S:
print("Mutation in T2 at node {mutation.node}") If you're doing this a lot (and you have lots of trees along the genome) then how you iterate over the trees can be important. Happy to provide example code here if you'd like to be more specific @a-ignatieva |
Beta Was this translation helpful? Give feedback.
-
The premise is that I go to a tree T1 at a specific site, select a (small) group of nodes from this tree based on some metric, and then move to tree T2 just to the right of T1. For each node in my group, I would like to check whether the node has any mutations (within the span of T2) on the edge just above it. Is there a quick and efficient way of doing this?
Beta Was this translation helpful? Give feedback.
All reactions