[Bioperl-l] Find distances between LCA's and the other nodes from a tree
Ross KK Leung
ross at cuhk.edu.hk
Tue Oct 4 01:53:29 UTC 2011
Hi, Tom. Let me formally define my problem because this would be more
effective for communication. My objective is to assign a state for
intermediate nodes. For the following example, nodes M and J can be assigned
with (Wing). After assignment (forget the unassigned first), the pairwise
distances of these intermediate nodes and any other nodes may be compared
(e.g. Nodes M and L; Nodes J and E).
+---I (Wing)
|
+---M
| |
| +---H (Wing)
|
+---O
| |
| |
| |
| +---L (No-Wing)
|
|
Z
| +---E (Wing)
| |
| +---K
| | |
| | +---D (No-Wing)
| |
+---N
|
| +---C (Wing)
| |
+---J
|
+---B (Wing)
Technically, I can either use TreeFunctionsI's method add_trait to the
leaves first. Then I back trace the ancestral nodes. While nodes K and J are
pictorially displayed to be nicely at the same level, in fact besides
exhaustively testing NodeI's methods ancestor or get_all_Descendants etc, I
cannot come up with a better idea. As you have mentioned before, when the
tree is big, this curse is amplified, not to say "Wing" is just one of
several hundred properties to test.
That's why I'm posting this question to see whether any convenient data
structures already exist to tackle this kind of "graph-traversing" process.
More information about the Bioperl-l
mailing list