Package Bio :: Package Phylo :: Module Newick
[hide private]
[frames] | no frames]

Source Code for Module Bio.Phylo.Newick

 1  # Copyright (C) 2009 by Eric Talevich (eric.talevich@gmail.com) 
 2  # This code is part of the Biopython distribution and governed by its 
 3  # license. Please see the LICENSE file that should have been included 
 4  # as part of this package. 
 5   
 6  """Classes corresponding to Newick trees, also used for Nexus trees. 
 7   
 8  See classes in `Bio.Nexus`: Trees.Tree, Trees.NodeData, and Nodes.Chain. 
 9  """ 
10  __docformat__ = "restructuredtext en" 
11   
12  from Bio.Phylo import BaseTree 
13   
14   
15 -class Tree(BaseTree.Tree):
16 """Newick Tree object.""" 17
18 - def __init__(self, root=None, rooted=False, id=None, name=None, weight=1.0):
19 BaseTree.Tree.__init__(self, root=root or Clade(), 20 rooted=rooted, id=id, name=name) 21 self.weight = weight
22 23
24 -class Clade(BaseTree.Clade):
25 """Newick Clade (sub-tree) object.""" 26
27 - def __init__(self, branch_length=1.0, name=None, clades=None, 28 confidence=None, comment=None):
32