Represents a tree using a chain of nodes with on predecessor
(=ancestor) and multiple successors (=subclades).
|
__init__(self,
tree=None,
weight=1.0,
rooted=False,
name='
' ,
data=<class Bio.Nexus.Trees.NodeData at 0x1abbd70>,
values_are_support=False,
max_support=1.0)
Ntree(self,tree). |
source code
|
|
|
_parse(self,
tree)
Parses (a,b,c...)[[[xx]:]yy] into subcomponents and travels down
recursively. |
source code
|
|
|
|
|
_get_values(self,
text)
Extracts values (support/branchlength) from xx[:yyy], xx. |
source code
|
|
|
_walk(self,
node=None)
Return all node_ids downwards from a node. |
source code
|
|
|
|
|
split(self,
parent_id=None,
n=2,
branchlength=1.0)
Speciation: generates n (default two) descendants of a node. |
source code
|
|
|
|
|
|
|
get_taxa(self,
node_id=None)
Return a list of all otus downwards from a node (self, node_id). |
source code
|
|
|
get_terminals(self)
Return a list of all terminal nodes. |
source code
|
|
|
|
|
|
|
|
|
is_compatible(self,
tree2,
threshold,
strict=True)
Compares branches with support>threshold for compatibility. |
source code
|
|
|
|
|
distance(self,
node1,
node2)
Add and return the sum of the branchlengths between two nodes. |
source code
|
|
|
|
|
is_bifurcating(self,
node=None)
Return True if tree downstream of node is strictly bifurcating. |
source code
|
|
|
|
|
|
|
randomize(self,
ntax=None,
taxon_list=None,
branchlength=1.0,
branchlength_sd=None,
bifurcate=True)
Generates a random tree with ntax taxa and/or taxa from taxlabels. |
source code
|
|
|
display(self)
Quick and dirty lists of all nodes. |
source code
|
|
|
to_string(self,
support_as_branchlengths=False,
branchlengths_only=False,
plain=True,
plain_newick=False)
Return a paup compatible tree line. |
source code
|
|
|
__str__(self)
Short version of to_string(), gives plain tree |
source code
|
|
|
unroot(self)
Defines a unrooted Tree structure, using data of a rooted Tree. |
source code
|
|
|
|
Inherited from Nodes.Chain :
add ,
all_ids ,
collapse ,
is_parent_of ,
kill ,
link ,
trace ,
unlink
|