Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dendropy.utility.error.UltrametricityError #121

Open
nick-youngblut opened this issue Sep 19, 2019 · 2 comments
Open

dendropy.utility.error.UltrametricityError #121

nick-youngblut opened this issue Sep 19, 2019 · 2 comments

Comments

@nick-youngblut
Copy link

I'm getting the following error when reading in a tree:

Traceback (most recent call last):
  File "./bin/scripts/treeRenameNodes.py", line 45, in <module>
    main(args)
  File "./bin/scripts/treeRenameNodes.py", line 39, in main
    tree = load_tree(args.tree)
  File "./bin/scripts/treeRenameNodes.py", line 31, in load_tree
    for i,node in enumerate(tree.ageorder_node_iter(include_leaves=False)):
  File "/ebio/abt3_projects/software/dev/miniconda3_dev/envs/phylo/lib/python3.7/site-packages/dendropy/datamodel/treemodel.py", line 4310, in ageorder_node_iter
    self.calc_node_ages()
  File "/ebio/abt3_projects/software/dev/miniconda3_dev/envs/phylo/lib/python3.7/site-packages/dendropy/datamodel/treemodel.py", line 5666, in calc_node_ages
    subtree=subtree,
dendropy.utility.error.UltrametricityError: Tree is not ultrametric within threshold of 1e-05: 0.024889999999999995.
Encountered in subtree of node <Node object at 0x7f7cd923ec18: 'NODE 0000005' (None)> (edge length of 0.03805):

    (JJOOJKAF:0.1839,BMGJBFJO:0.15901)NODE_0000005:0.03805

Age of children:
-   <Node object at 0x7f7cdb1eca90: 'None' (<Taxon 0x7f7cd92b3710 'JJOOJKAF'>)>: has age of 0.0 and edge length of 0.1839, resulting in parent node age of 0.1839
-   <Node object at 0x7f7cd923e1d0: 'None' (<Taxon 0x7f7cd923ec88 'BMGJBFJO'>)>: has age of 0.0 and edge length of 0.15901, resulting in parent node age of 0.15901

I can't tell from the documentation on how to read in a non-ultrametric tree.

@nick-youngblut
Copy link
Author

Is it actually possible to read in a non-ultrametric tree and then convert it to ultrametric? The package docs make a lot of statements about how ultrametric trees are needed for most (all?) functions, but I couldn't find any info on how to convert a tree to ultrametric.

@jeetsukumaran
Copy link
Owner

Sure. There's an entire body of theory, divergence time estimation, devoted to inferring ultrametric trees (or "converting" non-ultrametric trees to ultrametric ones). You need a model of evolution that decouples time and substitution rate (which would typically be of the strict or relaxed molecular clock variety) and probably some additional data (for calibration points, though you can calibrate the root to some arbitrary value if you don't care about absolute time).

https://revbayes.github.io/tutorials/dating/

https://beast2-dev.github.io/beast-docs/beast2/DivergenceDating/DivergenceDatingTutorial.html

http://ib.berkeley.edu/courses/ib200b/labs/ib200b_lab07_testing_molecular_clock.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants