OpenTreeOfLife / python-opentree

Python package for working with Open Tree of Life webservices and artifacts. Importable as opentree
BSD 2-Clause "Simplified" License
8 stars 5 forks source link

Best way to traverse trees in phylesystem to get node dates #5

Open snacktavish opened 4 years ago

snacktavish commented 4 years ago

From Luna on gitter: the example code and pseudocode to get node ages from source trees https://github.com/OpenTreeOfLife/python-opentree/blob/get-tree/examples/datelife.py Specifically, https://github.com/OpenTreeOfLife/python-opentree/blob/get-tree/examples/datelife.py#L39

Exporting as nexml and traversing in dendropy doesn't preserve annotations. Do we have nexson tree traversal code somewhere we should use?

mtholder commented 4 years ago

perhaps, but I just went ahead and wrote a nexson tree -> dendropy tree converter: https://github.com/OpenTreeOfLife/python-opentree/pull/6

mtholder commented 4 years ago

I should mention that there are some assert some-condition-that-might-not-hold in that branch. I was just working through 1 nexson (tree3 from ot_1877). So that code will probably require some generalization for other studies/trees