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 0x916ae6c>,
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
|
|
|
|
|
_add_nodedata(self,
nd,
st)
Add data to the node parsed from the comments, taxon and support. |
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_terminal(self,
node)
Returns True if node is a terminal node. |
source code
|
|
|
is_internal(self,
node)
Returns True if node is an internal node. |
source code
|
|
|
is_preterminal(self,
node)
Returns True if all successors of a node are terminal ones. |
source code
|
|
|
count_terminals(self,
node=None)
Counts the number of terminal nodes that are attached to a node. |
source code
|
|
|
collapse_genera(self,
space_equals_underscore=True)
Collapses all subtrees which belong to the same genus (i.e share the
same first word in their taxon name. |
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
|
|
|
|
|
|
|
has_support(self,
node=None)
Returns True if any of the nodes has data.support != None. |
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,
ladderize=None)
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
|
|
|
|
|
merge_with_support(self,
bstrees=None,
constree=None,
threshold=0.5,
outgroup=None)
Merges clade support (from consensus or list of bootstrap-trees) with
phylogeny. |
source code
|
|
Inherited from Nodes.Chain :
add ,
all_ids ,
collapse ,
is_parent_of ,
kill ,
link ,
trace ,
unlink
|