skbio.tree.TreeNode.assign_supports

TreeNode.assign_supports()[source]

Extract support values from internal node labels of a tree.

State: Experimental as of 0.5.6.

Notes

A “support value” measures the confidence or frequency of the incoming branch (the branch from parent to self) of an internal node in a tree. Roots and tips do not have support values. To extract a support value from a node label, this method reads from left and stops at the first “:” (if any), and attempts to convert it to a number.

For examples: “(a,b)1.0”, “(a,b)1.0:2.5”, and “(a,b)’1.0:species_A’”. In these cases the support values are all 1.0.

For examples: “(a,b):1.0” and “(a,b)species_A”. In these cases there are no support values.

If a support value is successfully extracted, it will be stripped from the node label and assigned to the support property.

IMPORTANT: mathematically, “support value” is a property of a branch, not a node. Because of historical reasons, support values are usually attached to nodes in a typical tree file [1].

[1] Czech, Lucas, Jaime Huerta-Cepas, and Alexandros Stamatakis. “A

Critical Review on the Use of Support Values in Tree Viewers and Bioinformatics Toolkits.” Molecular biology and evolution 34.6 (2017): 1535-1542.

Examples

>>> from skbio import TreeNode
>>> newick = "((a,b)95,(c,d):1.1,(e,f)'80:speciesA':1.0);"
>>> tree = TreeNode.read([newick])
>>> tree.assign_supports()
>>> tree.lca(['a', 'b']).support
95
>>> tree.lca(['c', 'd']).support is None
True
>>> tree.lca(['e', 'f']).support
80
>>> tree.lca(['e', 'f']).name
'speciesA'