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__ = "epytext en" 
11   
12  import warnings 
13   
14  import BaseTree 
15   
16   
17 -class Tree(BaseTree.Tree):
18 """Newick Tree object.""" 19
20 - def __init__(self, root=None, rooted=False, id=None, name='', weight=1.0):
21 BaseTree.Tree.__init__(self, root=root or Clade(), 22 rooted=rooted, id=id, name=name) 23 self.weight = weight
24 25
26 -class Clade(BaseTree.Clade):
27 """Newick Clade (subtree) object.""" 28
29 - def __init__(self, branch_length=1.0, name=None, clades=None, 30 confidence=None, comment=None):
31 BaseTree.Clade.__init__(self, branch_length=branch_length, 32 name=name, clades=clades) 33 self.confidence = confidence 34 self.comment = comment
35